Escape sequences are tokenized but never interpreted; backslashes leak into output #21
Labels
No labels
automated-🤖
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Hemera/nomo#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
String parsing uses
take_escaped(none_of(['"', '\\']), '\\', one_of(['"', 'n']))(src/lexer/mod.rs:445), which accepts\"and\n, but the backslash is captured verbatim and nothing unescapes the value afterwards.Verified output:
{{= "a\nb" }}→ outputs the 4 literal charactersa\nb(backslash +n), not a newline.{{= "say \"hi\"" }}→ outputssay \"hi\"(backslashes preserved).So the escape syntax works (the string doesn't terminate early) but the escapes have no effect on the value. Either interpret
\n/\"(and reject unknown escapes), or document that backslashes are kept literally.