Skip to content

Commit 3bdfe84

Browse files
Rename None to IdentifierOrUnknown
1 parent db10cae commit 3bdfe84

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/compiler/scanner.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,12 @@ const regExpFlagToFirstAvailableLanguageVersion = new Map<RegularExpressionFlags
302302
]);
303303

304304
const enum TokenCategory {
305-
None = 0,
305+
IdentifierOrUnknown = 0,
306306

307-
/** Single-width tokens whose contents fit in the lower masked bits. */
307+
/**
308+
* Single-width tokens whose SyntaxKind value fits
309+
* in the lower masked bits of the current value.
310+
*/
308311
SimpleToken = 1 << 8, // must come first
309312
Whitespace = 1 << 9,
310313
LineBreak = 1 << 10,
@@ -321,7 +324,7 @@ const enum TokenCategory {
321324
const tokenCategoryLookup: TokenCategory[] = [];
322325
const tokenCategoryLookupUncommon = new Map<CharacterCodes, TokenCategory>();
323326
for (let i = 0; i < CharacterCodes.maxAsciiCharacter; i++) {
324-
tokenCategoryLookup.push(TokenCategory.None);
327+
tokenCategoryLookup.push(TokenCategory.IdentifierOrUnknown);
325328
}
326329

327330
for (
@@ -2027,9 +2030,9 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean
20272030

20282031
const tokenCategory = ch < tokenCategoryLookup.length ?
20292032
tokenCategoryLookup[ch] :
2030-
tokenCategoryLookupUncommon.get(ch) ?? TokenCategory.None;
2033+
tokenCategoryLookupUncommon.get(ch) ?? TokenCategory.IdentifierOrUnknown;
20312034

2032-
if (tokenCategory === TokenCategory.None) {
2035+
if (tokenCategory === TokenCategory.IdentifierOrUnknown) {
20332036
const identifierKind = scanIdentifier(ch, languageVersion);
20342037
if (identifierKind) {
20352038
return token = identifierKind;

0 commit comments

Comments
 (0)