Adjusting Spark syntax

View: New views
5 Messages — Rating Filter:   Alert me  

Adjusting Spark syntax

by Louis DeJardin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

As Spark is being used in a real-world application a problem that was
spoken about has surfaced. The expression output syntaxes <%=expr%> $
{expr} and $expr; are all treated the same, but the third one collides
pretty badly with any prototype/jquery javascript that's not in a
static js.

So I'm thinking of taking out the $expr; syntax. Would anyone miss
that?

I've also had an interesting recommendation for a variation on the
conditional syntax.

<p if="x">foo</p>

<test if="x">
  <p>foo</p>
</test>

<test if="x">
  <p>foo</p>
  <else/>
  <p>bar</p>
</test>

<test if="x">
  <p>foo</p>
  <else if="y"/>
  <p>bar</p>
  <else/>
  <p>foo</p>
</test>

Thoughts?

- Lou

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Adjusting Spark syntax

by Hamilton Verissimo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I havent seen your parser, but I'd recommend patching it to accept the
proper syntax and ignore others.

$() is completely ignored by nvelocity, however I can't use $.ajax for
instance, which I can deal with by using jQuery.ajax... I take this is
a limitation in nvelocity's parser as $. could also gracefully
ignored.

--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Adjusting Spark syntax

by Louis DeJardin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


It's a recursive descent parser declared with a fluent interface. Very
easy to adjust.

http://dev.dejardin.org/trac/spark/browser/trunk/src/Spark/Parser/Markup/MarkupGrammar.cs#L71




On Jul 19, 2:30 am, "Hamilton Verissimo"
<hamm...@...> wrote:

> I havent seen your parser, but I'd recommend patching it to accept the
> proper syntax and ignore others.
>
> $() is completely ignored by nvelocity, however I can't use $.ajax for
> instance, which I can deal with by using jQuery.ajax... I take this is
> a limitation in nvelocity's parser as $. could also gracefully
> ignored.
>
> --
> Cheers,
> hamilton verissimo
> hamm...@...://www.castlestronghold.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Adjusting Spark syntax

by Ayende Rahien-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What is the parser that you are using?

On Sat, Jul 19, 2008 at 6:01 AM, Louis DeJardin <Louis.DeJardin@...> wrote:

It's a recursive descent parser declared with a fluent interface. Very
easy to adjust.

http://dev.dejardin.org/trac/spark/browser/trunk/src/Spark/Parser/Markup/MarkupGrammar.cs#L71




On Jul 19, 2:30 am, "Hamilton Verissimo"
<hamm...@...> wrote:
> I havent seen your parser, but I'd recommend patching it to accept the
> proper syntax and ignore others.
>
> $() is completely ignored by nvelocity, however I can't use $.ajax for
> instance, which I can deal with by using jQuery.ajax... I take this is
> a limitation in nvelocity's parser as $. could also gracefully
> ignored.
>
> --
> Cheers,
> hamilton verissimo
> hamm...@...://www.castlestronghold.com/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Adjusting Spark syntax

by Louis DeJardin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I couldn't find anything along the lines of a simple open source
parser to use. So it's one I put together heavily inspired by a blog
post from Luke H.

http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx

I wrote about it a little while ago also. It's pretty dry.

http://whereslou.com/2008/05/15/creating-a-domain-specific-language-for-parsing





On Jul 19, 12:16 pm, "Ayende Rahien" <aye...@...> wrote:

> What is the parser that you are using?
>
> On Sat, Jul 19, 2008 at 6:01 AM, Louis DeJardin <Louis.DeJar...@...>
> wrote:
>
>
>
> > It's a recursive descent parser declared with a fluent interface. Very
> > easy to adjust.
>
> >http://dev.dejardin.org/trac/spark/browser/trunk/src/Spark/Parser/Mar...
>
> > On Jul 19, 2:30 am, "Hamilton Verissimo"
> > <hamm...@...> wrote:
> > > I havent seen your parser, but I'd recommend patching it to accept the
> > > proper syntax and ignore others.
>
> > > $() is completely ignored by nvelocity, however I can't use $.ajax for
> > > instance, which I can deal with by using jQuery.ajax... I take this is
> > > a limitation in nvelocity's parser as $. could also gracefully
> > > ignored.
>
> > > --
> > > Cheers,
> > > hamilton verissimo
> > > hamm...@...://www.castlestronghold.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price