Repository navigation
fix: Report non-ASCII characters in unicode escapes as parse errors - #801
Merged
eed3si9n merged 1 commit intoNov 4, 2026
Merged
Conversation
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.
Parser.descapeindexes the 128-entryHexCharstable with the raw escape character. A non-ASCII character in a\uescape, such as"\u00é0", throwsArrayIndexOutOfBoundsException.Parser.parsetreats that as end of input and throwsIncompleteParseException("exhausted input"). As a result:ParseException: expected valid unicode escape.AsyncParser.absorbandfinalAbsorbthrow instead of returningLeft.This change treats any character outside the table as an invalid hex digit, so these inputs fail the same way
"\uqqqq"already does.Tests
SyntaxCheckadds two properties for non-ASCII escape characters (Latin-1, two-byte and three-byte UTF-8). One checks theStringandByteBufferparsers and the other checksAsyncParser. Both fail onmainand pass with the fix.parserJVM/testandastJVM/testpass on Scala 2.12, 2.13 and 3.Fixes #800