I am working on validating the Rust parser's handwritten stuff against a model written in antlr. I am hitting a problem with antlr escaping strings for me:
[15:48:50]~/src/rust2/src/grammar> grun RustLexer tokens -tokens
"\n"
[@0,0:3='"\n"',<46>,1:0]
and
[15:51:15]~/src/rust2/src/grammar> grun RustLexer tokens -tokens
"
"
[@0,0:2='"\n"',<46>,1:0]
Create the same string content. Is there a way for antlr to behave in any other way here? In particular, it would be acceptable if it escaped literal \ to \\, I could then collapse those down in my tool. As it stands, I am losing information about the input.