views:

1596

answers:

1

I'm using the C# version of the StringTemplate library (http://www.stringtemplate.org/) to generate C++ code. My templates work fine, until I started using the

<attribute:template(argument-list)>

syntax to apply templates to multiple values in a 'list' ('multi-valued-argument' if I'm correct in the StringTemplate lingo). From that moment on, the EOL character switched from \n to \r\n, which cause Visual Studio and other editors to pop a 'convert end of line characters to \n' warning every time I open generated files.

So, my question is: how do I force StringTemplate to always output \n as EOL marker?

+1  A: 

You can try to use an Output Filter (http://www.antlr.org/wiki/display/ST/Output+Filters) to replace all \r\n with \n

mathieu