Roel
Roel

Reputation: 19612

C# StringTemplate - how to set eol character

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?

Upvotes: 4

Views: 2686

Answers (1)

mathieu
mathieu

Reputation: 31192

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

Upvotes: 1

Related Questions