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

Terence Parr parrt at cs.usfca.edu
Wed Oct 29 11:45:09 PDT 2008


On Oct 29, 2008, at 11:39 AM, Roel Vanhout wrote:

>>> I may be looking at this in a too code-like way, I don't know - but
> is
>>> there a way to do what I want?
>
>> Sure.  don't do group_nr = i0
>> group_nr is visible anyway.
>
> Well, I got it working, after much trial and error. I *do* need to do
> group_nr=i0, but at a level higher: in the 'main' template. So for
> anyone coming across this via Google, this template works:

Oh, right. I didn't look closely enough to see. group_nr is not set  
anywhere else. I thought it was defined above as an attribute and  
then, by dynamic scoping, it would be visible. :)

Ter


More information about the stringtemplate-interest mailing list