Closed ShuiRuTian closed 4 months ago
Yes, the JSON parser in the example doesn't attempt to translate the string, only parse its structure: an attempt to translate the string would necessarily require character replacement and so on, which I consider to be beyond the scope of the example (and not necessarily useful for understanding how chumsky works).
Does make sense, thanks for the answer!
If I get it correctly,
escape
parser is usingignore
this indicates that the result will be ,ah, ignored. And thestring
is usingto_slice()
which will just use the origin string rather than mapped value.So, for string "\\r", it will still be "\\r", rather than "\r".