1- import * as ts from "./_namespaces/ts" ;
21import { convertToObjectWorker } from "./commandLineParser" ;
32import {
43 addRange , append , AssertionLevel , concatenate , emptyArray , emptyMap , findIndex , forEach , getSpellingSuggestion ,
@@ -11,9 +10,10 @@ import { BaseNodeFactory } from "./factory/baseNodeFactory";
1110import { createNodeFactory , NodeFactoryFlags } from "./factory/nodeFactory" ;
1211import {
1312 isAsyncModifier , isExportAssignment , isExportDeclaration , isExportModifier , isExternalModuleReference ,
14- isFunctionTypeNode , isImportDeclaration , isImportEqualsDeclaration , isJSDocFunctionType , isJSDocNullableType ,
15- isJSDocReturnTag , isJSDocTypeTag , isJsxOpeningElement , isJsxOpeningFragment , isMetaProperty , isNonNullExpression ,
16- isPrivateIdentifier , isTaggedTemplateExpression , isTypeReferenceNode ,
13+ isFunctionTypeNode , isIdentifier as isIdentifierNode , isImportDeclaration , isImportEqualsDeclaration ,
14+ isJSDocFunctionType , isJSDocNullableType , isJSDocReturnTag , isJSDocTypeTag , isJsxOpeningElement ,
15+ isJsxOpeningFragment , isMetaProperty , isNonNullExpression , isPrivateIdentifier , isTaggedTemplateExpression ,
16+ isTypeReferenceNode ,
1717} from "./factory/nodeTests" ;
1818import { setTextRange } from "./factory/utilitiesPublic" ;
1919import { fileExtensionIsOneOf , normalizePath } from "./path" ;
@@ -1757,7 +1757,7 @@ namespace Parser {
17571757 }
17581758
17591759 // Otherwise, if this isn't a well-known keyword-like identifier, give the generic fallback message.
1760- const expressionText = ts . isIdentifier ( node ) ? idText ( node ) : undefined ;
1760+ const expressionText = isIdentifierNode ( node ) ? idText ( node ) : undefined ;
17611761 if ( ! expressionText || ! isIdentifierText ( expressionText , languageVersion ) ) {
17621762 parseErrorAtCurrentToken ( Diagnostics . _0_expected , tokenToString ( SyntaxKind . SemicolonToken ) ) ;
17631763 return ;
@@ -6335,7 +6335,7 @@ namespace Parser {
63356335 let node : ExpressionStatement | LabeledStatement ;
63366336 const hasParen = token ( ) === SyntaxKind . OpenParenToken ;
63376337 const expression = allowInAnd ( parseExpression ) ;
6338- if ( ts . isIdentifier ( expression ) && parseOptional ( SyntaxKind . ColonToken ) ) {
6338+ if ( isIdentifierNode ( expression ) && parseOptional ( SyntaxKind . ColonToken ) ) {
63396339 node = factory . createLabeledStatement ( expression , parseStatement ( ) ) ;
63406340 }
63416341 else {
@@ -8393,7 +8393,7 @@ namespace Parser {
83938393 case SyntaxKind . ArrayType :
83948394 return isObjectOrObjectArrayTypeReference ( ( node as ArrayTypeNode ) . elementType ) ;
83958395 default :
8396- return isTypeReferenceNode ( node ) && ts . isIdentifier ( node . typeName ) && node . typeName . escapedText === "Object" && ! node . typeArguments ;
8396+ return isTypeReferenceNode ( node ) && isIdentifierNode ( node . typeName ) && node . typeName . escapedText === "Object" && ! node . typeArguments ;
83978397 }
83988398 }
83998399
@@ -8664,8 +8664,8 @@ namespace Parser {
86648664 }
86658665
86668666 function escapedTextsEqual ( a : EntityName , b : EntityName ) : boolean {
8667- while ( ! ts . isIdentifier ( a ) || ! ts . isIdentifier ( b ) ) {
8668- if ( ! ts . isIdentifier ( a ) && ! ts . isIdentifier ( b ) && a . right . escapedText === b . right . escapedText ) {
8667+ while ( ! isIdentifierNode ( a ) || ! isIdentifierNode ( b ) ) {
8668+ if ( ! isIdentifierNode ( a ) && ! isIdentifierNode ( b ) && a . right . escapedText === b . right . escapedText ) {
86698669 a = a . left ;
86708670 b = b . left ;
86718671 }
@@ -8690,7 +8690,7 @@ namespace Parser {
86908690 const child = tryParseChildTag ( target , indent ) ;
86918691 if ( child && ( child . kind === SyntaxKind . JSDocParameterTag || child . kind === SyntaxKind . JSDocPropertyTag ) &&
86928692 target !== PropertyLikeParse . CallbackParameter &&
8693- name && ( ts . isIdentifier ( child . name ) || ! escapedTextsEqual ( name , child . name . left ) ) ) {
8693+ name && ( isIdentifierNode ( child . name ) || ! escapedTextsEqual ( name , child . name . left ) ) ) {
86948694 return false ;
86958695 }
86968696 return child ;
0 commit comments