So far, the Lexer dropped all backslashes from string literals. Removing this behaviour caused only one single test case to fail, where a quote character was escaped:
var lexer = new Lexer(new CharStream("hello {{ 'test\\'n this' }}world"));
While here, a quote character is escaped, the intended behaviour should not be to simply remove all backslashes.
This PR limits backslash removal to backslashes before quotes.
Moreover, it introduces an option preserveSourceLiterally which prevents backslash removal entirely and supersedes the decodeEntities option.
So far, the Lexer dropped all backslashes from string literals. Removing this behaviour caused only one single test case to fail, where a quote character was escaped:
While here, a quote character is escaped, the intended behaviour should not be to simply remove all backslashes.
This PR limits backslash removal to backslashes before quotes. Moreover, it introduces an option
preserveSourceLiterally
which prevents backslash removal entirely and supersedes thedecodeEntities
option.