@@ -739,18 +739,6 @@ namespace ts {
739
739
}
740
740
}
741
741
742
- function isIdentifierStart ( ch : number ) : boolean {
743
- return ch >= CharacterCodes . A && ch <= CharacterCodes . Z || ch >= CharacterCodes . a && ch <= CharacterCodes . z ||
744
- ch === CharacterCodes . $ || ch === CharacterCodes . _ ||
745
- ch > CharacterCodes . maxAsciiCharacter && isUnicodeIdentifierStart ( ch , languageVersion ) ;
746
- }
747
-
748
- function isIdentifierPart ( ch : number ) : boolean {
749
- return ch >= CharacterCodes . A && ch <= CharacterCodes . Z || ch >= CharacterCodes . a && ch <= CharacterCodes . z ||
750
- ch >= CharacterCodes . _0 && ch <= CharacterCodes . _9 || ch === CharacterCodes . $ || ch === CharacterCodes . _ ||
751
- ch > CharacterCodes . maxAsciiCharacter && isUnicodeIdentifierPart ( ch , languageVersion ) ;
752
- }
753
-
754
742
function scanNumber ( ) : number {
755
743
let start = pos ;
756
744
while ( isDigit ( text . charCodeAt ( pos ) ) ) pos ++ ;
@@ -1064,12 +1052,12 @@ namespace ts {
1064
1052
let start = pos ;
1065
1053
while ( pos < end ) {
1066
1054
let ch = text . charCodeAt ( pos ) ;
1067
- if ( isIdentifierPart ( ch ) ) {
1055
+ if ( isIdentifierPart ( ch , languageVersion ) ) {
1068
1056
pos ++ ;
1069
1057
}
1070
1058
else if ( ch === CharacterCodes . backslash ) {
1071
1059
ch = peekUnicodeEscape ( ) ;
1072
- if ( ! ( ch >= 0 && isIdentifierPart ( ch ) ) ) {
1060
+ if ( ! ( ch >= 0 && isIdentifierPart ( ch , languageVersion ) ) ) {
1073
1061
break ;
1074
1062
}
1075
1063
result += text . substring ( start , pos ) ;
@@ -1439,17 +1427,17 @@ namespace ts {
1439
1427
return pos ++ , token = SyntaxKind . AtToken ;
1440
1428
case CharacterCodes . backslash :
1441
1429
let cookedChar = peekUnicodeEscape ( ) ;
1442
- if ( cookedChar >= 0 && isIdentifierStart ( cookedChar ) ) {
1430
+ if ( cookedChar >= 0 && isIdentifierStart ( cookedChar , languageVersion ) ) {
1443
1431
pos += 6 ;
1444
1432
tokenValue = String . fromCharCode ( cookedChar ) + scanIdentifierParts ( ) ;
1445
1433
return token = getIdentifierToken ( ) ;
1446
1434
}
1447
1435
error ( Diagnostics . Invalid_character ) ;
1448
1436
return pos ++ , token = SyntaxKind . Unknown ;
1449
1437
default :
1450
- if ( isIdentifierStart ( ch ) ) {
1438
+ if ( isIdentifierStart ( ch , languageVersion ) ) {
1451
1439
pos ++ ;
1452
- while ( pos < end && isIdentifierPart ( ch = text . charCodeAt ( pos ) ) ) pos ++ ;
1440
+ while ( pos < end && isIdentifierPart ( ch = text . charCodeAt ( pos ) , languageVersion ) ) pos ++ ;
1453
1441
tokenValue = text . substring ( tokenPos , pos ) ;
1454
1442
if ( ch === CharacterCodes . backslash ) {
1455
1443
tokenValue += scanIdentifierParts ( ) ;
@@ -1536,7 +1524,7 @@ namespace ts {
1536
1524
p ++ ;
1537
1525
}
1538
1526
1539
- while ( p < end && isIdentifierPart ( text . charCodeAt ( p ) ) ) {
1527
+ while ( p < end && isIdentifierPart ( text . charCodeAt ( p ) , languageVersion ) ) {
1540
1528
p ++ ;
1541
1529
}
1542
1530
pos = p ;
@@ -1599,7 +1587,7 @@ namespace ts {
1599
1587
let firstCharPosition = pos ;
1600
1588
while ( pos < end ) {
1601
1589
let ch = text . charCodeAt ( pos ) ;
1602
- if ( ch === CharacterCodes . minus || ( ( firstCharPosition === pos ) ? isIdentifierStart ( ch ) : isIdentifierPart ( ch ) ) ) {
1590
+ if ( ch === CharacterCodes . minus || ( ( firstCharPosition === pos ) ? isIdentifierStart ( ch , languageVersion ) : isIdentifierPart ( ch , languageVersion ) ) ) {
1603
1591
pos ++ ;
1604
1592
}
1605
1593
else {
0 commit comments