Kornel Lesiński wrote:
> I could change it to:
> ${x} → value
> $${x} → ${x}
> $$${x} → $value
> $$$${x} → $${x}
> $$$$${x} → $$value
> $$$$$${x} → $$${x}
> etc.

Yes, please!

This is logical, and it is the behaviour defined by the TALES standard 
The current behaviour is a *bug* and should be fixed.

It's ok to add features to ZPT (especially the definition of operators); but 
IMO it's /not/ ok to change the meaning of existing syntax.

> However:
> • Pre-filters may need to deal with this to (un)escape text properly.
> With simpler rules you can just replace ${ with $${ to escape text.
> It's not so easy when you need to observe even/odd number of $s.

Well, you can consume the text sequentially and change every $$ into $, and 
treat every ${ or $\w as the beginning of a variable. Doesn't look very 
complicated to me.

Using regular expressions, you could look for $(.); if \1 is another $, you 
have a literal $, etc.  Anything else but [${\w] should yield an error, of 

> • It breaks backwards compatibility (hopefully not many people have
> $$${x} in their templates)

I doubt so; I can hardly imagine a serious use of sequences of two or more 
dollar signs.



PHPTAL mailing list

Reply via email to