/third_party/typescript/src/services/formatting/ |
D | rules.ts | 10 const allTokens: SyntaxKind[] = []; 11 for (let token = SyntaxKind.FirstToken; token <= SyntaxKind.LastToken; token++) { 12 if (token !== SyntaxKind.EndOfFileToken) { 16 function anyTokenExcept(...tokens: SyntaxKind[]): TokenRange { 21 …const anyTokenIncludingMultilineComments = tokenRangeFrom([...allTokens, SyntaxKind.MultiLineComme… 22 const anyTokenIncludingEOF = tokenRangeFrom([...allTokens, SyntaxKind.EndOfFileToken]); 23 const keywords = tokenRangeFromRange(SyntaxKind.FirstKeyword, SyntaxKind.LastKeyword); 24 …const binaryOperators = tokenRangeFromRange(SyntaxKind.FirstBinaryOperator, SyntaxKind.LastBinaryO… 25 …aryKeywordOperators = [SyntaxKind.InKeyword, SyntaxKind.InstanceOfKeyword, SyntaxKind.OfKeyword, S… constant 26 …const unaryPrefixOperators = [SyntaxKind.PlusPlusToken, SyntaxKind.MinusMinusToken, SyntaxKind.Til… constant [all …]
|
D | smartIndenter.ts | 39 … if (enclosingCommentRange && enclosingCommentRange.kind === SyntaxKind.MultiLineCommentTrivia) { 79 …t isObjectLiteral = currentToken.kind === SyntaxKind.OpenBraceToken && currentToken.parent.kind ==… 84 …if (precedingToken.kind === SyntaxKind.CommaToken && precedingToken.parent.kind !== SyntaxKind.Bin… 95 …const useTheSameBaseIndentation = [SyntaxKind.FunctionExpression, SyntaxKind.ArrowFunction].indexO… constant 300 (parent.kind === SyntaxKind.SourceFile || !parentAndChildShareLine); 321 if (nextToken.kind === SyntaxKind.OpenBraceToken) { 325 else if (nextToken.kind === SyntaxKind.CloseBraceToken) { 357 … if (parent.kind === SyntaxKind.IfStatement && (parent as IfStatement).elseStatement === child) { 358 const elseKeyword = findChildOfKind(parent, SyntaxKind.ElseKeyword, sourceFile)!; 441 case SyntaxKind.TypeReference: [all …]
|
/third_party/typescript/src/linter/ArkTSLinter_1_0/ |
D | TypeScriptLinterConfig.ts | 138 static terminalTokens: Set<SyntaxKind> = new Set([ 139 SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken, SyntaxKind.OpenParenToken, 140 SyntaxKind.CloseParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken, 141 … SyntaxKind.DotToken, SyntaxKind.DotDotDotToken, SyntaxKind.SemicolonToken, SyntaxKind.CommaToken, 142 SyntaxKind.QuestionDotToken, SyntaxKind.LessThanToken, SyntaxKind.LessThanSlashToken, 143 SyntaxKind.GreaterThanToken, SyntaxKind.LessThanEqualsToken, SyntaxKind.GreaterThanEqualsToken, 144 …SyntaxKind.EqualsEqualsToken, SyntaxKind.ExclamationEqualsToken, SyntaxKind.EqualsEqualsEqualsToke… 145 … SyntaxKind.ExclamationEqualsEqualsToken, SyntaxKind.EqualsGreaterThanToken, SyntaxKind.PlusToken, 146 SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.AsteriskAsteriskToken, 147 …SyntaxKind.SlashToken, SyntaxKind.PercentToken, SyntaxKind.PlusPlusToken, SyntaxKind.MinusMinusTok… [all …]
|
/third_party/typescript/src/linter/ArkTSLinter_1_1/ |
D | TypeScriptLinterConfig.ts | 136 static terminalTokens: Set<SyntaxKind> = new Set([ 137 SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken, SyntaxKind.OpenParenToken, 138 SyntaxKind.CloseParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken, 139 … SyntaxKind.DotToken, SyntaxKind.DotDotDotToken, SyntaxKind.SemicolonToken, SyntaxKind.CommaToken, 140 SyntaxKind.QuestionDotToken, SyntaxKind.LessThanToken, SyntaxKind.LessThanSlashToken, 141 SyntaxKind.GreaterThanToken, SyntaxKind.LessThanEqualsToken, SyntaxKind.GreaterThanEqualsToken, 142 …SyntaxKind.EqualsEqualsToken, SyntaxKind.ExclamationEqualsToken, SyntaxKind.EqualsEqualsEqualsToke… 143 … SyntaxKind.ExclamationEqualsEqualsToken, SyntaxKind.EqualsGreaterThanToken, SyntaxKind.PlusToken, 144 SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.AsteriskAsteriskToken, 145 …SyntaxKind.SlashToken, SyntaxKind.PercentToken, SyntaxKind.PlusPlusToken, SyntaxKind.MinusMinusTok… [all …]
|
/third_party/typescript/src/compiler/factory/ |
D | nodeTests.ts | 5 return node.kind === SyntaxKind.NumericLiteral; 9 return node.kind === SyntaxKind.BigIntLiteral; 13 return node.kind === SyntaxKind.StringLiteral; 17 return node.kind === SyntaxKind.JsxText; 21 return node.kind === SyntaxKind.RegularExpressionLiteral; 25 return node.kind === SyntaxKind.NoSubstitutionTemplateLiteral; 31 return node.kind === SyntaxKind.TemplateHead; 35 return node.kind === SyntaxKind.TemplateMiddle; 39 return node.kind === SyntaxKind.TemplateTail; 45 return node.kind === SyntaxKind.DotDotDotToken; [all …]
|
D | utilitiesPublic.ts | 8 return kind === SyntaxKind.TypeParameter 9 || kind === SyntaxKind.Parameter 10 || kind === SyntaxKind.PropertySignature 11 || kind === SyntaxKind.PropertyDeclaration 12 || kind === SyntaxKind.MethodSignature 13 || kind === SyntaxKind.MethodDeclaration 14 || kind === SyntaxKind.Constructor 15 || kind === SyntaxKind.GetAccessor 16 || kind === SyntaxKind.SetAccessor 17 || kind === SyntaxKind.IndexSignature [all …]
|
D | parenthesizerRules.ts | 5 cachedLiteralKind: SyntaxKind; 72 …function binaryOperandNeedsParentheses(binaryOperator: SyntaxKind, operand: Expression, isLeftSide… 90 …const binaryOperatorPrecedence = getOperatorPrecedence(SyntaxKind.BinaryExpression, binaryOperator… 91 …const binaryOperatorAssociativity = getOperatorAssociativity(SyntaxKind.BinaryExpression, binaryOp… 93 …if (!isLeftSideOfBinary && operand.kind === SyntaxKind.ArrowFunction && binaryOperatorPrecedence >… 105 && operand.kind === SyntaxKind.YieldExpression) { 146 if (binaryOperator === SyntaxKind.PlusToken) { 147 …const leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : SyntaxKind.Unknown; 174 function operatorHasAssociativeProperty(binaryOperator: SyntaxKind) { 184 return binaryOperator === SyntaxKind.AsteriskToken [all …]
|
/third_party/typescript/src/compiler/ |
D | utilitiesPublic.ts | 251 if (d && d.kind === SyntaxKind.TypeParameter) { 253 …if (isFunctionLike(current) || isClassLike(current) || current.kind === SyntaxKind.InterfaceDeclar… 262 …cModifier(node, ModifierFlags.ParameterPropertyModifier) && parent.kind === SyntaxKind.Constructor; 292 if (node.kind === SyntaxKind.VariableDeclaration) { 295 if (node && node.kind === SyntaxKind.VariableDeclarationList) { 299 if (node && node.kind === SyntaxKind.VariableStatement) { 517 case SyntaxKind.VariableStatement: 522 case SyntaxKind.ExpressionStatement: 524 …if (expr.kind === SyntaxKind.BinaryExpression && (expr as BinaryExpression).operatorToken.kind ===… 528 case SyntaxKind.PropertyAccessExpression: [all …]
|
D | parser.ts | 17 let NodeConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 18 let TokenConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 19 let IdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 20 let PrivateIdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 21 let SourceFileConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node; 72 return canHaveModifiers(node) && hasModifierOfKind(node, SyntaxKind.ExportKeyword) 90 function hasModifierOfKind(node: HasModifiers, kind: SyntaxKind) { 95 …return isMetaProperty(node) && node.keywordToken === SyntaxKind.ImportKeyword && node.name.escaped… 101 …[SyntaxKind.QualifiedName]: function forEachChildInQualifiedName<T>(node: QualifiedName, cbNode: (… 105 …[SyntaxKind.TypeParameter]: function forEachChildInTypeParameter<T>(node: TypeParameterDeclaration… [all …]
|
D | scanner.ts | 5 export function tokenIsIdentifierOrKeyword(token: SyntaxKind): boolean { 6 return token >= SyntaxKind.Identifier; 10 export function tokenIsIdentifierOrKeywordOrGreaterThan(token: SyntaxKind): boolean { 11 return token === SyntaxKind.GreaterThanToken || tokenIsIdentifierOrKeyword(token); 16 getToken(): SyntaxKind; 35 reScanGreaterToken(): SyntaxKind; 36 reScanSlashToken(): SyntaxKind; 37 reScanAsteriskEqualsToken(): SyntaxKind; 38 reScanTemplateToken(isTaggedTemplate: boolean): SyntaxKind; 39 reScanTemplateHeadOrNoSubstitutionTemplate(): SyntaxKind; [all …]
|
D | utilities.ts | 268 while (node && node.kind !== SyntaxKind.SourceFile) { 284 case SyntaxKind.Block: 285 case SyntaxKind.CaseBlock: 286 case SyntaxKind.ForStatement: 287 case SyntaxKind.ForInStatement: 288 case SyntaxKind.ForOfStatement: 363 return node.pos === node.end && node.pos >= 0 && node.kind !== SyntaxKind.EndOfFileToken; 518 if (isJSDocNode(node) || node.kind === SyntaxKind.JsxText) { 531 if (node.kind === SyntaxKind.SyntaxList && (node as SyntaxList)._children.length > 0) { 705 case SyntaxKind.StringLiteral: { [all …]
|
D | binder.ts | 42 case SyntaxKind.InterfaceDeclaration: 43 case SyntaxKind.TypeAliasDeclaration: 46 case SyntaxKind.EnumDeclaration: 52 case SyntaxKind.ImportDeclaration: 53 case SyntaxKind.ImportEqualsDeclaration: 59 case SyntaxKind.ExportDeclaration: 61 …xportDeclaration.exportClause && exportDeclaration.exportClause.kind === SyntaxKind.NamedExports) { 76 case SyntaxKind.ModuleBlock: { 98 case SyntaxKind.ModuleDeclaration: 100 case SyntaxKind.Identifier: [all …]
|
/third_party/typescript/src/services/ |
D | preProcess.ts | 16 let lastToken: SyntaxKind; 17 let currentToken: SyntaxKind; 26 if (currentToken === SyntaxKind.OpenBraceToken) { 29 else if (currentToken === SyntaxKind.CloseBraceToken) { 65 if (token === SyntaxKind.DeclareKeyword) { 68 if (token === SyntaxKind.ModuleKeyword) { 70 if (token === SyntaxKind.StringLiteral) { 84 if (lastToken === SyntaxKind.DotToken) { 88 if (token === SyntaxKind.ImportKeyword) { 90 if (token === SyntaxKind.OpenParenToken) { [all …]
|
D | breakpoints.ts | 82 case SyntaxKind.VariableStatement: 86 case SyntaxKind.VariableDeclaration: 87 case SyntaxKind.PropertyDeclaration: 88 case SyntaxKind.PropertySignature: 91 case SyntaxKind.Parameter: 94 case SyntaxKind.FunctionDeclaration: 95 case SyntaxKind.MethodDeclaration: 96 case SyntaxKind.MethodSignature: 97 case SyntaxKind.GetAccessor: 98 case SyntaxKind.SetAccessor: [all …]
|
D | classifier.ts | 13 let token = SyntaxKind.Unknown; 14 let lastNonTriviaToken = SyntaxKind.Unknown; 36 const templateStack: SyntaxKind[] = []; 42 templateStack.push(SyntaxKind.TemplateHead); 85 } while (token !== SyntaxKind.EndOfFileToken); 89 case SyntaxKind.SlashToken: 90 case SyntaxKind.SlashEqualsToken: 91 …f (!noRegexTable[lastNonTriviaToken] && scanner.reScanSlashToken() === SyntaxKind.RegularExpressio… 92 token = SyntaxKind.RegularExpressionLiteral; 95 case SyntaxKind.LessThanToken: [all …]
|
D | documentHighlights.ts | 57 case SyntaxKind.IfKeyword: 58 case SyntaxKind.ElseKeyword: 60 case SyntaxKind.ReturnKeyword: 62 case SyntaxKind.ThrowKeyword: 64 case SyntaxKind.TryKeyword: 65 case SyntaxKind.CatchKeyword: 66 case SyntaxKind.FinallyKeyword: 67 … const tryStatement = node.kind === SyntaxKind.CatchKeyword ? node.parent.parent : node.parent; 69 case SyntaxKind.SwitchKeyword: 71 case SyntaxKind.CaseKeyword: [all …]
|
D | utilities.ts | 27 case SyntaxKind.VariableDeclaration: 30 case SyntaxKind.Parameter: 31 case SyntaxKind.BindingElement: 32 case SyntaxKind.PropertyDeclaration: 33 case SyntaxKind.PropertySignature: 34 case SyntaxKind.PropertyAssignment: 35 case SyntaxKind.ShorthandPropertyAssignment: 36 case SyntaxKind.MethodDeclaration: 37 case SyntaxKind.MethodSignature: 38 case SyntaxKind.Constructor: [all …]
|
D | outliningElementsCollector.ts | 29 …createOutliningSpanFromBounds(findChildOfKind(statements[firstImport], SyntaxKind.ImportKeyword, s… 37 …t(n) || isReturnStatement(n) || isCallOrNewExpression(n) || n.kind === SyntaxKind.EndOfFileToken) { 128 case SyntaxKind.SingleLineCommentTrivia: 145 case SyntaxKind.MultiLineCommentTrivia: 175 case SyntaxKind.Block: 183 case SyntaxKind.DoStatement: 184 case SyntaxKind.ForInStatement: 185 case SyntaxKind.ForOfStatement: 186 case SyntaxKind.ForStatement: 187 case SyntaxKind.IfStatement: [all …]
|
D | jsDoc.ts | 96 …Doc = isJSDoc(jsdoc) && jsdoc.tags && find(jsdoc.tags, t => t.kind === SyntaxKind.JSDocTag && (t.t… 103 …&& declaration.kind !== SyntaxKind.JSDocTypedefTag && declaration.kind !== SyntaxKind.JSDocCallbac… 105 …&& jsdoc.tags.some(t => t.kind === SyntaxKind.JSDocTypedefTag || t.kind === SyntaxKind.JSDocCallba… 106 …&& !jsdoc.tags.some(t => t.kind === SyntaxKind.JSDocParameterTag || t.kind === SyntaxKind.JSDocRet… 127 case SyntaxKind.JSDocParameterTag: 128 case SyntaxKind.JSDocPropertyTag: 130 case SyntaxKind.JSDocCallbackTag: 131 case SyntaxKind.JSDocTypedefTag: 146 …if (tags.some(t => t.kind === SyntaxKind.JSDocTypedefTag || t.kind === SyntaxKind.JSDocCallbackTag) 147 …&& !tags.some(t => t.kind === SyntaxKind.JSDocParameterTag || t.kind === SyntaxKind.JSDocReturnTag… [all …]
|
D | completions.ts | 295 …viousToken.kind === SyntaxKind.BreakKeyword || previousToken.kind === SyntaxKind.ContinueKeyword |… 458 case SyntaxKind.TypeKeyword: return KeywordCompletionFilters.TypeKeyword; 465 … return location?.kind === SyntaxKind.Identifier ? createTextSpanFromNode(location) : undefined; 597 case SyntaxKind.JsxClosingElement: 599 case SyntaxKind.SlashToken: 600 case SyntaxKind.GreaterThanToken: 601 case SyntaxKind.Identifier: 602 case SyntaxKind.PropertyAccessExpression: 622 …const hasClosingAngleBracket = !!findChildOfKind(jsxClosingElement, SyntaxKind.GreaterThanToken, s… 722 const dot = findChildOfKind(propertyAccessToConvert, SyntaxKind.DotToken, sourceFile) || [all …]
|
/third_party/typescript/src/compiler/transformers/ |
D | typeSerializer.ts | 106 case SyntaxKind.PropertyDeclaration: 107 case SyntaxKind.Parameter: 109 case SyntaxKind.SetAccessor: 110 case SyntaxKind.GetAccessor: 112 case SyntaxKind.ClassDeclaration: 113 case SyntaxKind.ClassExpression: 114 case SyntaxKind.MethodDeclaration: 155 if (container && node.kind === SyntaxKind.GetAccessor) { 205 case SyntaxKind.VoidKeyword: 206 case SyntaxKind.UndefinedKeyword: [all …]
|
D | utilities.ts | 32 … return node.kind === SyntaxKind.SourceFile ? transformSourceFile(node) : transformBundle(node); 82 case SyntaxKind.ImportDeclaration: 96 case SyntaxKind.ImportEqualsDeclaration: 97 …if ((node as ImportEqualsDeclaration).moduleReference.kind === SyntaxKind.ExternalModuleReference)… 104 case SyntaxKind.ExportDeclaration: 136 case SyntaxKind.ExportAssignment: 143 case SyntaxKind.VariableStatement: 151 case SyntaxKind.FunctionDeclaration: 172 case SyntaxKind.ClassDeclaration: 261 expression.kind === SyntaxKind.NumericLiteral || [all …]
|
/third_party/typescript/tests/baselines/reference/ |
D | enums.types | 2 enum SyntaxKind { 3 >SyntaxKind : SyntaxKind 6 >ImportClause : SyntaxKind.ImportClause 9 >ExportDeclaration : SyntaxKind.ExportDeclaration 24 export type { SyntaxKind }; 25 >SyntaxKind : SyntaxKind 31 import type { SyntaxKind, SymbolFlags } from './a'; 32 >SyntaxKind : SyntaxKind 35 SyntaxKind.ImportClause; 36 >SyntaxKind.ImportClause : SyntaxKind.ImportClause [all …]
|
D | APISample_linter.js | 27 case ts.SyntaxKind.ForStatement: 28 case ts.SyntaxKind.ForInStatement: 29 case ts.SyntaxKind.WhileStatement: 30 case ts.SyntaxKind.DoStatement: 31 if ((<ts.IterationStatement>node).statement.kind !== ts.SyntaxKind.Block) { 36 case ts.SyntaxKind.IfStatement: 38 if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { 42 ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && 43 ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { 48 case ts.SyntaxKind.BinaryExpression: [all …]
|
D | enums.js | 4 enum SyntaxKind { 14 export type { SyntaxKind }; 18 import type { SyntaxKind, SymbolFlags } from './a'; 20 SyntaxKind.ImportClause; 22 let kind: SyntaxKind.ImportClause; 37 var SyntaxKind; variable 38 (function (SyntaxKind) { argument 39 SyntaxKind[SyntaxKind["ImportClause"] = 0] = "ImportClause"; 40 SyntaxKind[SyntaxKind["ExportDeclaration"] = 1] = "ExportDeclaration"; 41 })(SyntaxKind || (SyntaxKind = {})); [all …]
|