[Petal] Petal 0.5

Evan Simpson evan@4-am.com
Mon, 05 Aug 2002 17:29:55 -0500


Jean-Michel Hiver wrote:
> I did as much as I could! Enjoy!

Congrats on the release!

There's a discussion on the ZPT list about the path: and string: 
expression types that might be of interest to you.  We're talking about 
making them more tightly interrelated, but I'm not sure how it would 
affect your interpolation logic.  To be specific, here's what the 
expression grammars could become (very informally):

     PathExpr      ::= path [ '|' path ]* [ '|' Expression ]
     path          ::= StringExpr
     StringExpr    ::= ( plain_string | interpolation )*
     interpolation ::= ( '$' identifier ) | ( '${' path '}' )
     plain_string  ::= ( '$$' | non_dollar )*
     non_dollar    ::= any character except '$'

...where a 'path' has semantic restrictions applied to its expansion 
that a 'StringExpr' does not, such as starting with an identifier.

This would allow indirections such as the following:

  string:${request/${v1}} + ${request/${v2}}
  path:${$x}

Cheers,

Evan @ 4-am