[stringtemplate-interest] counter in anonymous templates with multi-valued attributes

Terence Parr parrt at cs.usfca.edu
Thu Sep 22 10:58:40 PDT 2005


On Sep 6, 2005, at 8:45 AM, Jose San Leandro wrote:
> Hi,
>
> It seems the default counter, $i$ (or <i>), is only available on  
> templates
> which accept one multi-valued attribute, such as
>
> users:{ User $i$: $it.name$ }

Interesting!  Yes, I guess $i$ should work for multiple iteration too!

> I get an error when trying to access such element on templates with  
> more than
> one formal parameter:
>
> users,jobs:{ u,j | User $i$: $u.name$, $j.name$ }
>
> Is there any way to access the counter in these cases?

It's a mistake on my part!  Adding to bug list.

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com



More information about the stringtemplate-interest mailing list