@@ -302,9 +302,12 @@ const regExpFlagToFirstAvailableLanguageVersion = new Map<RegularExpressionFlags
302302] ) ;
303303
304304const 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 {
321324const tokenCategoryLookup : TokenCategory [ ] = [ ] ;
322325const tokenCategoryLookupUncommon = new Map < CharacterCodes , TokenCategory > ( ) ;
323326for ( let i = 0 ; i < CharacterCodes . maxAsciiCharacter ; i ++ ) {
324- tokenCategoryLookup . push ( TokenCategory . None ) ;
327+ tokenCategoryLookup . push ( TokenCategory . IdentifierOrUnknown ) ;
325328}
326329
327330for (
@@ -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