Skip to content

Commit

Permalink
Fixed bug that caused identifiers with non-ASCII characters to someti…
Browse files Browse the repository at this point in the history
…mes be handled incorrectly.
  • Loading branch information
msfterictraut committed Oct 7, 2020
1 parent d1f950a commit a86cb5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/pyright-internal/src/parser/characters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export function isIdentifierChar(ch: number) {
);
}

// Lazy initialize the char map. We'll rarely get here.
if (!_identifierCharMapInitialized) {
_buildIdentifierLookupTable(false);
_identifierCharMapInitialized = true;
}

return (
_identifierCharMap[ch] === CharCategory.StartIdentifierChar ||
_identifierCharMap[ch] === CharCategory.IdentifierChar
Expand Down

0 comments on commit a86cb5d

Please sign in to comment.