[stringtemplate-interest] $elseif$ not included?

Terence Parr parrt at cs.usfca.edu
Tue May 3 09:09:27 PDT 2005


On May 3, 2005, at 1:34 AM, FrankHarper.10118606 at bloglines.com wrote:

> In my templates I find that every once in a while I would like to use
> something
> like this
>
> $if(attrib1)$
> ... attrib1 case
> $elseif(attrib2)$
> ... attrib2
> case
> $else$
> ... default case
> $endif$
>
> But since there doesn't appear
> to be an $elseif$ in ST, I resort to
> the following more verbose version:
>
>
> $if(attrib1)$
> ... attrib1 case
> $else$
>  $if(attrib2)$
>  ... attrib2 case
>
>  $else$
>  ... default case
>  $endif$
> $endif$
>
> I'm wondering if there's
> a good reason for not including an $elseif$
> in ST? Or is it just a feature
> that hasn't been added yet?

Hi Frank,

There's not a good reason really.  I just haven't needed it that often 
so I left it out... :(

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