[stringtemplate-interest] ST4: Early evaluation of default arguments
Udo Borkowski
ub at abego-software.de
Sat Apr 30 03:39:11 PDT 2011
Currently the only way to enforce early evaluation of template default arguments is through the syntax:
p = {<(...)>}
I.e. one can only early evaluate anonymous template that contain just an expression tag.
It would be nice to also support early evaluation on any kind of anonymous template.
E.g. in http://www.antlr.org/pipermail/stringtemplate-interest/2009-August/002097.html Ter gave the following example:
if(cond, block, label={end<(uniq)>}) ::= << ... >>
However this will not give the expected result in ST4 (early evaluation of "end<(uniq)>").
Maybe we could extend the syntax for default arguments to also support
p = ({ ... })
i.e. putting "( … )" around the template forces early evaluation?
What do others think?
Udo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110430/716bcbac/attachment-0001.html
More information about the stringtemplate-interest
mailing list