[stringtemplate-interest] suppressing newlines and empty strings
Terence Parr
parrt at cs.usfca.edu
Tue Nov 8 13:29:09 PST 2005
On Nov 8, 2005, at 1:16 PM, David Ray wrote:
> Luis,
>
> Thanks for your feedback. I'm using the Java version (2.2). Here's
> an example:
>
> foo(bar) ::=
> <<
> hello $bar$
> >>
>
> yum() ::=
> <<
> $foo(bar="")$
> >>
>
> With this, I get the following error:
>
> problem parsing template 'yum', line 1:11: unexpected char: '"'
>
> If I replace bar="" with bar="x" or any other non-empty string,
> everything works. This isn't a show-stopper bug, just kind of
> annoying :)
I think i fixed that in 2.3 beta...try {} instead of "". Or, just
don't set it. Parameters that are not set yield empty values by
default :)
Ter
More information about the stringtemplate-interest
mailing list