[stringtemplate-interest] nesting templates and getting the loop count of the outer loop

Johannes Luber jaluber at gmx.de
Mon Oct 27 10:25:21 PDT 2008


Roel Vanhout schrieb:
> Hi,
>  
>  
> I have situation similar to what was asked here:
> http://markmail.org/message/izumze7jxytlwsds#query:stringtemplate%20i0+page:1+mid:izumze7jxytlwsds+state:results but
> the results that the poster there gets are not the same for me. A
> regression maybe, or differences in the Java/C# version? Or more
> probable, me missing something.
>  
> My problem is as follows: I have templates like this:
>  
> initialize_dlg(group_nr) ::= <<
> m_DialogIndexes["<group_nr>,<i0>"] = newdlg<it.ViewName>; }
>>>
>  
> initialize_dlgs() ::= <<
> <it.Pages:initialize_dlg(group_nr=i0);separator="\n">
>>>
>  
> The expexted output is for <group_nr> (in initialize_dlg) to be 0 a
> couple of times, then 1 a couple of times etc. However, <group_nr> and
> <i0> are always the same in initialize_dlg, which leads me to believe
> that <group_nr> is somehow passed not as the value of i0 in
> initialize_dlgs() but as a string literal 'i0' which is then
> re-evaluated in initialize_dlg.
>  
> I'm using StringTemplate 3.0.1 for C#. Thanks.

Did you try the beta for StringTemplate 3.1 for C# already?

Johannes
>  
>  
> cheers,
>  
> roel
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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