[stringtemplate-interest] Ok, I'm stumped
Barnes, Jeff
JB0284 at att.com
Mon Aug 6 11:37:36 PDT 2007
No it doesn't work either.
Regards,
Jeff
-----Original Message-----
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Terence
Parr
Sent: Monday, August 06, 2007 2:34 PM
To: StringTemplate
Subject: Re: [stringtemplate-interest] Ok, I'm stumped
On Aug 6, 2007, at 9:24 AM, Barnes, Jeff wrote:
> True dat... This code better illuminates the problem. I guess I
> better go back and revise some unit tests... ;-)
>
> import org.antlr.stringtemplate.StringTemplate;
>
> public class Test
> {
> static class Form {
> String[] names;
> boolean[] values;
> public String[] getNames() { return names; }
> public boolean[] getValues() { return values; }
> }
>
> public static void main(String[] args)
> {
> Form f = new Form();
> f.names = new String[] { "Terence", "Parr" };
> f.values = new boolean[] { false, true };
>
> StringTemplate st = new StringTemplate(
> "$form.names,form.values:{ name, value |\n" +
> "$name$\n" +
> "$value$ " +
> "$if(value)$I'm True$else$I'm False$endif$" +
> "};separator=\"\n\"$");
> st.setAttribute("form", f);
> System.out.println(st.toString());
> }
> }
Hi GUys!
Hmm...does
$form.values:{v|...}$
work? If so, then it's an issue with the parallel walking thingie.
Let me know; i'll add abug.
Ter
_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest at antlr.org
http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list