Repository navigation
Conversation
…i-byte char The error path sliced one byte past the hex digits, which lands inside the next character when it is multi-byte. Include the whole character instead. Fixes projectfluent#389
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #389.
skip_unicode_escape_sequencebuilds its error message by slicing toself.ptr + 1, one byte past the hex digits. If the next character is multi-byte, that's inside it andSlice::slicepanics:#389's repro is the same path:
\ufollowed by a combining caron (U+030C).The fix takes the whole next character instead, so the error now names it (
InvalidUnicodeEscapeSequence("ǔ"), matching what the JS parser prints). ASCII and end-of-input behave as before.Added
tests/invalid_unicode_escape.rscovering\u/\U, 2- and 4-byte characters, unterminated input,parse/parse_runtimeand&str/String. It panics without the fix.cargo test -p fluent-syntax,cargo fmt --checkandclippypass.