[stringtemplate-interest] adding Stuff for 3.2.1

Terence Parr parrt at cs.usfca.edu
Wed Aug 13 16:25:50 PDT 2008


On Aug 13, 2008, at 4:22 PM, Johannes Luber wrote:
>> o Made template output sensitive to the anchor of any enclosing  
>> template
>>   instances. ST used to ignore anchor unless you had a wrap and now  
>> it
>>   looks at anchor like an indent; uses widest.  ST used to give this:
>> 	{ a,
>> 	{ 1,
>> 	2,
>> 	3 }
>> 	, b }
>>   for these templates where the first was stuck into second
>> 	<\n>{ <stuff; anchor, separator=",\n"> }<\n>
>>         { <values; anchor, separator=", "> }
>>   but now gives:
>> 	{ a,
>> 	  { 1,
>> 	    2,
>> 	    3 }
>> 	  , b };
>
> Wouldn't it make more sense to dedent the ", b };" again?

Oh, right, yeah, that is another problem...the separator still  
appears, but at the anchor offset of outer list (a here).  You *do*  
want the ',' to line up with '{' but the anchor prevents anything  
generated from <values; anchor> to be to the left...I need sort of  a  
"soft separator".  Since I don't really know what I want here I didn't  
do anything. ;) I need some kind of negative indent in general but  
have no good ideas.

Ter


More information about the stringtemplate-interest mailing list