datalust / superpower

A C# parser construction toolkit with high-quality error reporting
Apache License 2.0
1.05k stars 98 forks source link

Using backslash in CStyle QuotedString causes syntax error #148

Closed ScottKane closed 2 years ago

ScottKane commented 2 years ago

I'm currently using a token parser and have a simple expression based language which supports binary and unary expressions, numerics and strings (QuotedString.CStyle). Given the following I would expect the same result to just be returned to the console (minus quotes) "\\nHello", but I instead get unexpected character '"', expected '-', '(', number or string.. Is there something I'm missing in regards to how this should work?

ScottKane commented 2 years ago

Any string without a backslash in it works as intended. I have a match for a backslash token in my tokenizer. Not sure if I should need this, given quoted strings are text parsers?