Closed ngeiswei closed 8 months ago
I assume you're talking about the S-expression parser, since a symbol atom created programmatically should be fine.
Currently the MeTTa parser doesn't do anything with escape sequences inside string literals except ensure a \" doesn't terminate the quote block.
There's a todo in the code to do escaping properly. Albeit buried. https://github.com/trueagi-io/hyperon-experimental/blob/3af6c9089b3c9b4a9bfc82661f5967d307686bac/repl/src/repl.default.metta#L5C1-L6C1
@ngeiswei , I believe we can close it?
What is the problem?
Escaped characters are mishandled, for instance
\
disappears from the string.How to reproduce the problem?
Try the following
What should be normally expected?
I suppose the escaped character should either be left untouched, like
or parsed and displayed like
What do you get instead?
What else do you have to say?
The same problem occurs with other escaped characters like
\t
. The misbehavior is also observed when usingprintln!
.