[stringtemplate-interest] normalize \n to \n in ST
parrt at cs.usfca.edu
Wed Jun 4 13:09:50 PDT 2008
It turns out that there is an easy way. new AutoIndentWriter(buf)
uses the default system property for line ending. You can also specify
a second parameter which is the newline string. :)
If you tell ST to use a specific writer for all templates and a group,
make sure that the constructor for that writer sets theline ending as
you wish. A trivial fix, going to start testing it shortly.
I think that it is best to push out 3.2 ST and use it for ANTLR 3.1
On Jun 4, 2008, at 12:56 PM, brian wrote:
> On Wed, Jun 4, 2008 at 2:51 PM, Terence Parr <parrt at cs.usfca.edu>
>> I am proposing to normalize the use of \n in templates. If you say \n
>> you get \n or \r\n depending on locale. Actually, maybe we should
>> make it a parameter you send to the template group? You might have a
>> Web server that should be sensitive to the client locale not the
>> server locale, right?
> Yeah. Sometimes protocols or whatever dictate certain line endings,
> and it doesn't matter where the client/server is running. If you make
> \n autochange, please leave some way to get ST to produce exactly what
> we ask for.
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
More information about the stringtemplate-interest