File tree Expand file tree Collapse file tree 4 files changed +3
-6
lines changed Expand file tree Collapse file tree 4 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -2929,7 +2929,6 @@ declare namespace ts {
2929
2929
getTokenText ( ) : string ;
2930
2930
getTokenValue ( ) : string ;
2931
2931
hasExtendedUnicodeEscape ( ) : boolean ;
2932
- hasPrecedingDot ( ) : boolean ;
2933
2932
hasPrecedingLineBreak ( ) : boolean ;
2934
2933
isIdentifier ( ) : boolean ;
2935
2934
isReservedWord ( ) : boolean ;
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ namespace ts {
22
22
getTokenText ( ) : string ;
23
23
getTokenValue ( ) : string ;
24
24
hasExtendedUnicodeEscape ( ) : boolean ;
25
- hasPrecedingDot ( ) : boolean ;
26
25
hasPrecedingLineBreak ( ) : boolean ;
27
26
isIdentifier ( ) : boolean ;
28
27
isReservedWord ( ) : boolean ;
@@ -834,7 +833,6 @@ namespace ts {
834
833
getTokenText : ( ) => text . substring ( tokenPos , pos ) ,
835
834
getTokenValue : ( ) => tokenValue ,
836
835
hasExtendedUnicodeEscape : ( ) => ( tokenFlags & TokenFlags . ExtendedUnicodeEscape ) !== 0 ,
837
- hasPrecedingDot : ( ) => ( tokenFlags & TokenFlags . PrecedingDot ) !== 0 ,
838
836
hasPrecedingLineBreak : ( ) => ( tokenFlags & TokenFlags . PrecedingLineBreak ) !== 0 ,
839
837
isIdentifier : ( ) => token === SyntaxKind . Identifier || token > SyntaxKind . LastReservedWord ,
840
838
isReservedWord : ( ) => token >= SyntaxKind . FirstReservedWord && token <= SyntaxKind . LastReservedWord ,
@@ -1471,7 +1469,6 @@ namespace ts {
1471
1469
pos ++ ;
1472
1470
return token = SyntaxKind . MinusToken ;
1473
1471
case CharacterCodes . dot :
1474
- tokenFlags |= TokenFlags . PrecedingDot ;
1475
1472
if ( isDigit ( text . charCodeAt ( pos + 1 ) ) ) {
1476
1473
tokenValue = scanNumber ( ) ;
1477
1474
return token = SyntaxKind . NumericLiteral ;
Original file line number Diff line number Diff line change @@ -1585,7 +1585,6 @@ namespace ts {
1585
1585
BinarySpecifier = 1 << 7 , // e.g. `0b0110010000000000`
1586
1586
OctalSpecifier = 1 << 8 , // e.g. `0o777`
1587
1587
ContainsSeparator = 1 << 9 , // e.g. `0b1100_0101`
1588
- PrecedingDot = 1 << 10 ,
1589
1588
BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier ,
1590
1589
NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinarySpecifier | OctalSpecifier | ContainsSeparator
1591
1590
}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ namespace ts {
13
13
const importedFiles : FileReference [ ] = [ ] ;
14
14
let ambientExternalModules : { ref : FileReference , depth : number } [ ] ;
15
15
let braceNesting = 0 ;
16
+ let lastTokenWasDot = false ;
16
17
// assume that text represent an external module if it contains at least one top level import/export
17
18
// ambient modules that are found inside external modules are interpreted as module augmentations
18
19
let externalModule = false ;
@@ -25,6 +26,7 @@ namespace ts {
25
26
else if ( token === SyntaxKind . CloseBraceToken ) {
26
27
braceNesting -- ;
27
28
}
29
+ lastTokenWasDot = token === SyntaxKind . DotToken ;
28
30
return token ;
29
31
}
30
32
@@ -78,7 +80,7 @@ namespace ts {
78
80
*/
79
81
function tryConsumeImport ( ) : boolean {
80
82
let token = scanner . getToken ( ) ;
81
- if ( token === SyntaxKind . ImportKeyword && ! scanner . hasPrecedingDot ( ) ) {
83
+ if ( token === SyntaxKind . ImportKeyword && ! lastTokenWasDot ) {
82
84
token = nextToken ( ) ;
83
85
if ( token === SyntaxKind . OpenParenToken ) {
84
86
token = nextToken ( ) ;
You can’t perform that action at this time.
0 commit comments