Skip to content

Conversation

@tecosaur
Copy link
Member

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.
@tecosaur tecosaur merged commit 03b823b into main Mar 18, 2025
4 checks passed
@tecosaur tecosaur deleted the fix-termial-escaped-newline branch March 18, 2025 17:50
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