[stringtemplate-interest] indented IFs in STv4

Terence Parr parrt at cs.usfca.edu
Fri Nov 6 17:04:10 PST 2009


Ooops. correct that it should not indent twice...but it shouldn't  
indent even once:

[
foo
]

The IF indent indicates you want that as just a "readability" indent  
and not a true one. We have to subtract that from indent of foo or bar.

An IF on line by itself is a true indent:

	<if(x)>foo<endif>

Ter
On Nov 6, 2009, at 2:47 PM, Terence Parr wrote:

> Hi,
>
> Some of you have asked for (and I've wanted) to indent IFs w/o
> screwing up the indentation.  For example,
>
> [
>     <if(x)>
>     foo
>     <else>
>     bar
>     <endif>
> ]
>
> should not indent foo or bar twice, which it did in STv3.  result is
>
> [
> 	foo
> ]
>
> or
>
> [
> 	bar
> ]
>
> took me a bit to make this happen but worth it.
>
> Ter
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list