Skip to content

Commit c784e6d

Browse files
committed
Fix parsing identifiers that start with a non-BMP character
Fixes #498
1 parent f6c3764 commit c784e6d

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/tokenizer

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser/tokenizer/Tokenizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ private static String verifyIdentifier(String tokenString) {
566566
if (cp != '_' && !UCharacter.hasBinaryProperty(cp, UProperty.XID_START)) {
567567
invalid = 0;
568568
}
569-
for (int i = 1; i < invalid;) {
569+
for (int i = Character.charCount(cp); i < invalid;) {
570570
cp = tokenString.codePointAt(i);
571571
if (!UCharacter.hasBinaryProperty(cp, UProperty.XID_CONTINUE)) {
572572
invalid = i;

0 commit comments

Comments
 (0)