我正在使用 C# 版本的 StringTemplate 库 ( http://www.stringtemplate.org/ ) 来生成 C++ 代码。我的模板工作正常,直到我开始使用
<attribute:template(argument-list)>
将模板应用于“列表”中的多个值的语法(如果我在 StringTemplate 术语中是正确的,则为“多值参数”)。从那一刻起,EOL 字符从 \n 切换到 \r\n,这导致 Visual Studio 和其他编辑器每次打开生成的文件时都会弹出“将行尾字符转换为 \n”警告。
所以,我的问题是:如何强制 StringTemplate 始终输出 \n 作为 EOL 标记?