Skip to content

Commit 42f270c

Browse files
committed
prefer codePointAt to account for unicode
1 parent aa5e704 commit 42f270c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/LowerCaseCharStream.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export class LowerCaseCharStream implements CharStream {
2626
if (c <= 0) {
2727
return c;
2828
}
29-
return String.fromCharCode(c).toLowerCase().charCodeAt(0);
29+
const char = String.fromCharCode(c).toLowerCase();
30+
return char.codePointAt(0) ?? char.charCodeAt(0);
3031
}
3132

3233
mark(): number {

0 commit comments

Comments
 (0)