C # StringTemplate - how to set eol character

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

<attribute:template(argument-list)> 
syntax

to apply templates to multiple values ​​in a "list" (a "multi-valued argument" if I'm correct in StringTemplate linguistics). From that moment on, the EOL character switched from \ n to \ r \ n, which causes Visual Studio and other editors to output "convert end-of-line characters to \ n" each time the generated files are opened.

So my question is: how to make StringTemplate always output \ n as an EOL token?

+4
source share
1 answer

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

+1
source

Source: https://habr.com/ru/post/1277350/


All Articles