Enumerations are not a problem, spark expressions are csharp. I'll
take a look at nbusiness to see what type of templating you're trying
to do. (I'm on a blackberry at the moment.)
Is there a particular syntax you for have in mind for control
notation? A leading # works, though it might be a problem if you want
to include #if statements in the output code.
Maybe a set of special comments, like
//foreach(var thing in entity.Things)
public ${thing.TypeName} ${thing.Name};
//end
Although in this case straight inlineIcode would probably fit nicely
and be more managable than it is in html. Maybe a simple escape for
that type of thing?
//! foreach (var ns in entity.namespaces) {
using ${ns};
//! }
Internally spark goes through a handful of steps to parse the template
markup with a loose xml grammar, postprocess for special node and
attributes, build a list of logical code chunks, and finally to use a
small number of generators on the code chunks to render the source
code. The source is then compiled and loaded.
So I was thinking of refactoring just the first few steps (parsing
with a grammar, postprocess of of nodes, and building of logical
chunks) into a little pluggable service provider class. No problem
there. Then simply make a different provider that parses with a
different grammar and builds the code chunks.
And before you know it you can instantiate the spark view factory, set
a different grammar provider, and you'll be able to parse code-centric
templates all you want.
It'll be kind of like skinning spark. Could be a nice feature to have
in general, since someone will probably ask about js/css template
targets some day. :)
On 7/23/08, Justin Chase <justn...@gmail.com> wrote:
>