[stringtemplate-interest] indented IFs in STv4
Terence Parr
parrt at cs.usfca.edu
Fri Nov 6 17:36:29 PST 2009
doh. ok, now I'm not sure. What do you guys think? It's easier to
impl. and understand if I simply ignore indents on multi-line IFs and
indent values like foo according to literally what's in front of them.
Ter
On Nov 6, 2009, at 5:04 PM, Terence Parr wrote:
> 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
>
> _______________________________________________
> 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