diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ad72ffb239acf..ce9163c50cac1 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -364,6 +364,7 @@ import { tracing, TransformFlags, trimString, + trimStringEnd, TryStatement, TupleTypeNode, TypeAliasDeclaration, @@ -2165,6 +2166,10 @@ namespace Parser { return currentToken = scanner.scanJsDocToken(); } + function nextJSDocCommentTextToken(inBackticks: boolean): JSDocSyntaxKind | SyntaxKind.JSDocCommentTextToken { + return currentToken = scanner.scanJSDocCommentTextToken(inBackticks); + } + function reScanGreaterToken(): SyntaxKind { return currentToken = scanner.reScanGreaterToken(); } @@ -8602,19 +8607,14 @@ namespace Parser { loop: while (true) { switch (token()) { case SyntaxKind.AtToken: - if (state === JSDocState.BeginningOfLine || state === JSDocState.SawAsterisk) { - removeTrailingWhitespace(comments); - if (!commentsPos) commentsPos = getNodePos(); - addTag(parseTag(indent)); - // NOTE: According to usejsdoc.org, a tag goes to end of line, except the last tag. - // Real-world comments may break this rule, so "BeginningOfLine" will not be a real line beginning - // for malformed examples like `/** @param {string} x @returns {number} the length */` - state = JSDocState.BeginningOfLine; - margin = undefined; - } - else { - pushComment(scanner.getTokenText()); - } + removeTrailingWhitespace(comments); + if (!commentsPos) commentsPos = getNodePos(); + addTag(parseTag(indent)); + // NOTE: According to usejsdoc.org, a tag goes to end of line, except the last tag. + // Real-world comments may break this rule, so "BeginningOfLine" will not be a real line beginning + // for malformed examples like `/** @param {string} x @returns {number} the length */` + state = JSDocState.BeginningOfLine; + margin = undefined; break; case SyntaxKind.NewLineTrivia: comments.push(scanner.getTokenText()); @@ -8623,30 +8623,33 @@ namespace Parser { break; case SyntaxKind.AsteriskToken: const asterisk = scanner.getTokenText(); - if (state === JSDocState.SawAsterisk || state === JSDocState.SavingComments) { + if (state === JSDocState.SawAsterisk) { // If we've already seen an asterisk, then we can no longer parse a tag on this line state = JSDocState.SavingComments; pushComment(asterisk); } else { + Debug.assert(state === JSDocState.BeginningOfLine); // Ignore the first asterisk on a line state = JSDocState.SawAsterisk; indent += asterisk.length; } break; case SyntaxKind.WhitespaceTrivia: + Debug.assert(state !== JSDocState.SavingComments, "whitespace shouldn't come from the scanner while saving top-level comment text"); // only collect whitespace if we're already saving comments or have just crossed the comment indent margin const whitespace = scanner.getTokenText(); - if (state === JSDocState.SavingComments) { - comments.push(whitespace); - } - else if (margin !== undefined && indent + whitespace.length > margin) { + if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent)); } indent += whitespace.length; break; case SyntaxKind.EndOfFileToken: break loop; + case SyntaxKind.JSDocCommentTextToken: + state = JSDocState.SavingComments; + pushComment(scanner.getTokenValue()); + break; case SyntaxKind.OpenBraceToken: state = JSDocState.SavingComments; const commentEnd = scanner.getTokenFullStart(); @@ -8671,15 +8674,20 @@ namespace Parser { pushComment(scanner.getTokenText()); break; } - nextTokenJSDoc(); + if (state === JSDocState.SavingComments) { + nextJSDocCommentTextToken(/*inBackticks*/ false); + } + else { + nextTokenJSDoc(); + } } - removeTrailingWhitespace(comments); - if (parts.length && comments.length) { - parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd ?? start, commentsPos)); + const trimmedComments = trimStringEnd(comments.join("")); + if (parts.length && trimmedComments.length) { + parts.push(finishNode(factory.createJSDocText(trimmedComments), linkEnd ?? start, commentsPos)); } if (parts.length && tags) Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd); - return finishNode(factory.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : comments.length ? comments.join("") : undefined, tagsArray), start, end); + return finishNode(factory.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : trimmedComments.length ? trimmedComments : undefined, tagsArray), start, end); }); function removeLeadingNewlines(comments: string[]) { @@ -8689,8 +8697,18 @@ namespace Parser { } function removeTrailingWhitespace(comments: string[]) { - while (comments.length && comments[comments.length - 1].trim() === "") { - comments.pop(); + while (comments.length) { + const trimmed = trimStringEnd(comments[comments.length - 1]); + if (trimmed === "") { + comments.pop(); + } + else if (trimmed.length < comments[comments.length - 1].length) { + comments[comments.length - 1] = trimmed; + break; + } + else { + break; + } } } @@ -8846,7 +8864,6 @@ namespace Parser { const parts: JSDocComment[] = []; let linkEnd; let state = JSDocState.BeginningOfLine; - let previousWhitespace = true; let margin: number | undefined; function pushComment(text: string) { if (!margin) { @@ -8862,7 +8879,7 @@ namespace Parser { } state = JSDocState.SawAsterisk; } - let tok = token() as JSDocSyntaxKind; + let tok = token() as JSDocSyntaxKind | SyntaxKind.JSDocCommentTextToken; loop: while (true) { switch (tok) { case SyntaxKind.NewLineTrivia: @@ -8872,29 +8889,20 @@ namespace Parser { indent = 0; break; case SyntaxKind.AtToken: - if (state === JSDocState.SavingBackticks - || state === JSDocState.SavingComments && (!previousWhitespace || lookAhead(isNextJSDocTokenWhitespace))) { - // @ doesn't start a new tag inside ``, and inside a comment, only after whitespace or not before whitespace - comments.push(scanner.getTokenText()); - break; - } scanner.resetTokenState(scanner.getTokenEnd() - 1); - // falls through + break loop; case SyntaxKind.EndOfFileToken: // Done break loop; case SyntaxKind.WhitespaceTrivia: - if (state === JSDocState.SavingComments || state === JSDocState.SavingBackticks) { - pushComment(scanner.getTokenText()); - } - else { - const whitespace = scanner.getTokenText(); - // if the whitespace crosses the margin, take only the whitespace that passes the margin - if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent)); - } - indent += whitespace.length; + Debug.assert(state !== JSDocState.SavingComments && state !== JSDocState.SavingBackticks, "whitespace shouldn't come from the scanner while saving comment text"); + const whitespace = scanner.getTokenText(); + // if the whitespace crosses the margin, take only the whitespace that passes the margin + if (margin !== undefined && indent + whitespace.length > margin) { + comments.push(whitespace.slice(margin - indent)); + state = JSDocState.SavingComments; } + indent += whitespace.length; break; case SyntaxKind.OpenBraceToken: state = JSDocState.SavingComments; @@ -8920,6 +8928,12 @@ namespace Parser { } pushComment(scanner.getTokenText()); break; + case SyntaxKind.JSDocCommentTextToken: + if (state !== JSDocState.SavingBackticks) { + state = JSDocState.SavingComments; // leading identifiers start recording as well + } + pushComment(scanner.getTokenValue()); + break; case SyntaxKind.AsteriskToken: if (state === JSDocState.BeginningOfLine) { // leading asterisks start recording on the *next* (non-whitespace) token @@ -8936,28 +8950,27 @@ namespace Parser { pushComment(scanner.getTokenText()); break; } - previousWhitespace = token() === SyntaxKind.WhitespaceTrivia; - tok = nextTokenJSDoc(); + if (state === JSDocState.SavingComments || state === JSDocState.SavingBackticks) { + tok = nextJSDocCommentTextToken(state === JSDocState.SavingBackticks); + } + else { + tok = nextTokenJSDoc(); + } } removeLeadingNewlines(comments); - removeTrailingWhitespace(comments); + const trimmedComments = trimStringEnd(comments.join("")); if (parts.length) { - if (comments.length) { - parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd ?? commentsPos)); + if (trimmedComments.length) { + parts.push(finishNode(factory.createJSDocText(trimmedComments), linkEnd ?? commentsPos)); } return createNodeArray(parts, commentsPos, scanner.getTokenEnd()); } - else if (comments.length) { - return comments.join(""); + else if (trimmedComments.length) { + return trimmedComments; } } - function isNextJSDocTokenWhitespace() { - const next = nextTokenJSDoc(); - return next === SyntaxKind.WhitespaceTrivia || next === SyntaxKind.NewLineTrivia; - } - function parseJSDocLink(start: number) { const linkType = tryParse(parseJSDocLinkPrefix); if (!linkType) { diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index d2ec70a6c1d75..5045b0d5ce665 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -81,6 +81,8 @@ export interface Scanner { reScanInvalidIdentifier(): SyntaxKind; scanJsxToken(): JsxTokenSyntaxKind; scanJsDocToken(): JSDocSyntaxKind; + /** @internal */ + scanJSDocCommentTextToken(inBackticks: boolean): JSDocSyntaxKind | SyntaxKind.JSDocCommentTextToken; scan(): SyntaxKind; getText(): string; @@ -1031,6 +1033,7 @@ export function createScanner(languageVersion: ScriptTarget, reScanInvalidIdentifier, scanJsxToken, scanJsDocToken, + scanJSDocCommentTextToken, scan, getText, clearCommentDirectives, @@ -2467,6 +2470,34 @@ export function createScanner(languageVersion: ScriptTarget, return scanJsxAttributeValue(); } + function scanJSDocCommentTextToken(inBackticks: boolean): JSDocSyntaxKind | SyntaxKind.JSDocCommentTextToken { + fullStartPos = tokenStart = pos; + tokenFlags = TokenFlags.None; + if (pos >= end) { + return token = SyntaxKind.EndOfFileToken; + } + for (let ch = text.charCodeAt(pos); + pos < end && (!isLineBreak(ch) && ch !== CharacterCodes.backtick); + ch = codePointAt(text, ++pos)) { + if (!inBackticks) { + if (ch === CharacterCodes.openBrace) { + break; + } + else if (ch === CharacterCodes.at + && pos - 1 >= 0 && isWhiteSpaceSingleLine(text.charCodeAt(pos - 1)) + && !(pos + 1 < end && isWhiteSpaceLike(text.charCodeAt(pos + 1)))) { + // @ doesn't start a new tag inside ``, and elsewhere, only after whitespace and before non-whitespace + break; + } + } + } + if (pos === tokenStart) { + return scanJsDocToken(); + } + tokenValue = text.substring(tokenStart, pos); + return token = SyntaxKind.JSDocCommentTextToken; + } + function scanJsDocToken(): JSDocSyntaxKind { fullStartPos = tokenStart = pos; tokenFlags = TokenFlags.None; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 15558c4f363d8..edd3e981083f1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -129,6 +129,11 @@ export const enum SyntaxKind { // Identifiers and PrivateIdentifiers Identifier, PrivateIdentifier, + /** + * Only the special JSDoc comment text scanner produces JSDocCommentTextTokes. One of these tokens spans all text after a tag comment's start and before the next @ + * @internal + */ + JSDocCommentTextToken, // Reserved words BreakKeyword, CaseKeyword, diff --git a/src/testRunner/unittests/jsDocParsing.ts b/src/testRunner/unittests/jsDocParsing.ts index 3691b2c12a31a..63ccb532738ab 100644 --- a/src/testRunner/unittests/jsDocParsing.ts +++ b/src/testRunner/unittests/jsDocParsing.ts @@ -393,6 +393,7 @@ oh.no * Some\n\n * text\r\n * with newlines. */`); parsesCorrectly("Chained tags, no leading whitespace", `/**@a @b @c@d*/`); + parsesCorrectly("Single trailing whitespace", `/** trailing whitespace */`); parsesCorrectly("Initial star is not a tag", `/***@a*/`); parsesCorrectly("Initial star space is not a tag", `/*** @a*/`); parsesCorrectly("Initial email address is not a tag", `/**bill@example.com*/`); diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.Initial star space is not a tag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.Initial star space is not a tag.json index ddd1e157e1c56..7a4ab61cf2340 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.Initial star space is not a tag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.Initial star space is not a tag.json @@ -5,5 +5,27 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "comment": "* @a" + "comment": "*", + "tags": { + "0": { + "kind": "JSDocTag", + "pos": 5, + "end": 7, + "modifierFlagsCache": 0, + "transformFlags": 0, + "tagName": { + "kind": "Identifier", + "pos": 6, + "end": 7, + "modifierFlagsCache": 0, + "transformFlags": 0, + "escapedText": "a" + } + }, + "length": 1, + "pos": 5, + "end": 7, + "hasTrailingComma": false, + "transformFlags": 0 + } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.Single trailing whitespace.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.Single trailing whitespace.json new file mode 100644 index 0000000000000..2f8223590c0e1 --- /dev/null +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.Single trailing whitespace.json @@ -0,0 +1,9 @@ +{ + "kind": "JSDoc", + "pos": 0, + "end": 26, + "flags": "JSDoc", + "modifierFlagsCache": 0, + "transformFlags": 0, + "comment": "trailing whitespace" +} \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json index b6b539fc47c36..145dd77f06513 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json @@ -5,5 +5,41 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "comment": "* @type {number}" + "comment": "*", + "tags": { + "0": { + "kind": "JSDocTypeTag", + "pos": 6, + "end": 21, + "modifierFlagsCache": 0, + "transformFlags": 0, + "tagName": { + "kind": "Identifier", + "pos": 7, + "end": 11, + "modifierFlagsCache": 0, + "transformFlags": 0, + "escapedText": "type" + }, + "typeExpression": { + "kind": "JSDocTypeExpression", + "pos": 12, + "end": 20, + "modifierFlagsCache": 0, + "transformFlags": 0, + "type": { + "kind": "NumberKeyword", + "pos": 13, + "end": 19, + "modifierFlagsCache": 0, + "transformFlags": 1 + } + } + }, + "length": 1, + "pos": 6, + "end": 21, + "hasTrailingComma": false, + "transformFlags": 0 + } } \ No newline at end of file diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index bcd430d2c1c5b..b8a37c275ff07 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4069,305 +4069,305 @@ declare namespace ts { CaretEqualsToken = 78, Identifier = 79, PrivateIdentifier = 80, - BreakKeyword = 81, - CaseKeyword = 82, - CatchKeyword = 83, - ClassKeyword = 84, - ConstKeyword = 85, - ContinueKeyword = 86, - DebuggerKeyword = 87, - DefaultKeyword = 88, - DeleteKeyword = 89, - DoKeyword = 90, - ElseKeyword = 91, - EnumKeyword = 92, - ExportKeyword = 93, - ExtendsKeyword = 94, - FalseKeyword = 95, - FinallyKeyword = 96, - ForKeyword = 97, - FunctionKeyword = 98, - IfKeyword = 99, - ImportKeyword = 100, - InKeyword = 101, - InstanceOfKeyword = 102, - NewKeyword = 103, - NullKeyword = 104, - ReturnKeyword = 105, - SuperKeyword = 106, - SwitchKeyword = 107, - ThisKeyword = 108, - ThrowKeyword = 109, - TrueKeyword = 110, - TryKeyword = 111, - TypeOfKeyword = 112, - VarKeyword = 113, - VoidKeyword = 114, - WhileKeyword = 115, - WithKeyword = 116, - ImplementsKeyword = 117, - InterfaceKeyword = 118, - LetKeyword = 119, - PackageKeyword = 120, - PrivateKeyword = 121, - ProtectedKeyword = 122, - PublicKeyword = 123, - StaticKeyword = 124, - YieldKeyword = 125, - AbstractKeyword = 126, - AccessorKeyword = 127, - AsKeyword = 128, - AssertsKeyword = 129, - AssertKeyword = 130, - AnyKeyword = 131, - AsyncKeyword = 132, - AwaitKeyword = 133, - BooleanKeyword = 134, - ConstructorKeyword = 135, - DeclareKeyword = 136, - GetKeyword = 137, - InferKeyword = 138, - IntrinsicKeyword = 139, - IsKeyword = 140, - KeyOfKeyword = 141, - ModuleKeyword = 142, - NamespaceKeyword = 143, - NeverKeyword = 144, - OutKeyword = 145, - ReadonlyKeyword = 146, - RequireKeyword = 147, - NumberKeyword = 148, - ObjectKeyword = 149, - SatisfiesKeyword = 150, - SetKeyword = 151, - StringKeyword = 152, - SymbolKeyword = 153, - TypeKeyword = 154, - UndefinedKeyword = 155, - UniqueKeyword = 156, - UnknownKeyword = 157, - FromKeyword = 158, - GlobalKeyword = 159, - BigIntKeyword = 160, - OverrideKeyword = 161, - OfKeyword = 162, - QualifiedName = 163, - ComputedPropertyName = 164, - TypeParameter = 165, - Parameter = 166, - Decorator = 167, - PropertySignature = 168, - PropertyDeclaration = 169, - MethodSignature = 170, - MethodDeclaration = 171, - ClassStaticBlockDeclaration = 172, - Constructor = 173, - GetAccessor = 174, - SetAccessor = 175, - CallSignature = 176, - ConstructSignature = 177, - IndexSignature = 178, - TypePredicate = 179, - TypeReference = 180, - FunctionType = 181, - ConstructorType = 182, - TypeQuery = 183, - TypeLiteral = 184, - ArrayType = 185, - TupleType = 186, - OptionalType = 187, - RestType = 188, - UnionType = 189, - IntersectionType = 190, - ConditionalType = 191, - InferType = 192, - ParenthesizedType = 193, - ThisType = 194, - TypeOperator = 195, - IndexedAccessType = 196, - MappedType = 197, - LiteralType = 198, - NamedTupleMember = 199, - TemplateLiteralType = 200, - TemplateLiteralTypeSpan = 201, - ImportType = 202, - ObjectBindingPattern = 203, - ArrayBindingPattern = 204, - BindingElement = 205, - ArrayLiteralExpression = 206, - ObjectLiteralExpression = 207, - PropertyAccessExpression = 208, - ElementAccessExpression = 209, - CallExpression = 210, - NewExpression = 211, - TaggedTemplateExpression = 212, - TypeAssertionExpression = 213, - ParenthesizedExpression = 214, - FunctionExpression = 215, - ArrowFunction = 216, - DeleteExpression = 217, - TypeOfExpression = 218, - VoidExpression = 219, - AwaitExpression = 220, - PrefixUnaryExpression = 221, - PostfixUnaryExpression = 222, - BinaryExpression = 223, - ConditionalExpression = 224, - TemplateExpression = 225, - YieldExpression = 226, - SpreadElement = 227, - ClassExpression = 228, - OmittedExpression = 229, - ExpressionWithTypeArguments = 230, - AsExpression = 231, - NonNullExpression = 232, - MetaProperty = 233, - SyntheticExpression = 234, - SatisfiesExpression = 235, - TemplateSpan = 236, - SemicolonClassElement = 237, - Block = 238, - EmptyStatement = 239, - VariableStatement = 240, - ExpressionStatement = 241, - IfStatement = 242, - DoStatement = 243, - WhileStatement = 244, - ForStatement = 245, - ForInStatement = 246, - ForOfStatement = 247, - ContinueStatement = 248, - BreakStatement = 249, - ReturnStatement = 250, - WithStatement = 251, - SwitchStatement = 252, - LabeledStatement = 253, - ThrowStatement = 254, - TryStatement = 255, - DebuggerStatement = 256, - VariableDeclaration = 257, - VariableDeclarationList = 258, - FunctionDeclaration = 259, - ClassDeclaration = 260, - InterfaceDeclaration = 261, - TypeAliasDeclaration = 262, - EnumDeclaration = 263, - ModuleDeclaration = 264, - ModuleBlock = 265, - CaseBlock = 266, - NamespaceExportDeclaration = 267, - ImportEqualsDeclaration = 268, - ImportDeclaration = 269, - ImportClause = 270, - NamespaceImport = 271, - NamedImports = 272, - ImportSpecifier = 273, - ExportAssignment = 274, - ExportDeclaration = 275, - NamedExports = 276, - NamespaceExport = 277, - ExportSpecifier = 278, - MissingDeclaration = 279, - ExternalModuleReference = 280, - JsxElement = 281, - JsxSelfClosingElement = 282, - JsxOpeningElement = 283, - JsxClosingElement = 284, - JsxFragment = 285, - JsxOpeningFragment = 286, - JsxClosingFragment = 287, - JsxAttribute = 288, - JsxAttributes = 289, - JsxSpreadAttribute = 290, - JsxExpression = 291, - CaseClause = 292, - DefaultClause = 293, - HeritageClause = 294, - CatchClause = 295, - AssertClause = 296, - AssertEntry = 297, - ImportTypeAssertionContainer = 298, - PropertyAssignment = 299, - ShorthandPropertyAssignment = 300, - SpreadAssignment = 301, - EnumMember = 302, - /** @deprecated */ UnparsedPrologue = 303, - /** @deprecated */ UnparsedPrepend = 304, - /** @deprecated */ UnparsedText = 305, - /** @deprecated */ UnparsedInternalText = 306, - /** @deprecated */ UnparsedSyntheticReference = 307, - SourceFile = 308, - Bundle = 309, - /** @deprecated */ UnparsedSource = 310, - /** @deprecated */ InputFiles = 311, - JSDocTypeExpression = 312, - JSDocNameReference = 313, - JSDocMemberName = 314, - JSDocAllType = 315, - JSDocUnknownType = 316, - JSDocNullableType = 317, - JSDocNonNullableType = 318, - JSDocOptionalType = 319, - JSDocFunctionType = 320, - JSDocVariadicType = 321, - JSDocNamepathType = 322, - JSDoc = 323, + BreakKeyword = 82, + CaseKeyword = 83, + CatchKeyword = 84, + ClassKeyword = 85, + ConstKeyword = 86, + ContinueKeyword = 87, + DebuggerKeyword = 88, + DefaultKeyword = 89, + DeleteKeyword = 90, + DoKeyword = 91, + ElseKeyword = 92, + EnumKeyword = 93, + ExportKeyword = 94, + ExtendsKeyword = 95, + FalseKeyword = 96, + FinallyKeyword = 97, + ForKeyword = 98, + FunctionKeyword = 99, + IfKeyword = 100, + ImportKeyword = 101, + InKeyword = 102, + InstanceOfKeyword = 103, + NewKeyword = 104, + NullKeyword = 105, + ReturnKeyword = 106, + SuperKeyword = 107, + SwitchKeyword = 108, + ThisKeyword = 109, + ThrowKeyword = 110, + TrueKeyword = 111, + TryKeyword = 112, + TypeOfKeyword = 113, + VarKeyword = 114, + VoidKeyword = 115, + WhileKeyword = 116, + WithKeyword = 117, + ImplementsKeyword = 118, + InterfaceKeyword = 119, + LetKeyword = 120, + PackageKeyword = 121, + PrivateKeyword = 122, + ProtectedKeyword = 123, + PublicKeyword = 124, + StaticKeyword = 125, + YieldKeyword = 126, + AbstractKeyword = 127, + AccessorKeyword = 128, + AsKeyword = 129, + AssertsKeyword = 130, + AssertKeyword = 131, + AnyKeyword = 132, + AsyncKeyword = 133, + AwaitKeyword = 134, + BooleanKeyword = 135, + ConstructorKeyword = 136, + DeclareKeyword = 137, + GetKeyword = 138, + InferKeyword = 139, + IntrinsicKeyword = 140, + IsKeyword = 141, + KeyOfKeyword = 142, + ModuleKeyword = 143, + NamespaceKeyword = 144, + NeverKeyword = 145, + OutKeyword = 146, + ReadonlyKeyword = 147, + RequireKeyword = 148, + NumberKeyword = 149, + ObjectKeyword = 150, + SatisfiesKeyword = 151, + SetKeyword = 152, + StringKeyword = 153, + SymbolKeyword = 154, + TypeKeyword = 155, + UndefinedKeyword = 156, + UniqueKeyword = 157, + UnknownKeyword = 158, + FromKeyword = 159, + GlobalKeyword = 160, + BigIntKeyword = 161, + OverrideKeyword = 162, + OfKeyword = 163, + QualifiedName = 164, + ComputedPropertyName = 165, + TypeParameter = 166, + Parameter = 167, + Decorator = 168, + PropertySignature = 169, + PropertyDeclaration = 170, + MethodSignature = 171, + MethodDeclaration = 172, + ClassStaticBlockDeclaration = 173, + Constructor = 174, + GetAccessor = 175, + SetAccessor = 176, + CallSignature = 177, + ConstructSignature = 178, + IndexSignature = 179, + TypePredicate = 180, + TypeReference = 181, + FunctionType = 182, + ConstructorType = 183, + TypeQuery = 184, + TypeLiteral = 185, + ArrayType = 186, + TupleType = 187, + OptionalType = 188, + RestType = 189, + UnionType = 190, + IntersectionType = 191, + ConditionalType = 192, + InferType = 193, + ParenthesizedType = 194, + ThisType = 195, + TypeOperator = 196, + IndexedAccessType = 197, + MappedType = 198, + LiteralType = 199, + NamedTupleMember = 200, + TemplateLiteralType = 201, + TemplateLiteralTypeSpan = 202, + ImportType = 203, + ObjectBindingPattern = 204, + ArrayBindingPattern = 205, + BindingElement = 206, + ArrayLiteralExpression = 207, + ObjectLiteralExpression = 208, + PropertyAccessExpression = 209, + ElementAccessExpression = 210, + CallExpression = 211, + NewExpression = 212, + TaggedTemplateExpression = 213, + TypeAssertionExpression = 214, + ParenthesizedExpression = 215, + FunctionExpression = 216, + ArrowFunction = 217, + DeleteExpression = 218, + TypeOfExpression = 219, + VoidExpression = 220, + AwaitExpression = 221, + PrefixUnaryExpression = 222, + PostfixUnaryExpression = 223, + BinaryExpression = 224, + ConditionalExpression = 225, + TemplateExpression = 226, + YieldExpression = 227, + SpreadElement = 228, + ClassExpression = 229, + OmittedExpression = 230, + ExpressionWithTypeArguments = 231, + AsExpression = 232, + NonNullExpression = 233, + MetaProperty = 234, + SyntheticExpression = 235, + SatisfiesExpression = 236, + TemplateSpan = 237, + SemicolonClassElement = 238, + Block = 239, + EmptyStatement = 240, + VariableStatement = 241, + ExpressionStatement = 242, + IfStatement = 243, + DoStatement = 244, + WhileStatement = 245, + ForStatement = 246, + ForInStatement = 247, + ForOfStatement = 248, + ContinueStatement = 249, + BreakStatement = 250, + ReturnStatement = 251, + WithStatement = 252, + SwitchStatement = 253, + LabeledStatement = 254, + ThrowStatement = 255, + TryStatement = 256, + DebuggerStatement = 257, + VariableDeclaration = 258, + VariableDeclarationList = 259, + FunctionDeclaration = 260, + ClassDeclaration = 261, + InterfaceDeclaration = 262, + TypeAliasDeclaration = 263, + EnumDeclaration = 264, + ModuleDeclaration = 265, + ModuleBlock = 266, + CaseBlock = 267, + NamespaceExportDeclaration = 268, + ImportEqualsDeclaration = 269, + ImportDeclaration = 270, + ImportClause = 271, + NamespaceImport = 272, + NamedImports = 273, + ImportSpecifier = 274, + ExportAssignment = 275, + ExportDeclaration = 276, + NamedExports = 277, + NamespaceExport = 278, + ExportSpecifier = 279, + MissingDeclaration = 280, + ExternalModuleReference = 281, + JsxElement = 282, + JsxSelfClosingElement = 283, + JsxOpeningElement = 284, + JsxClosingElement = 285, + JsxFragment = 286, + JsxOpeningFragment = 287, + JsxClosingFragment = 288, + JsxAttribute = 289, + JsxAttributes = 290, + JsxSpreadAttribute = 291, + JsxExpression = 292, + CaseClause = 293, + DefaultClause = 294, + HeritageClause = 295, + CatchClause = 296, + AssertClause = 297, + AssertEntry = 298, + ImportTypeAssertionContainer = 299, + PropertyAssignment = 300, + ShorthandPropertyAssignment = 301, + SpreadAssignment = 302, + EnumMember = 303, + /** @deprecated */ UnparsedPrologue = 304, + /** @deprecated */ UnparsedPrepend = 305, + /** @deprecated */ UnparsedText = 306, + /** @deprecated */ UnparsedInternalText = 307, + /** @deprecated */ UnparsedSyntheticReference = 308, + SourceFile = 309, + Bundle = 310, + /** @deprecated */ UnparsedSource = 311, + /** @deprecated */ InputFiles = 312, + JSDocTypeExpression = 313, + JSDocNameReference = 314, + JSDocMemberName = 315, + JSDocAllType = 316, + JSDocUnknownType = 317, + JSDocNullableType = 318, + JSDocNonNullableType = 319, + JSDocOptionalType = 320, + JSDocFunctionType = 321, + JSDocVariadicType = 322, + JSDocNamepathType = 323, + JSDoc = 324, /** @deprecated Use SyntaxKind.JSDoc */ - JSDocComment = 323, - JSDocText = 324, - JSDocTypeLiteral = 325, - JSDocSignature = 326, - JSDocLink = 327, - JSDocLinkCode = 328, - JSDocLinkPlain = 329, - JSDocTag = 330, - JSDocAugmentsTag = 331, - JSDocImplementsTag = 332, - JSDocAuthorTag = 333, - JSDocDeprecatedTag = 334, - JSDocClassTag = 335, - JSDocPublicTag = 336, - JSDocPrivateTag = 337, - JSDocProtectedTag = 338, - JSDocReadonlyTag = 339, - JSDocOverrideTag = 340, - JSDocCallbackTag = 341, - JSDocOverloadTag = 342, - JSDocEnumTag = 343, - JSDocParameterTag = 344, - JSDocReturnTag = 345, - JSDocThisTag = 346, - JSDocTypeTag = 347, - JSDocTemplateTag = 348, - JSDocTypedefTag = 349, - JSDocSeeTag = 350, - JSDocPropertyTag = 351, - JSDocThrowsTag = 352, - JSDocSatisfiesTag = 353, - SyntaxList = 354, - NotEmittedStatement = 355, - PartiallyEmittedExpression = 356, - CommaListExpression = 357, - MergeDeclarationMarker = 358, - EndOfDeclarationMarker = 359, - SyntheticReferenceExpression = 360, - Count = 361, + JSDocComment = 324, + JSDocText = 325, + JSDocTypeLiteral = 326, + JSDocSignature = 327, + JSDocLink = 328, + JSDocLinkCode = 329, + JSDocLinkPlain = 330, + JSDocTag = 331, + JSDocAugmentsTag = 332, + JSDocImplementsTag = 333, + JSDocAuthorTag = 334, + JSDocDeprecatedTag = 335, + JSDocClassTag = 336, + JSDocPublicTag = 337, + JSDocPrivateTag = 338, + JSDocProtectedTag = 339, + JSDocReadonlyTag = 340, + JSDocOverrideTag = 341, + JSDocCallbackTag = 342, + JSDocOverloadTag = 343, + JSDocEnumTag = 344, + JSDocParameterTag = 345, + JSDocReturnTag = 346, + JSDocThisTag = 347, + JSDocTypeTag = 348, + JSDocTemplateTag = 349, + JSDocTypedefTag = 350, + JSDocSeeTag = 351, + JSDocPropertyTag = 352, + JSDocThrowsTag = 353, + JSDocSatisfiesTag = 354, + SyntaxList = 355, + NotEmittedStatement = 356, + PartiallyEmittedExpression = 357, + CommaListExpression = 358, + MergeDeclarationMarker = 359, + EndOfDeclarationMarker = 360, + SyntheticReferenceExpression = 361, + Count = 362, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, LastCompoundAssignment = 78, - FirstReservedWord = 81, - LastReservedWord = 116, - FirstKeyword = 81, - LastKeyword = 162, - FirstFutureReservedWord = 117, - LastFutureReservedWord = 125, - FirstTypeNode = 179, - LastTypeNode = 202, + FirstReservedWord = 82, + LastReservedWord = 117, + FirstKeyword = 82, + LastKeyword = 163, + FirstFutureReservedWord = 118, + LastFutureReservedWord = 126, + FirstTypeNode = 180, + LastTypeNode = 203, FirstPunctuation = 18, LastPunctuation = 78, FirstToken = 0, - LastToken = 162, + LastToken = 163, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -4376,13 +4376,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 78, - FirstStatement = 240, - LastStatement = 256, - FirstNode = 163, - FirstJSDocNode = 312, - LastJSDocNode = 353, - FirstJSDocTagNode = 330, - LastJSDocTagNode = 353 + FirstStatement = 241, + LastStatement = 257, + FirstNode = 164, + FirstJSDocNode = 313, + LastJSDocNode = 354, + FirstJSDocTagNode = 331, + LastJSDocTagNode = 354 } type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 74ab386d0ebe2..c6481e4bf67b9 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -126,305 +126,305 @@ declare namespace ts { CaretEqualsToken = 78, Identifier = 79, PrivateIdentifier = 80, - BreakKeyword = 81, - CaseKeyword = 82, - CatchKeyword = 83, - ClassKeyword = 84, - ConstKeyword = 85, - ContinueKeyword = 86, - DebuggerKeyword = 87, - DefaultKeyword = 88, - DeleteKeyword = 89, - DoKeyword = 90, - ElseKeyword = 91, - EnumKeyword = 92, - ExportKeyword = 93, - ExtendsKeyword = 94, - FalseKeyword = 95, - FinallyKeyword = 96, - ForKeyword = 97, - FunctionKeyword = 98, - IfKeyword = 99, - ImportKeyword = 100, - InKeyword = 101, - InstanceOfKeyword = 102, - NewKeyword = 103, - NullKeyword = 104, - ReturnKeyword = 105, - SuperKeyword = 106, - SwitchKeyword = 107, - ThisKeyword = 108, - ThrowKeyword = 109, - TrueKeyword = 110, - TryKeyword = 111, - TypeOfKeyword = 112, - VarKeyword = 113, - VoidKeyword = 114, - WhileKeyword = 115, - WithKeyword = 116, - ImplementsKeyword = 117, - InterfaceKeyword = 118, - LetKeyword = 119, - PackageKeyword = 120, - PrivateKeyword = 121, - ProtectedKeyword = 122, - PublicKeyword = 123, - StaticKeyword = 124, - YieldKeyword = 125, - AbstractKeyword = 126, - AccessorKeyword = 127, - AsKeyword = 128, - AssertsKeyword = 129, - AssertKeyword = 130, - AnyKeyword = 131, - AsyncKeyword = 132, - AwaitKeyword = 133, - BooleanKeyword = 134, - ConstructorKeyword = 135, - DeclareKeyword = 136, - GetKeyword = 137, - InferKeyword = 138, - IntrinsicKeyword = 139, - IsKeyword = 140, - KeyOfKeyword = 141, - ModuleKeyword = 142, - NamespaceKeyword = 143, - NeverKeyword = 144, - OutKeyword = 145, - ReadonlyKeyword = 146, - RequireKeyword = 147, - NumberKeyword = 148, - ObjectKeyword = 149, - SatisfiesKeyword = 150, - SetKeyword = 151, - StringKeyword = 152, - SymbolKeyword = 153, - TypeKeyword = 154, - UndefinedKeyword = 155, - UniqueKeyword = 156, - UnknownKeyword = 157, - FromKeyword = 158, - GlobalKeyword = 159, - BigIntKeyword = 160, - OverrideKeyword = 161, - OfKeyword = 162, - QualifiedName = 163, - ComputedPropertyName = 164, - TypeParameter = 165, - Parameter = 166, - Decorator = 167, - PropertySignature = 168, - PropertyDeclaration = 169, - MethodSignature = 170, - MethodDeclaration = 171, - ClassStaticBlockDeclaration = 172, - Constructor = 173, - GetAccessor = 174, - SetAccessor = 175, - CallSignature = 176, - ConstructSignature = 177, - IndexSignature = 178, - TypePredicate = 179, - TypeReference = 180, - FunctionType = 181, - ConstructorType = 182, - TypeQuery = 183, - TypeLiteral = 184, - ArrayType = 185, - TupleType = 186, - OptionalType = 187, - RestType = 188, - UnionType = 189, - IntersectionType = 190, - ConditionalType = 191, - InferType = 192, - ParenthesizedType = 193, - ThisType = 194, - TypeOperator = 195, - IndexedAccessType = 196, - MappedType = 197, - LiteralType = 198, - NamedTupleMember = 199, - TemplateLiteralType = 200, - TemplateLiteralTypeSpan = 201, - ImportType = 202, - ObjectBindingPattern = 203, - ArrayBindingPattern = 204, - BindingElement = 205, - ArrayLiteralExpression = 206, - ObjectLiteralExpression = 207, - PropertyAccessExpression = 208, - ElementAccessExpression = 209, - CallExpression = 210, - NewExpression = 211, - TaggedTemplateExpression = 212, - TypeAssertionExpression = 213, - ParenthesizedExpression = 214, - FunctionExpression = 215, - ArrowFunction = 216, - DeleteExpression = 217, - TypeOfExpression = 218, - VoidExpression = 219, - AwaitExpression = 220, - PrefixUnaryExpression = 221, - PostfixUnaryExpression = 222, - BinaryExpression = 223, - ConditionalExpression = 224, - TemplateExpression = 225, - YieldExpression = 226, - SpreadElement = 227, - ClassExpression = 228, - OmittedExpression = 229, - ExpressionWithTypeArguments = 230, - AsExpression = 231, - NonNullExpression = 232, - MetaProperty = 233, - SyntheticExpression = 234, - SatisfiesExpression = 235, - TemplateSpan = 236, - SemicolonClassElement = 237, - Block = 238, - EmptyStatement = 239, - VariableStatement = 240, - ExpressionStatement = 241, - IfStatement = 242, - DoStatement = 243, - WhileStatement = 244, - ForStatement = 245, - ForInStatement = 246, - ForOfStatement = 247, - ContinueStatement = 248, - BreakStatement = 249, - ReturnStatement = 250, - WithStatement = 251, - SwitchStatement = 252, - LabeledStatement = 253, - ThrowStatement = 254, - TryStatement = 255, - DebuggerStatement = 256, - VariableDeclaration = 257, - VariableDeclarationList = 258, - FunctionDeclaration = 259, - ClassDeclaration = 260, - InterfaceDeclaration = 261, - TypeAliasDeclaration = 262, - EnumDeclaration = 263, - ModuleDeclaration = 264, - ModuleBlock = 265, - CaseBlock = 266, - NamespaceExportDeclaration = 267, - ImportEqualsDeclaration = 268, - ImportDeclaration = 269, - ImportClause = 270, - NamespaceImport = 271, - NamedImports = 272, - ImportSpecifier = 273, - ExportAssignment = 274, - ExportDeclaration = 275, - NamedExports = 276, - NamespaceExport = 277, - ExportSpecifier = 278, - MissingDeclaration = 279, - ExternalModuleReference = 280, - JsxElement = 281, - JsxSelfClosingElement = 282, - JsxOpeningElement = 283, - JsxClosingElement = 284, - JsxFragment = 285, - JsxOpeningFragment = 286, - JsxClosingFragment = 287, - JsxAttribute = 288, - JsxAttributes = 289, - JsxSpreadAttribute = 290, - JsxExpression = 291, - CaseClause = 292, - DefaultClause = 293, - HeritageClause = 294, - CatchClause = 295, - AssertClause = 296, - AssertEntry = 297, - ImportTypeAssertionContainer = 298, - PropertyAssignment = 299, - ShorthandPropertyAssignment = 300, - SpreadAssignment = 301, - EnumMember = 302, - /** @deprecated */ UnparsedPrologue = 303, - /** @deprecated */ UnparsedPrepend = 304, - /** @deprecated */ UnparsedText = 305, - /** @deprecated */ UnparsedInternalText = 306, - /** @deprecated */ UnparsedSyntheticReference = 307, - SourceFile = 308, - Bundle = 309, - /** @deprecated */ UnparsedSource = 310, - /** @deprecated */ InputFiles = 311, - JSDocTypeExpression = 312, - JSDocNameReference = 313, - JSDocMemberName = 314, - JSDocAllType = 315, - JSDocUnknownType = 316, - JSDocNullableType = 317, - JSDocNonNullableType = 318, - JSDocOptionalType = 319, - JSDocFunctionType = 320, - JSDocVariadicType = 321, - JSDocNamepathType = 322, - JSDoc = 323, + BreakKeyword = 82, + CaseKeyword = 83, + CatchKeyword = 84, + ClassKeyword = 85, + ConstKeyword = 86, + ContinueKeyword = 87, + DebuggerKeyword = 88, + DefaultKeyword = 89, + DeleteKeyword = 90, + DoKeyword = 91, + ElseKeyword = 92, + EnumKeyword = 93, + ExportKeyword = 94, + ExtendsKeyword = 95, + FalseKeyword = 96, + FinallyKeyword = 97, + ForKeyword = 98, + FunctionKeyword = 99, + IfKeyword = 100, + ImportKeyword = 101, + InKeyword = 102, + InstanceOfKeyword = 103, + NewKeyword = 104, + NullKeyword = 105, + ReturnKeyword = 106, + SuperKeyword = 107, + SwitchKeyword = 108, + ThisKeyword = 109, + ThrowKeyword = 110, + TrueKeyword = 111, + TryKeyword = 112, + TypeOfKeyword = 113, + VarKeyword = 114, + VoidKeyword = 115, + WhileKeyword = 116, + WithKeyword = 117, + ImplementsKeyword = 118, + InterfaceKeyword = 119, + LetKeyword = 120, + PackageKeyword = 121, + PrivateKeyword = 122, + ProtectedKeyword = 123, + PublicKeyword = 124, + StaticKeyword = 125, + YieldKeyword = 126, + AbstractKeyword = 127, + AccessorKeyword = 128, + AsKeyword = 129, + AssertsKeyword = 130, + AssertKeyword = 131, + AnyKeyword = 132, + AsyncKeyword = 133, + AwaitKeyword = 134, + BooleanKeyword = 135, + ConstructorKeyword = 136, + DeclareKeyword = 137, + GetKeyword = 138, + InferKeyword = 139, + IntrinsicKeyword = 140, + IsKeyword = 141, + KeyOfKeyword = 142, + ModuleKeyword = 143, + NamespaceKeyword = 144, + NeverKeyword = 145, + OutKeyword = 146, + ReadonlyKeyword = 147, + RequireKeyword = 148, + NumberKeyword = 149, + ObjectKeyword = 150, + SatisfiesKeyword = 151, + SetKeyword = 152, + StringKeyword = 153, + SymbolKeyword = 154, + TypeKeyword = 155, + UndefinedKeyword = 156, + UniqueKeyword = 157, + UnknownKeyword = 158, + FromKeyword = 159, + GlobalKeyword = 160, + BigIntKeyword = 161, + OverrideKeyword = 162, + OfKeyword = 163, + QualifiedName = 164, + ComputedPropertyName = 165, + TypeParameter = 166, + Parameter = 167, + Decorator = 168, + PropertySignature = 169, + PropertyDeclaration = 170, + MethodSignature = 171, + MethodDeclaration = 172, + ClassStaticBlockDeclaration = 173, + Constructor = 174, + GetAccessor = 175, + SetAccessor = 176, + CallSignature = 177, + ConstructSignature = 178, + IndexSignature = 179, + TypePredicate = 180, + TypeReference = 181, + FunctionType = 182, + ConstructorType = 183, + TypeQuery = 184, + TypeLiteral = 185, + ArrayType = 186, + TupleType = 187, + OptionalType = 188, + RestType = 189, + UnionType = 190, + IntersectionType = 191, + ConditionalType = 192, + InferType = 193, + ParenthesizedType = 194, + ThisType = 195, + TypeOperator = 196, + IndexedAccessType = 197, + MappedType = 198, + LiteralType = 199, + NamedTupleMember = 200, + TemplateLiteralType = 201, + TemplateLiteralTypeSpan = 202, + ImportType = 203, + ObjectBindingPattern = 204, + ArrayBindingPattern = 205, + BindingElement = 206, + ArrayLiteralExpression = 207, + ObjectLiteralExpression = 208, + PropertyAccessExpression = 209, + ElementAccessExpression = 210, + CallExpression = 211, + NewExpression = 212, + TaggedTemplateExpression = 213, + TypeAssertionExpression = 214, + ParenthesizedExpression = 215, + FunctionExpression = 216, + ArrowFunction = 217, + DeleteExpression = 218, + TypeOfExpression = 219, + VoidExpression = 220, + AwaitExpression = 221, + PrefixUnaryExpression = 222, + PostfixUnaryExpression = 223, + BinaryExpression = 224, + ConditionalExpression = 225, + TemplateExpression = 226, + YieldExpression = 227, + SpreadElement = 228, + ClassExpression = 229, + OmittedExpression = 230, + ExpressionWithTypeArguments = 231, + AsExpression = 232, + NonNullExpression = 233, + MetaProperty = 234, + SyntheticExpression = 235, + SatisfiesExpression = 236, + TemplateSpan = 237, + SemicolonClassElement = 238, + Block = 239, + EmptyStatement = 240, + VariableStatement = 241, + ExpressionStatement = 242, + IfStatement = 243, + DoStatement = 244, + WhileStatement = 245, + ForStatement = 246, + ForInStatement = 247, + ForOfStatement = 248, + ContinueStatement = 249, + BreakStatement = 250, + ReturnStatement = 251, + WithStatement = 252, + SwitchStatement = 253, + LabeledStatement = 254, + ThrowStatement = 255, + TryStatement = 256, + DebuggerStatement = 257, + VariableDeclaration = 258, + VariableDeclarationList = 259, + FunctionDeclaration = 260, + ClassDeclaration = 261, + InterfaceDeclaration = 262, + TypeAliasDeclaration = 263, + EnumDeclaration = 264, + ModuleDeclaration = 265, + ModuleBlock = 266, + CaseBlock = 267, + NamespaceExportDeclaration = 268, + ImportEqualsDeclaration = 269, + ImportDeclaration = 270, + ImportClause = 271, + NamespaceImport = 272, + NamedImports = 273, + ImportSpecifier = 274, + ExportAssignment = 275, + ExportDeclaration = 276, + NamedExports = 277, + NamespaceExport = 278, + ExportSpecifier = 279, + MissingDeclaration = 280, + ExternalModuleReference = 281, + JsxElement = 282, + JsxSelfClosingElement = 283, + JsxOpeningElement = 284, + JsxClosingElement = 285, + JsxFragment = 286, + JsxOpeningFragment = 287, + JsxClosingFragment = 288, + JsxAttribute = 289, + JsxAttributes = 290, + JsxSpreadAttribute = 291, + JsxExpression = 292, + CaseClause = 293, + DefaultClause = 294, + HeritageClause = 295, + CatchClause = 296, + AssertClause = 297, + AssertEntry = 298, + ImportTypeAssertionContainer = 299, + PropertyAssignment = 300, + ShorthandPropertyAssignment = 301, + SpreadAssignment = 302, + EnumMember = 303, + /** @deprecated */ UnparsedPrologue = 304, + /** @deprecated */ UnparsedPrepend = 305, + /** @deprecated */ UnparsedText = 306, + /** @deprecated */ UnparsedInternalText = 307, + /** @deprecated */ UnparsedSyntheticReference = 308, + SourceFile = 309, + Bundle = 310, + /** @deprecated */ UnparsedSource = 311, + /** @deprecated */ InputFiles = 312, + JSDocTypeExpression = 313, + JSDocNameReference = 314, + JSDocMemberName = 315, + JSDocAllType = 316, + JSDocUnknownType = 317, + JSDocNullableType = 318, + JSDocNonNullableType = 319, + JSDocOptionalType = 320, + JSDocFunctionType = 321, + JSDocVariadicType = 322, + JSDocNamepathType = 323, + JSDoc = 324, /** @deprecated Use SyntaxKind.JSDoc */ - JSDocComment = 323, - JSDocText = 324, - JSDocTypeLiteral = 325, - JSDocSignature = 326, - JSDocLink = 327, - JSDocLinkCode = 328, - JSDocLinkPlain = 329, - JSDocTag = 330, - JSDocAugmentsTag = 331, - JSDocImplementsTag = 332, - JSDocAuthorTag = 333, - JSDocDeprecatedTag = 334, - JSDocClassTag = 335, - JSDocPublicTag = 336, - JSDocPrivateTag = 337, - JSDocProtectedTag = 338, - JSDocReadonlyTag = 339, - JSDocOverrideTag = 340, - JSDocCallbackTag = 341, - JSDocOverloadTag = 342, - JSDocEnumTag = 343, - JSDocParameterTag = 344, - JSDocReturnTag = 345, - JSDocThisTag = 346, - JSDocTypeTag = 347, - JSDocTemplateTag = 348, - JSDocTypedefTag = 349, - JSDocSeeTag = 350, - JSDocPropertyTag = 351, - JSDocThrowsTag = 352, - JSDocSatisfiesTag = 353, - SyntaxList = 354, - NotEmittedStatement = 355, - PartiallyEmittedExpression = 356, - CommaListExpression = 357, - MergeDeclarationMarker = 358, - EndOfDeclarationMarker = 359, - SyntheticReferenceExpression = 360, - Count = 361, + JSDocComment = 324, + JSDocText = 325, + JSDocTypeLiteral = 326, + JSDocSignature = 327, + JSDocLink = 328, + JSDocLinkCode = 329, + JSDocLinkPlain = 330, + JSDocTag = 331, + JSDocAugmentsTag = 332, + JSDocImplementsTag = 333, + JSDocAuthorTag = 334, + JSDocDeprecatedTag = 335, + JSDocClassTag = 336, + JSDocPublicTag = 337, + JSDocPrivateTag = 338, + JSDocProtectedTag = 339, + JSDocReadonlyTag = 340, + JSDocOverrideTag = 341, + JSDocCallbackTag = 342, + JSDocOverloadTag = 343, + JSDocEnumTag = 344, + JSDocParameterTag = 345, + JSDocReturnTag = 346, + JSDocThisTag = 347, + JSDocTypeTag = 348, + JSDocTemplateTag = 349, + JSDocTypedefTag = 350, + JSDocSeeTag = 351, + JSDocPropertyTag = 352, + JSDocThrowsTag = 353, + JSDocSatisfiesTag = 354, + SyntaxList = 355, + NotEmittedStatement = 356, + PartiallyEmittedExpression = 357, + CommaListExpression = 358, + MergeDeclarationMarker = 359, + EndOfDeclarationMarker = 360, + SyntheticReferenceExpression = 361, + Count = 362, FirstAssignment = 63, LastAssignment = 78, FirstCompoundAssignment = 64, LastCompoundAssignment = 78, - FirstReservedWord = 81, - LastReservedWord = 116, - FirstKeyword = 81, - LastKeyword = 162, - FirstFutureReservedWord = 117, - LastFutureReservedWord = 125, - FirstTypeNode = 179, - LastTypeNode = 202, + FirstReservedWord = 82, + LastReservedWord = 117, + FirstKeyword = 82, + LastKeyword = 163, + FirstFutureReservedWord = 118, + LastFutureReservedWord = 126, + FirstTypeNode = 180, + LastTypeNode = 203, FirstPunctuation = 18, LastPunctuation = 78, FirstToken = 0, - LastToken = 162, + LastToken = 163, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -433,13 +433,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 78, - FirstStatement = 240, - LastStatement = 256, - FirstNode = 163, - FirstJSDocNode = 312, - LastJSDocNode = 353, - FirstJSDocTagNode = 330, - LastJSDocTagNode = 353 + FirstStatement = 241, + LastStatement = 257, + FirstNode = 164, + FirstJSDocNode = 313, + LastJSDocNode = 354, + FirstJSDocTagNode = 331, + LastJSDocTagNode = 354 } type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral;