Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less conservative char escaping #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tecosaur
Copy link
Collaborator

Fixes #104, hopefully doesn't introduce any new issues (no red flags from the fuzz test at least).

See the commit message for more details.

With the !isempty check, terminal newlines as appear in

    styled"stuff\
    "

or similar are not eaten, and so parsed as "stuff\\\n".

This differs to the EBNF and standard string parsing (which we aim to
emulate), which parses

    "stuff\
    "

as "stuff".

While the !isempty check is a nice sign that I wa sbeing careful writing
the code here, it's actually safe when the state is empty, and no errors
appear in the syntax fuzzing tests.

So, all in all, it seems like we're better off without the !isempty check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Line-end backslash before newline and end is interpreted incorrectly
1 participant