[stringtemplate-interest] ST4 - Newlines in parameter default values are not respected

Udo Borkowski ub at abego-software.de
Sun Jul 25 01:19:40 PDT 2010


I am working StringTemplate v4, snapshot 2010-05-10.

It looks like newlines in string literals used as default values for template parameters are not expanded.

A full test case can be found here: http://pastebin.com/t6TDY4qf


Example ===============

Consider this group definition:
---
t2(p1) ::= <<
<p1>
>>

t1() ::= <<
START-<t2(p1="Some\nText")>-END
>>
---

Here t1 (correctly) renders to
---
START-Some
Text-END
---

Now make the actual value for parameter p1 a default parameter value, i.e. 
---
t2(p1="Some\nText") ::= <<
<p1>
>>

t1() ::= <<
START-<t2()>-END
>>
---

Unexpectedly this renders t1 to
---
START
Some\nText
END
---
===============

Udo

P.S.: 
Is there a way to access the version control system directly to always get the latest and greatest, or just the snapshots from http://www.stringtemplate.org/download/trunk ?


More information about the stringtemplate-interest mailing list