From 9df2f88372b6330a6a1043cbb90d9d3ea383b946 Mon Sep 17 00:00:00 2001
From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Date: Thu, 11 Apr 2019 14:43:53 -0700
Subject: [PATCH 1/4] Scan backticks in jsdoc as a single token less often
Previously, matching backticks in jsdoc would always be scanned as one
token to aid parsing incorrect jsdoc that uses backticks for parameter
names:
``js
/** @param {string} `nope`
* @param {number} `not needed`
*/
```
However, this is wrong for code fences, which use triple backticks. This
fix parses a single backtick as a single token if it's immediately
followed by another backtick or by a newline. It retains the
questionable tokenisation of backticks-as-pairs in other cases, however.
A better fix might be to have the parser ignore backticks in jsdoc
instead.
---
src/compiler/scanner.ts | 10 ++--
.../quickInfoForJSDocCodefence.baseline | 57 +++++++++++++++++++
.../fourslash/quickInfoForJSDocCodefence.ts | 12 ++++
3 files changed, 75 insertions(+), 4 deletions(-)
create mode 100644 tests/baselines/reference/quickInfoForJSDocCodefence.baseline
create mode 100644 tests/cases/fourslash/quickInfoForJSDocCodefence.ts
diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts
index e31876962b7da..73b7b205a52f7 100644
--- a/src/compiler/scanner.ts
+++ b/src/compiler/scanner.ts
@@ -2093,12 +2093,14 @@ namespace ts {
case CharacterCodes.dot:
return token = SyntaxKind.DotToken;
case CharacterCodes.backtick:
- while (pos < end && text.charCodeAt(pos) !== CharacterCodes.backtick) {
+ if (pos < end && text.charCodeAt(pos) !== CharacterCodes.backtick && text.charCodeAt(pos) !== CharacterCodes.carriageReturn && text.charCodeAt(pos) !== CharacterCodes.lineFeed) {
+ while (pos < end && text.charCodeAt(pos) !== CharacterCodes.backtick) {
+ pos++;
+ }
+ tokenValue = text.substring(tokenPos + 1, pos);
pos++;
+ return token = SyntaxKind.NoSubstitutionTemplateLiteral;
}
- tokenValue = text.substring(tokenPos + 1, pos);
- pos++;
- return token = SyntaxKind.NoSubstitutionTemplateLiteral;
}
if (isIdentifierStart(ch, ScriptTarget.Latest)) {
diff --git a/tests/baselines/reference/quickInfoForJSDocCodefence.baseline b/tests/baselines/reference/quickInfoForJSDocCodefence.baseline
new file mode 100644
index 0000000000000..0a8eabb21c925
--- /dev/null
+++ b/tests/baselines/reference/quickInfoForJSDocCodefence.baseline
@@ -0,0 +1,57 @@
+[
+ {
+ "marker": {
+ "fileName": "/tests/cases/fourslash/quickInfoForJSDocCodefence.ts",
+ "position": 54
+ },
+ "quickInfo": {
+ "kind": "function",
+ "kindModifiers": "",
+ "textSpan": {
+ "start": 52,
+ "length": 3
+ },
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "foo",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ],
+ "documentation": [],
+ "tags": [
+ {
+ "name": "example",
+ "text": "```\n1 + 2\n```"
+ }
+ ]
+ }
+ }
+]
\ No newline at end of file
diff --git a/tests/cases/fourslash/quickInfoForJSDocCodefence.ts b/tests/cases/fourslash/quickInfoForJSDocCodefence.ts
new file mode 100644
index 0000000000000..300e50b45362f
--- /dev/null
+++ b/tests/cases/fourslash/quickInfoForJSDocCodefence.ts
@@ -0,0 +1,12 @@
+///
+
+/////**
+//// * @example
+//// * ```
+//// * 1 + 2
+//// * ```
+//// */
+////function fo/*1*/o() {
+//// return '2';
+////}
+verify.baselineQuickInfo();
From dfdffe34df24ce7dde67e3516a55e53c689fb2dd Mon Sep 17 00:00:00 2001
From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Date: Thu, 11 Apr 2019 14:49:11 -0700
Subject: [PATCH 2/4] Add test case
---
.../quickInfoForJSDocCodefence.baseline | 55 +++++++++++++++++++
.../fourslash/quickInfoForJSDocCodefence.ts | 9 +++
2 files changed, 64 insertions(+)
diff --git a/tests/baselines/reference/quickInfoForJSDocCodefence.baseline b/tests/baselines/reference/quickInfoForJSDocCodefence.baseline
index 0a8eabb21c925..a88755fefc947 100644
--- a/tests/baselines/reference/quickInfoForJSDocCodefence.baseline
+++ b/tests/baselines/reference/quickInfoForJSDocCodefence.baseline
@@ -53,5 +53,60 @@
}
]
}
+ },
+ {
+ "marker": {
+ "fileName": "/tests/cases/fourslash/quickInfoForJSDocCodefence.ts",
+ "position": 129
+ },
+ "quickInfo": {
+ "kind": "function",
+ "kindModifiers": "",
+ "textSpan": {
+ "start": 127,
+ "length": 3
+ },
+ "displayParts": [
+ {
+ "text": "function",
+ "kind": "keyword"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "boo",
+ "kind": "functionName"
+ },
+ {
+ "text": "(",
+ "kind": "punctuation"
+ },
+ {
+ "text": ")",
+ "kind": "punctuation"
+ },
+ {
+ "text": ":",
+ "kind": "punctuation"
+ },
+ {
+ "text": " ",
+ "kind": "space"
+ },
+ {
+ "text": "string",
+ "kind": "keyword"
+ }
+ ],
+ "documentation": [],
+ "tags": [
+ {
+ "name": "example",
+ "text": "``\n1 + 2\n`"
+ }
+ ]
+ }
}
]
\ No newline at end of file
diff --git a/tests/cases/fourslash/quickInfoForJSDocCodefence.ts b/tests/cases/fourslash/quickInfoForJSDocCodefence.ts
index 300e50b45362f..c37d2b896d2cc 100644
--- a/tests/cases/fourslash/quickInfoForJSDocCodefence.ts
+++ b/tests/cases/fourslash/quickInfoForJSDocCodefence.ts
@@ -9,4 +9,13 @@
////function fo/*1*/o() {
//// return '2';
////}
+/////**
+//// * @example
+//// * ``
+//// * 1 + 2
+//// * `
+//// */
+////function bo/*2*/o() {
+//// return '2';
+////}
verify.baselineQuickInfo();
From bfa9d3a813ec1f826a133c7766dc1b12d386096a Mon Sep 17 00:00:00 2001
From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Date: Mon, 15 Apr 2019 10:10:11 -0700
Subject: [PATCH 3/4] Handle jsdoc backticks in the parser, not scanner
Previously, the jsdoc scanner had ad-hoc handling of backticks that was
similar in structure to the normal scanner's handling, but much simpler.
This was a smaller code change, but is handled backwards: the special
case of backtick-quoted parameter names was handled in the scanner
instead of in the jsdoc identifier parsing code. That made it overapply
and block correct handling of asterisks across newlines, which was most
obvious in code fences inside jsdoc, as in #23517.
Fixes #23517
---
src/compiler/parser.ts | 31 +++++++++++++------
src/compiler/scanner.ts | 9 +-----
src/compiler/types.ts | 1 +
...parsesCorrectly.paramTagNameThenType1.json | 4 +--
.../reference/paramTagWrapping.errors.txt | 8 ++---
5 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 8eaa005b62e3d..d88fe0d28c7a4 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -6337,7 +6337,14 @@ namespace ts {
const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(SyntaxKind.OpenBraceToken);
result.type = doInsideOfContext(NodeFlags.JSDoc, parseJSDocType);
if (!mayOmitBraces || hasBrace) {
- parseExpected(SyntaxKind.CloseBraceToken);
+ // parseExpected(SyntaxKind.CloseBraceToken); // TODO: need a parseExpectedJSDoc (and rename -> parseOptionalJSDoc)
+ if (token() === SyntaxKind.CloseBraceToken) {
+ nextJSDocToken();
+ }
+ else {
+ parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.CloseBraceToken));
+ }
+
}
fixupParentReferences(result);
@@ -6722,13 +6729,17 @@ namespace ts {
}
function parseBracketNameInPropertyAndParamTag(): { name: EntityName, isBracketed: boolean } {
- if (token() === SyntaxKind.NoSubstitutionTemplateLiteral) {
- // a markdown-quoted name: `arg` is not legal jsdoc, but occurs in the wild
- return { name: createIdentifier(/*isIdentifier*/ true), isBracketed: false };
- }
// Looking for something like '[foo]', 'foo', '[foo.bar]' or 'foo.bar'
- const isBracketed = parseOptional(SyntaxKind.OpenBracketToken);
+ const isBracketed = parseOptionalJsdoc(SyntaxKind.OpenBracketToken);
+ if (isBracketed) {
+ skipWhitespace();
+ }
+ // a markdown-quoted name: `arg` is not legal jsdoc, but occurs in the wild
+ const isBackquoted = parseOptionalJsdoc(SyntaxKind.NoSubstitutionTemplateLiteral);
const name = parseJSDocEntityName();
+ if (isBackquoted) {
+ parseExpectedToken(SyntaxKind.NoSubstitutionTemplateLiteral);
+ }
if (isBracketed) {
skipWhitespace();
@@ -7101,10 +7112,6 @@ namespace ts {
return result;
}
- function nextJSDocToken(): JsDocSyntaxKind {
- return currentToken = scanner.scanJSDocToken();
- }
-
function parseOptionalJsdoc(t: JsDocSyntaxKind): boolean {
if (token() === t) {
nextJSDocToken();
@@ -7146,6 +7153,10 @@ namespace ts {
return result;
}
}
+
+ function nextJSDocToken(): JsDocSyntaxKind {
+ return currentToken = scanner.scanJSDocToken();
+ }
}
}
diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts
index 73b7b205a52f7..a80d428ffbc7d 100644
--- a/src/compiler/scanner.ts
+++ b/src/compiler/scanner.ts
@@ -2093,14 +2093,7 @@ namespace ts {
case CharacterCodes.dot:
return token = SyntaxKind.DotToken;
case CharacterCodes.backtick:
- if (pos < end && text.charCodeAt(pos) !== CharacterCodes.backtick && text.charCodeAt(pos) !== CharacterCodes.carriageReturn && text.charCodeAt(pos) !== CharacterCodes.lineFeed) {
- while (pos < end && text.charCodeAt(pos) !== CharacterCodes.backtick) {
- pos++;
- }
- tokenValue = text.substring(tokenPos + 1, pos);
- pos++;
- return token = SyntaxKind.NoSubstitutionTemplateLiteral;
- }
+ return token = SyntaxKind.NoSubstitutionTemplateLiteral;
}
if (isIdentifierStart(ch, ScriptTarget.Latest)) {
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 55492081050a8..a3afe4fb68ed2 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -181,6 +181,7 @@ namespace ts {
QuestionToken,
ColonToken,
AtToken,
+ // BacktickToken, // TODO: Sure would be nice! But only JSDoc would use it, which would be super confusing
// Assignments
EqualsToken,
PlusEqualsToken,
diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTagNameThenType1.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTagNameThenType1.json
index 1d515fd8eb069..24779f14f89e0 100644
--- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTagNameThenType1.json
+++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTagNameThenType1.json
@@ -8,7 +8,7 @@
"0": {
"kind": "JSDocParameterTag",
"pos": 8,
- "end": 29,
+ "end": 32,
"modifierFlagsCache": 0,
"transformFlags": 0,
"tagName": {
@@ -46,6 +46,6 @@
},
"length": 1,
"pos": 8,
- "end": 29
+ "end": 32
}
}
\ No newline at end of file
diff --git a/tests/baselines/reference/paramTagWrapping.errors.txt b/tests/baselines/reference/paramTagWrapping.errors.txt
index 48100f0e7468c..b1564a4f85b8b 100644
--- a/tests/baselines/reference/paramTagWrapping.errors.txt
+++ b/tests/baselines/reference/paramTagWrapping.errors.txt
@@ -2,8 +2,8 @@ tests/cases/conformance/jsdoc/bad.js(2,11): error TS1003: Identifier expected.
tests/cases/conformance/jsdoc/bad.js(2,11): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
tests/cases/conformance/jsdoc/bad.js(5,4): error TS1003: Identifier expected.
tests/cases/conformance/jsdoc/bad.js(5,4): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
-tests/cases/conformance/jsdoc/bad.js(6,19): error TS1003: Identifier expected.
-tests/cases/conformance/jsdoc/bad.js(6,19): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
+tests/cases/conformance/jsdoc/bad.js(6,20): error TS1003: Identifier expected.
+tests/cases/conformance/jsdoc/bad.js(6,20): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
tests/cases/conformance/jsdoc/bad.js(9,14): error TS7006: Parameter 'x' implicitly has an 'any' type.
tests/cases/conformance/jsdoc/bad.js(9,17): error TS7006: Parameter 'y' implicitly has an 'any' type.
tests/cases/conformance/jsdoc/bad.js(9,20): error TS7006: Parameter 'z' implicitly has an 'any' type.
@@ -39,9 +39,9 @@ tests/cases/conformance/jsdoc/bad.js(9,20): error TS7006: Parameter 'z' implicit
!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
* @param {number} * z
-
+
!!! error TS1003: Identifier expected.
-
+
!!! error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
* Arg z.
*/
From e5ee6e61e19cd08f9c5696e99d470236033e2de8 Mon Sep 17 00:00:00 2001
From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Date: Mon, 15 Apr 2019 11:13:48 -0700
Subject: [PATCH 4/4] More cleanup
---
src/compiler/parser.ts | 83 ++-
src/compiler/scanner.ts | 8 +-
src/compiler/types.ts | 7 +-
.../reference/api/tsserverlibrary.d.ts | 564 +++++++++---------
tests/baselines/reference/api/typescript.d.ts | 564 +++++++++---------
5 files changed, 626 insertions(+), 600 deletions(-)
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index d88fe0d28c7a4..f8f45966cb516 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -1081,6 +1081,10 @@ namespace ts {
return currentToken = scanner.scan();
}
+ function nextTokenJSDoc(): JSDocSyntaxKind {
+ return currentToken = scanner.scanJsDocToken();
+ }
+
function reScanGreaterToken(): SyntaxKind {
return currentToken = scanner.reScanGreaterToken();
}
@@ -1198,6 +1202,15 @@ namespace ts {
return false;
}
+ function parseExpectedJSDoc(kind: JSDocSyntaxKind) {
+ if (token() === kind) {
+ nextTokenJSDoc();
+ return true;
+ }
+ parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(kind));
+ return false;
+ }
+
function parseOptional(t: SyntaxKind): boolean {
if (token() === t) {
nextToken();
@@ -1214,18 +1227,38 @@ namespace ts {
return undefined;
}
+ function parseOptionalTokenJSDoc(t: TKind): Token;
+ function parseOptionalTokenJSDoc(t: JSDocSyntaxKind): Node | undefined {
+ if (token() === t) {
+ return parseTokenNodeJSDoc();
+ }
+ return undefined;
+ }
+
function parseExpectedToken(t: TKind, diagnosticMessage?: DiagnosticMessage, arg0?: any): Token;
function parseExpectedToken(t: SyntaxKind, diagnosticMessage?: DiagnosticMessage, arg0?: any): Node {
return parseOptionalToken(t) ||
createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || Diagnostics._0_expected, arg0 || tokenToString(t));
}
+ function parseExpectedTokenJSDoc(t: TKind): Token;
+ function parseExpectedTokenJSDoc(t: JSDocSyntaxKind): Node {
+ return parseOptionalTokenJSDoc(t) ||
+ createMissingNode(t, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, tokenToString(t));
+ }
+
function parseTokenNode(): T {
const node = createNode(token());
nextToken();
return finishNode(node);
}
+ function parseTokenNodeJSDoc(): T {
+ const node = createNode(token());
+ nextTokenJSDoc();
+ return finishNode(node);
+ }
+
function canParseSemicolon() {
// If there's a real semicolon, then we can always parse it out.
if (token() === SyntaxKind.SemicolonToken) {
@@ -6337,14 +6370,7 @@ namespace ts {
const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(SyntaxKind.OpenBraceToken);
result.type = doInsideOfContext(NodeFlags.JSDoc, parseJSDocType);
if (!mayOmitBraces || hasBrace) {
- // parseExpected(SyntaxKind.CloseBraceToken); // TODO: need a parseExpectedJSDoc (and rename -> parseOptionalJSDoc)
- if (token() === SyntaxKind.CloseBraceToken) {
- nextJSDocToken();
- }
- else {
- parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.CloseBraceToken));
- }
-
+ parseExpectedJSDoc(SyntaxKind.CloseBraceToken);
}
fixupParentReferences(result);
@@ -6431,7 +6457,7 @@ namespace ts {
indent += text.length;
}
- nextJSDocToken();
+ nextTokenJSDoc();
while (parseOptionalJsdoc(SyntaxKind.WhitespaceTrivia));
if (parseOptionalJsdoc(SyntaxKind.NewLineTrivia)) {
state = JSDocState.BeginningOfLine;
@@ -6492,7 +6518,7 @@ namespace ts {
pushComment(scanner.getTokenText());
break;
}
- nextJSDocToken();
+ nextTokenJSDoc();
}
removeLeadingNewlines(comments);
removeTrailingWhitespace(comments);
@@ -6521,7 +6547,7 @@ namespace ts {
function isNextNonwhitespaceTokenEndOfFile(): boolean {
// We must use infinite lookahead, as there could be any number of newlines :(
while (true) {
- nextJSDocToken();
+ nextTokenJSDoc();
if (token() === SyntaxKind.EndOfFileToken) {
return true;
}
@@ -6538,7 +6564,7 @@ namespace ts {
}
}
while (token() === SyntaxKind.WhitespaceTrivia || token() === SyntaxKind.NewLineTrivia) {
- nextJSDocToken();
+ nextTokenJSDoc();
}
}
@@ -6562,7 +6588,7 @@ namespace ts {
else if (token() === SyntaxKind.AsteriskToken) {
precedingLineBreak = false;
}
- nextJSDocToken();
+ nextTokenJSDoc();
}
return seenLineBreak ? indentText : "";
}
@@ -6570,7 +6596,7 @@ namespace ts {
function parseTag(margin: number) {
Debug.assert(token() === SyntaxKind.AtToken);
const start = scanner.getTokenPos();
- nextJSDocToken();
+ nextTokenJSDoc();
const tagName = parseJSDocIdentifierName(/*message*/ undefined);
const indentText = skipWhitespaceOrAsterisk();
@@ -6642,7 +6668,7 @@ namespace ts {
pushComment(initialMargin);
state = JSDocState.SavingComments;
}
- let tok = token() as JsDocSyntaxKind;
+ let tok = token() as JSDocSyntaxKind;
loop: while (true) {
switch (tok) {
case SyntaxKind.NewLineTrivia:
@@ -6673,11 +6699,11 @@ namespace ts {
break;
case SyntaxKind.OpenBraceToken:
state = JSDocState.SavingComments;
- if (lookAhead(() => nextJSDocToken() === SyntaxKind.AtToken && tokenIsIdentifierOrKeyword(nextJSDocToken()) && scanner.getTokenText() === "link")) {
+ if (lookAhead(() => nextTokenJSDoc() === SyntaxKind.AtToken && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenText() === "link")) {
pushComment(scanner.getTokenText());
- nextJSDocToken();
+ nextTokenJSDoc();
pushComment(scanner.getTokenText());
- nextJSDocToken();
+ nextTokenJSDoc();
}
pushComment(scanner.getTokenText());
break;
@@ -6695,7 +6721,7 @@ namespace ts {
pushComment(scanner.getTokenText());
break;
}
- tok = nextJSDocToken();
+ tok = nextTokenJSDoc();
}
removeLeadingNewlines(comments);
@@ -6735,14 +6761,13 @@ namespace ts {
skipWhitespace();
}
// a markdown-quoted name: `arg` is not legal jsdoc, but occurs in the wild
- const isBackquoted = parseOptionalJsdoc(SyntaxKind.NoSubstitutionTemplateLiteral);
+ const isBackquoted = parseOptionalJsdoc(SyntaxKind.BacktickToken);
const name = parseJSDocEntityName();
if (isBackquoted) {
- parseExpectedToken(SyntaxKind.NoSubstitutionTemplateLiteral);
+ parseExpectedTokenJSDoc(SyntaxKind.BacktickToken);
}
if (isBracketed) {
skipWhitespace();
-
// May have an optional default, e.g. '[foo = 42]'
if (parseOptionalToken(SyntaxKind.EqualsToken)) {
parseExpression();
@@ -7025,7 +7050,7 @@ namespace ts {
let canParseTag = true;
let seenAsterisk = false;
while (true) {
- switch (nextJSDocToken()) {
+ switch (nextTokenJSDoc()) {
case SyntaxKind.AtToken:
if (canParseTag) {
const child = tryParseChildTag(target, indent);
@@ -7060,7 +7085,7 @@ namespace ts {
function tryParseChildTag(target: PropertyLikeParse, indent: number): JSDocTypeTag | JSDocPropertyTag | JSDocParameterTag | false {
Debug.assert(token() === SyntaxKind.AtToken);
const start = scanner.getStartPos();
- nextJSDocToken();
+ nextTokenJSDoc();
const tagName = parseJSDocIdentifierName();
skipWhitespace();
@@ -7112,9 +7137,9 @@ namespace ts {
return result;
}
- function parseOptionalJsdoc(t: JsDocSyntaxKind): boolean {
+ function parseOptionalJsdoc(t: JSDocSyntaxKind): boolean {
if (token() === t) {
- nextJSDocToken();
+ nextTokenJSDoc();
return true;
}
return false;
@@ -7149,14 +7174,10 @@ namespace ts {
result.escapedText = escapeLeadingUnderscores(scanner.getTokenText());
finishNode(result, end);
- nextJSDocToken();
+ nextTokenJSDoc();
return result;
}
}
-
- function nextJSDocToken(): JsDocSyntaxKind {
- return currentToken = scanner.scanJSDocToken();
- }
}
}
diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts
index a80d428ffbc7d..36ac8adfa9053 100644
--- a/src/compiler/scanner.ts
+++ b/src/compiler/scanner.ts
@@ -33,7 +33,7 @@ namespace ts {
reScanJsxToken(): JsxTokenSyntaxKind;
reScanLessThanToken(): SyntaxKind;
scanJsxToken(): JsxTokenSyntaxKind;
- scanJSDocToken(): JsDocSyntaxKind;
+ scanJsDocToken(): JSDocSyntaxKind;
scan(): SyntaxKind;
getText(): string;
// Sets the text for the scanner to scan. An optional subrange starting point and length
@@ -886,7 +886,7 @@ namespace ts {
reScanJsxToken,
reScanLessThanToken,
scanJsxToken,
- scanJSDocToken,
+ scanJsDocToken,
scan,
getText,
setText,
@@ -2050,7 +2050,7 @@ namespace ts {
}
}
- function scanJSDocToken(): JsDocSyntaxKind {
+ function scanJsDocToken(): JSDocSyntaxKind {
startPos = tokenPos = pos;
tokenFlags = 0;
if (pos >= end) {
@@ -2093,7 +2093,7 @@ namespace ts {
case CharacterCodes.dot:
return token = SyntaxKind.DotToken;
case CharacterCodes.backtick:
- return token = SyntaxKind.NoSubstitutionTemplateLiteral;
+ return token = SyntaxKind.BacktickToken;
}
if (isIdentifierStart(ch, ScriptTarget.Latest)) {
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index a3afe4fb68ed2..7fbece3edf819 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -8,7 +8,7 @@ namespace ts {
end: number;
}
- export type JsDocSyntaxKind =
+ export type JSDocSyntaxKind =
| SyntaxKind.EndOfFileToken
| SyntaxKind.WhitespaceTrivia
| SyntaxKind.AtToken
@@ -23,7 +23,7 @@ namespace ts {
| SyntaxKind.CommaToken
| SyntaxKind.DotToken
| SyntaxKind.Identifier
- | SyntaxKind.NoSubstitutionTemplateLiteral
+ | SyntaxKind.BacktickToken
| SyntaxKind.Unknown
| KeywordSyntaxKind;
@@ -181,7 +181,8 @@ namespace ts {
QuestionToken,
ColonToken,
AtToken,
- // BacktickToken, // TODO: Sure would be nice! But only JSDoc would use it, which would be super confusing
+ /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */
+ BacktickToken,
// Assignments
EqualsToken,
PlusEqualsToken,
diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts
index 46cd79bf77dfc..16a855d01afe2 100644
--- a/tests/baselines/reference/api/tsserverlibrary.d.ts
+++ b/tests/baselines/reference/api/tsserverlibrary.d.ts
@@ -72,7 +72,7 @@ declare namespace ts {
pos: number;
end: number;
}
- type JsDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.NoSubstitutionTemplateLiteral | SyntaxKind.Unknown | KeywordSyntaxKind;
+ type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword;
type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
enum SyntaxKind {
@@ -135,281 +135,283 @@ declare namespace ts {
QuestionToken = 56,
ColonToken = 57,
AtToken = 58,
- EqualsToken = 59,
- PlusEqualsToken = 60,
- MinusEqualsToken = 61,
- AsteriskEqualsToken = 62,
- AsteriskAsteriskEqualsToken = 63,
- SlashEqualsToken = 64,
- PercentEqualsToken = 65,
- LessThanLessThanEqualsToken = 66,
- GreaterThanGreaterThanEqualsToken = 67,
- GreaterThanGreaterThanGreaterThanEqualsToken = 68,
- AmpersandEqualsToken = 69,
- BarEqualsToken = 70,
- CaretEqualsToken = 71,
- Identifier = 72,
- BreakKeyword = 73,
- CaseKeyword = 74,
- CatchKeyword = 75,
- ClassKeyword = 76,
- ConstKeyword = 77,
- ContinueKeyword = 78,
- DebuggerKeyword = 79,
- DefaultKeyword = 80,
- DeleteKeyword = 81,
- DoKeyword = 82,
- ElseKeyword = 83,
- EnumKeyword = 84,
- ExportKeyword = 85,
- ExtendsKeyword = 86,
- FalseKeyword = 87,
- FinallyKeyword = 88,
- ForKeyword = 89,
- FunctionKeyword = 90,
- IfKeyword = 91,
- ImportKeyword = 92,
- InKeyword = 93,
- InstanceOfKeyword = 94,
- NewKeyword = 95,
- NullKeyword = 96,
- ReturnKeyword = 97,
- SuperKeyword = 98,
- SwitchKeyword = 99,
- ThisKeyword = 100,
- ThrowKeyword = 101,
- TrueKeyword = 102,
- TryKeyword = 103,
- TypeOfKeyword = 104,
- VarKeyword = 105,
- VoidKeyword = 106,
- WhileKeyword = 107,
- WithKeyword = 108,
- ImplementsKeyword = 109,
- InterfaceKeyword = 110,
- LetKeyword = 111,
- PackageKeyword = 112,
- PrivateKeyword = 113,
- ProtectedKeyword = 114,
- PublicKeyword = 115,
- StaticKeyword = 116,
- YieldKeyword = 117,
- AbstractKeyword = 118,
- AsKeyword = 119,
- AnyKeyword = 120,
- AsyncKeyword = 121,
- AwaitKeyword = 122,
- BooleanKeyword = 123,
- ConstructorKeyword = 124,
- DeclareKeyword = 125,
- GetKeyword = 126,
- InferKeyword = 127,
- IsKeyword = 128,
- KeyOfKeyword = 129,
- ModuleKeyword = 130,
- NamespaceKeyword = 131,
- NeverKeyword = 132,
- ReadonlyKeyword = 133,
- RequireKeyword = 134,
- NumberKeyword = 135,
- ObjectKeyword = 136,
- SetKeyword = 137,
- StringKeyword = 138,
- SymbolKeyword = 139,
- TypeKeyword = 140,
- UndefinedKeyword = 141,
- UniqueKeyword = 142,
- UnknownKeyword = 143,
- FromKeyword = 144,
- GlobalKeyword = 145,
- BigIntKeyword = 146,
- OfKeyword = 147,
- QualifiedName = 148,
- ComputedPropertyName = 149,
- TypeParameter = 150,
- Parameter = 151,
- Decorator = 152,
- PropertySignature = 153,
- PropertyDeclaration = 154,
- MethodSignature = 155,
- MethodDeclaration = 156,
- Constructor = 157,
- GetAccessor = 158,
- SetAccessor = 159,
- CallSignature = 160,
- ConstructSignature = 161,
- IndexSignature = 162,
- TypePredicate = 163,
- TypeReference = 164,
- FunctionType = 165,
- ConstructorType = 166,
- TypeQuery = 167,
- TypeLiteral = 168,
- ArrayType = 169,
- TupleType = 170,
- OptionalType = 171,
- RestType = 172,
- UnionType = 173,
- IntersectionType = 174,
- ConditionalType = 175,
- InferType = 176,
- ParenthesizedType = 177,
- ThisType = 178,
- TypeOperator = 179,
- IndexedAccessType = 180,
- MappedType = 181,
- LiteralType = 182,
- ImportType = 183,
- ObjectBindingPattern = 184,
- ArrayBindingPattern = 185,
- BindingElement = 186,
- ArrayLiteralExpression = 187,
- ObjectLiteralExpression = 188,
- PropertyAccessExpression = 189,
- ElementAccessExpression = 190,
- CallExpression = 191,
- NewExpression = 192,
- TaggedTemplateExpression = 193,
- TypeAssertionExpression = 194,
- ParenthesizedExpression = 195,
- FunctionExpression = 196,
- ArrowFunction = 197,
- DeleteExpression = 198,
- TypeOfExpression = 199,
- VoidExpression = 200,
- AwaitExpression = 201,
- PrefixUnaryExpression = 202,
- PostfixUnaryExpression = 203,
- BinaryExpression = 204,
- ConditionalExpression = 205,
- TemplateExpression = 206,
- YieldExpression = 207,
- SpreadElement = 208,
- ClassExpression = 209,
- OmittedExpression = 210,
- ExpressionWithTypeArguments = 211,
- AsExpression = 212,
- NonNullExpression = 213,
- MetaProperty = 214,
- SyntheticExpression = 215,
- TemplateSpan = 216,
- SemicolonClassElement = 217,
- Block = 218,
- VariableStatement = 219,
- EmptyStatement = 220,
- ExpressionStatement = 221,
- IfStatement = 222,
- DoStatement = 223,
- WhileStatement = 224,
- ForStatement = 225,
- ForInStatement = 226,
- ForOfStatement = 227,
- ContinueStatement = 228,
- BreakStatement = 229,
- ReturnStatement = 230,
- WithStatement = 231,
- SwitchStatement = 232,
- LabeledStatement = 233,
- ThrowStatement = 234,
- TryStatement = 235,
- DebuggerStatement = 236,
- VariableDeclaration = 237,
- VariableDeclarationList = 238,
- FunctionDeclaration = 239,
- ClassDeclaration = 240,
- InterfaceDeclaration = 241,
- TypeAliasDeclaration = 242,
- EnumDeclaration = 243,
- ModuleDeclaration = 244,
- ModuleBlock = 245,
- CaseBlock = 246,
- NamespaceExportDeclaration = 247,
- ImportEqualsDeclaration = 248,
- ImportDeclaration = 249,
- ImportClause = 250,
- NamespaceImport = 251,
- NamedImports = 252,
- ImportSpecifier = 253,
- ExportAssignment = 254,
- ExportDeclaration = 255,
- NamedExports = 256,
- ExportSpecifier = 257,
- MissingDeclaration = 258,
- ExternalModuleReference = 259,
- JsxElement = 260,
- JsxSelfClosingElement = 261,
- JsxOpeningElement = 262,
- JsxClosingElement = 263,
- JsxFragment = 264,
- JsxOpeningFragment = 265,
- JsxClosingFragment = 266,
- JsxAttribute = 267,
- JsxAttributes = 268,
- JsxSpreadAttribute = 269,
- JsxExpression = 270,
- CaseClause = 271,
- DefaultClause = 272,
- HeritageClause = 273,
- CatchClause = 274,
- PropertyAssignment = 275,
- ShorthandPropertyAssignment = 276,
- SpreadAssignment = 277,
- EnumMember = 278,
- UnparsedPrologue = 279,
- UnparsedPrepend = 280,
- UnparsedText = 281,
- UnparsedInternalText = 282,
- UnparsedSyntheticReference = 283,
- SourceFile = 284,
- Bundle = 285,
- UnparsedSource = 286,
- InputFiles = 287,
- JSDocTypeExpression = 288,
- JSDocAllType = 289,
- JSDocUnknownType = 290,
- JSDocNullableType = 291,
- JSDocNonNullableType = 292,
- JSDocOptionalType = 293,
- JSDocFunctionType = 294,
- JSDocVariadicType = 295,
- JSDocComment = 296,
- JSDocTypeLiteral = 297,
- JSDocSignature = 298,
- JSDocTag = 299,
- JSDocAugmentsTag = 300,
- JSDocClassTag = 301,
- JSDocCallbackTag = 302,
- JSDocEnumTag = 303,
- JSDocParameterTag = 304,
- JSDocReturnTag = 305,
- JSDocThisTag = 306,
- JSDocTypeTag = 307,
- JSDocTemplateTag = 308,
- JSDocTypedefTag = 309,
- JSDocPropertyTag = 310,
- SyntaxList = 311,
- NotEmittedStatement = 312,
- PartiallyEmittedExpression = 313,
- CommaListExpression = 314,
- MergeDeclarationMarker = 315,
- EndOfDeclarationMarker = 316,
- Count = 317,
- FirstAssignment = 59,
- LastAssignment = 71,
- FirstCompoundAssignment = 60,
- LastCompoundAssignment = 71,
- FirstReservedWord = 73,
- LastReservedWord = 108,
- FirstKeyword = 73,
- LastKeyword = 147,
- FirstFutureReservedWord = 109,
- LastFutureReservedWord = 117,
- FirstTypeNode = 163,
- LastTypeNode = 183,
+ /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */
+ BacktickToken = 59,
+ EqualsToken = 60,
+ PlusEqualsToken = 61,
+ MinusEqualsToken = 62,
+ AsteriskEqualsToken = 63,
+ AsteriskAsteriskEqualsToken = 64,
+ SlashEqualsToken = 65,
+ PercentEqualsToken = 66,
+ LessThanLessThanEqualsToken = 67,
+ GreaterThanGreaterThanEqualsToken = 68,
+ GreaterThanGreaterThanGreaterThanEqualsToken = 69,
+ AmpersandEqualsToken = 70,
+ BarEqualsToken = 71,
+ CaretEqualsToken = 72,
+ Identifier = 73,
+ BreakKeyword = 74,
+ CaseKeyword = 75,
+ CatchKeyword = 76,
+ ClassKeyword = 77,
+ ConstKeyword = 78,
+ ContinueKeyword = 79,
+ DebuggerKeyword = 80,
+ DefaultKeyword = 81,
+ DeleteKeyword = 82,
+ DoKeyword = 83,
+ ElseKeyword = 84,
+ EnumKeyword = 85,
+ ExportKeyword = 86,
+ ExtendsKeyword = 87,
+ FalseKeyword = 88,
+ FinallyKeyword = 89,
+ ForKeyword = 90,
+ FunctionKeyword = 91,
+ IfKeyword = 92,
+ ImportKeyword = 93,
+ InKeyword = 94,
+ InstanceOfKeyword = 95,
+ NewKeyword = 96,
+ NullKeyword = 97,
+ ReturnKeyword = 98,
+ SuperKeyword = 99,
+ SwitchKeyword = 100,
+ ThisKeyword = 101,
+ ThrowKeyword = 102,
+ TrueKeyword = 103,
+ TryKeyword = 104,
+ TypeOfKeyword = 105,
+ VarKeyword = 106,
+ VoidKeyword = 107,
+ WhileKeyword = 108,
+ WithKeyword = 109,
+ ImplementsKeyword = 110,
+ InterfaceKeyword = 111,
+ LetKeyword = 112,
+ PackageKeyword = 113,
+ PrivateKeyword = 114,
+ ProtectedKeyword = 115,
+ PublicKeyword = 116,
+ StaticKeyword = 117,
+ YieldKeyword = 118,
+ AbstractKeyword = 119,
+ AsKeyword = 120,
+ AnyKeyword = 121,
+ AsyncKeyword = 122,
+ AwaitKeyword = 123,
+ BooleanKeyword = 124,
+ ConstructorKeyword = 125,
+ DeclareKeyword = 126,
+ GetKeyword = 127,
+ InferKeyword = 128,
+ IsKeyword = 129,
+ KeyOfKeyword = 130,
+ ModuleKeyword = 131,
+ NamespaceKeyword = 132,
+ NeverKeyword = 133,
+ ReadonlyKeyword = 134,
+ RequireKeyword = 135,
+ NumberKeyword = 136,
+ ObjectKeyword = 137,
+ SetKeyword = 138,
+ StringKeyword = 139,
+ SymbolKeyword = 140,
+ TypeKeyword = 141,
+ UndefinedKeyword = 142,
+ UniqueKeyword = 143,
+ UnknownKeyword = 144,
+ FromKeyword = 145,
+ GlobalKeyword = 146,
+ BigIntKeyword = 147,
+ OfKeyword = 148,
+ QualifiedName = 149,
+ ComputedPropertyName = 150,
+ TypeParameter = 151,
+ Parameter = 152,
+ Decorator = 153,
+ PropertySignature = 154,
+ PropertyDeclaration = 155,
+ MethodSignature = 156,
+ MethodDeclaration = 157,
+ Constructor = 158,
+ GetAccessor = 159,
+ SetAccessor = 160,
+ CallSignature = 161,
+ ConstructSignature = 162,
+ IndexSignature = 163,
+ TypePredicate = 164,
+ TypeReference = 165,
+ FunctionType = 166,
+ ConstructorType = 167,
+ TypeQuery = 168,
+ TypeLiteral = 169,
+ ArrayType = 170,
+ TupleType = 171,
+ OptionalType = 172,
+ RestType = 173,
+ UnionType = 174,
+ IntersectionType = 175,
+ ConditionalType = 176,
+ InferType = 177,
+ ParenthesizedType = 178,
+ ThisType = 179,
+ TypeOperator = 180,
+ IndexedAccessType = 181,
+ MappedType = 182,
+ LiteralType = 183,
+ ImportType = 184,
+ ObjectBindingPattern = 185,
+ ArrayBindingPattern = 186,
+ BindingElement = 187,
+ ArrayLiteralExpression = 188,
+ ObjectLiteralExpression = 189,
+ PropertyAccessExpression = 190,
+ ElementAccessExpression = 191,
+ CallExpression = 192,
+ NewExpression = 193,
+ TaggedTemplateExpression = 194,
+ TypeAssertionExpression = 195,
+ ParenthesizedExpression = 196,
+ FunctionExpression = 197,
+ ArrowFunction = 198,
+ DeleteExpression = 199,
+ TypeOfExpression = 200,
+ VoidExpression = 201,
+ AwaitExpression = 202,
+ PrefixUnaryExpression = 203,
+ PostfixUnaryExpression = 204,
+ BinaryExpression = 205,
+ ConditionalExpression = 206,
+ TemplateExpression = 207,
+ YieldExpression = 208,
+ SpreadElement = 209,
+ ClassExpression = 210,
+ OmittedExpression = 211,
+ ExpressionWithTypeArguments = 212,
+ AsExpression = 213,
+ NonNullExpression = 214,
+ MetaProperty = 215,
+ SyntheticExpression = 216,
+ TemplateSpan = 217,
+ SemicolonClassElement = 218,
+ Block = 219,
+ VariableStatement = 220,
+ EmptyStatement = 221,
+ ExpressionStatement = 222,
+ IfStatement = 223,
+ DoStatement = 224,
+ WhileStatement = 225,
+ ForStatement = 226,
+ ForInStatement = 227,
+ ForOfStatement = 228,
+ ContinueStatement = 229,
+ BreakStatement = 230,
+ ReturnStatement = 231,
+ WithStatement = 232,
+ SwitchStatement = 233,
+ LabeledStatement = 234,
+ ThrowStatement = 235,
+ TryStatement = 236,
+ DebuggerStatement = 237,
+ VariableDeclaration = 238,
+ VariableDeclarationList = 239,
+ FunctionDeclaration = 240,
+ ClassDeclaration = 241,
+ InterfaceDeclaration = 242,
+ TypeAliasDeclaration = 243,
+ EnumDeclaration = 244,
+ ModuleDeclaration = 245,
+ ModuleBlock = 246,
+ CaseBlock = 247,
+ NamespaceExportDeclaration = 248,
+ ImportEqualsDeclaration = 249,
+ ImportDeclaration = 250,
+ ImportClause = 251,
+ NamespaceImport = 252,
+ NamedImports = 253,
+ ImportSpecifier = 254,
+ ExportAssignment = 255,
+ ExportDeclaration = 256,
+ NamedExports = 257,
+ ExportSpecifier = 258,
+ MissingDeclaration = 259,
+ ExternalModuleReference = 260,
+ JsxElement = 261,
+ JsxSelfClosingElement = 262,
+ JsxOpeningElement = 263,
+ JsxClosingElement = 264,
+ JsxFragment = 265,
+ JsxOpeningFragment = 266,
+ JsxClosingFragment = 267,
+ JsxAttribute = 268,
+ JsxAttributes = 269,
+ JsxSpreadAttribute = 270,
+ JsxExpression = 271,
+ CaseClause = 272,
+ DefaultClause = 273,
+ HeritageClause = 274,
+ CatchClause = 275,
+ PropertyAssignment = 276,
+ ShorthandPropertyAssignment = 277,
+ SpreadAssignment = 278,
+ EnumMember = 279,
+ UnparsedPrologue = 280,
+ UnparsedPrepend = 281,
+ UnparsedText = 282,
+ UnparsedInternalText = 283,
+ UnparsedSyntheticReference = 284,
+ SourceFile = 285,
+ Bundle = 286,
+ UnparsedSource = 287,
+ InputFiles = 288,
+ JSDocTypeExpression = 289,
+ JSDocAllType = 290,
+ JSDocUnknownType = 291,
+ JSDocNullableType = 292,
+ JSDocNonNullableType = 293,
+ JSDocOptionalType = 294,
+ JSDocFunctionType = 295,
+ JSDocVariadicType = 296,
+ JSDocComment = 297,
+ JSDocTypeLiteral = 298,
+ JSDocSignature = 299,
+ JSDocTag = 300,
+ JSDocAugmentsTag = 301,
+ JSDocClassTag = 302,
+ JSDocCallbackTag = 303,
+ JSDocEnumTag = 304,
+ JSDocParameterTag = 305,
+ JSDocReturnTag = 306,
+ JSDocThisTag = 307,
+ JSDocTypeTag = 308,
+ JSDocTemplateTag = 309,
+ JSDocTypedefTag = 310,
+ JSDocPropertyTag = 311,
+ SyntaxList = 312,
+ NotEmittedStatement = 313,
+ PartiallyEmittedExpression = 314,
+ CommaListExpression = 315,
+ MergeDeclarationMarker = 316,
+ EndOfDeclarationMarker = 317,
+ Count = 318,
+ FirstAssignment = 60,
+ LastAssignment = 72,
+ FirstCompoundAssignment = 61,
+ LastCompoundAssignment = 72,
+ FirstReservedWord = 74,
+ LastReservedWord = 109,
+ FirstKeyword = 74,
+ LastKeyword = 148,
+ FirstFutureReservedWord = 110,
+ LastFutureReservedWord = 118,
+ FirstTypeNode = 164,
+ LastTypeNode = 184,
FirstPunctuation = 18,
- LastPunctuation = 71,
+ LastPunctuation = 72,
FirstToken = 0,
- LastToken = 147,
+ LastToken = 148,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -417,12 +419,12 @@ declare namespace ts {
FirstTemplateToken = 14,
LastTemplateToken = 17,
FirstBinaryOperator = 28,
- LastBinaryOperator = 71,
- FirstNode = 148,
- FirstJSDocNode = 288,
- LastJSDocNode = 310,
- FirstJSDocTagNode = 299,
- LastJSDocTagNode = 310,
+ LastBinaryOperator = 72,
+ FirstNode = 149,
+ FirstJSDocNode = 289,
+ LastJSDocNode = 311,
+ FirstJSDocTagNode = 300,
+ LastJSDocTagNode = 311,
}
enum NodeFlags {
None = 0,
@@ -3159,7 +3161,7 @@ declare namespace ts {
reScanJsxToken(): JsxTokenSyntaxKind;
reScanLessThanToken(): SyntaxKind;
scanJsxToken(): JsxTokenSyntaxKind;
- scanJSDocToken(): JsDocSyntaxKind;
+ scanJsDocToken(): JSDocSyntaxKind;
scan(): SyntaxKind;
getText(): string;
setText(text: string | undefined, start?: number, length?: number): void;
diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts
index 51c10fdf1956e..7ce9636f8373c 100644
--- a/tests/baselines/reference/api/typescript.d.ts
+++ b/tests/baselines/reference/api/typescript.d.ts
@@ -72,7 +72,7 @@ declare namespace ts {
pos: number;
end: number;
}
- type JsDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.NoSubstitutionTemplateLiteral | SyntaxKind.Unknown | KeywordSyntaxKind;
+ type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword;
type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
enum SyntaxKind {
@@ -135,281 +135,283 @@ declare namespace ts {
QuestionToken = 56,
ColonToken = 57,
AtToken = 58,
- EqualsToken = 59,
- PlusEqualsToken = 60,
- MinusEqualsToken = 61,
- AsteriskEqualsToken = 62,
- AsteriskAsteriskEqualsToken = 63,
- SlashEqualsToken = 64,
- PercentEqualsToken = 65,
- LessThanLessThanEqualsToken = 66,
- GreaterThanGreaterThanEqualsToken = 67,
- GreaterThanGreaterThanGreaterThanEqualsToken = 68,
- AmpersandEqualsToken = 69,
- BarEqualsToken = 70,
- CaretEqualsToken = 71,
- Identifier = 72,
- BreakKeyword = 73,
- CaseKeyword = 74,
- CatchKeyword = 75,
- ClassKeyword = 76,
- ConstKeyword = 77,
- ContinueKeyword = 78,
- DebuggerKeyword = 79,
- DefaultKeyword = 80,
- DeleteKeyword = 81,
- DoKeyword = 82,
- ElseKeyword = 83,
- EnumKeyword = 84,
- ExportKeyword = 85,
- ExtendsKeyword = 86,
- FalseKeyword = 87,
- FinallyKeyword = 88,
- ForKeyword = 89,
- FunctionKeyword = 90,
- IfKeyword = 91,
- ImportKeyword = 92,
- InKeyword = 93,
- InstanceOfKeyword = 94,
- NewKeyword = 95,
- NullKeyword = 96,
- ReturnKeyword = 97,
- SuperKeyword = 98,
- SwitchKeyword = 99,
- ThisKeyword = 100,
- ThrowKeyword = 101,
- TrueKeyword = 102,
- TryKeyword = 103,
- TypeOfKeyword = 104,
- VarKeyword = 105,
- VoidKeyword = 106,
- WhileKeyword = 107,
- WithKeyword = 108,
- ImplementsKeyword = 109,
- InterfaceKeyword = 110,
- LetKeyword = 111,
- PackageKeyword = 112,
- PrivateKeyword = 113,
- ProtectedKeyword = 114,
- PublicKeyword = 115,
- StaticKeyword = 116,
- YieldKeyword = 117,
- AbstractKeyword = 118,
- AsKeyword = 119,
- AnyKeyword = 120,
- AsyncKeyword = 121,
- AwaitKeyword = 122,
- BooleanKeyword = 123,
- ConstructorKeyword = 124,
- DeclareKeyword = 125,
- GetKeyword = 126,
- InferKeyword = 127,
- IsKeyword = 128,
- KeyOfKeyword = 129,
- ModuleKeyword = 130,
- NamespaceKeyword = 131,
- NeverKeyword = 132,
- ReadonlyKeyword = 133,
- RequireKeyword = 134,
- NumberKeyword = 135,
- ObjectKeyword = 136,
- SetKeyword = 137,
- StringKeyword = 138,
- SymbolKeyword = 139,
- TypeKeyword = 140,
- UndefinedKeyword = 141,
- UniqueKeyword = 142,
- UnknownKeyword = 143,
- FromKeyword = 144,
- GlobalKeyword = 145,
- BigIntKeyword = 146,
- OfKeyword = 147,
- QualifiedName = 148,
- ComputedPropertyName = 149,
- TypeParameter = 150,
- Parameter = 151,
- Decorator = 152,
- PropertySignature = 153,
- PropertyDeclaration = 154,
- MethodSignature = 155,
- MethodDeclaration = 156,
- Constructor = 157,
- GetAccessor = 158,
- SetAccessor = 159,
- CallSignature = 160,
- ConstructSignature = 161,
- IndexSignature = 162,
- TypePredicate = 163,
- TypeReference = 164,
- FunctionType = 165,
- ConstructorType = 166,
- TypeQuery = 167,
- TypeLiteral = 168,
- ArrayType = 169,
- TupleType = 170,
- OptionalType = 171,
- RestType = 172,
- UnionType = 173,
- IntersectionType = 174,
- ConditionalType = 175,
- InferType = 176,
- ParenthesizedType = 177,
- ThisType = 178,
- TypeOperator = 179,
- IndexedAccessType = 180,
- MappedType = 181,
- LiteralType = 182,
- ImportType = 183,
- ObjectBindingPattern = 184,
- ArrayBindingPattern = 185,
- BindingElement = 186,
- ArrayLiteralExpression = 187,
- ObjectLiteralExpression = 188,
- PropertyAccessExpression = 189,
- ElementAccessExpression = 190,
- CallExpression = 191,
- NewExpression = 192,
- TaggedTemplateExpression = 193,
- TypeAssertionExpression = 194,
- ParenthesizedExpression = 195,
- FunctionExpression = 196,
- ArrowFunction = 197,
- DeleteExpression = 198,
- TypeOfExpression = 199,
- VoidExpression = 200,
- AwaitExpression = 201,
- PrefixUnaryExpression = 202,
- PostfixUnaryExpression = 203,
- BinaryExpression = 204,
- ConditionalExpression = 205,
- TemplateExpression = 206,
- YieldExpression = 207,
- SpreadElement = 208,
- ClassExpression = 209,
- OmittedExpression = 210,
- ExpressionWithTypeArguments = 211,
- AsExpression = 212,
- NonNullExpression = 213,
- MetaProperty = 214,
- SyntheticExpression = 215,
- TemplateSpan = 216,
- SemicolonClassElement = 217,
- Block = 218,
- VariableStatement = 219,
- EmptyStatement = 220,
- ExpressionStatement = 221,
- IfStatement = 222,
- DoStatement = 223,
- WhileStatement = 224,
- ForStatement = 225,
- ForInStatement = 226,
- ForOfStatement = 227,
- ContinueStatement = 228,
- BreakStatement = 229,
- ReturnStatement = 230,
- WithStatement = 231,
- SwitchStatement = 232,
- LabeledStatement = 233,
- ThrowStatement = 234,
- TryStatement = 235,
- DebuggerStatement = 236,
- VariableDeclaration = 237,
- VariableDeclarationList = 238,
- FunctionDeclaration = 239,
- ClassDeclaration = 240,
- InterfaceDeclaration = 241,
- TypeAliasDeclaration = 242,
- EnumDeclaration = 243,
- ModuleDeclaration = 244,
- ModuleBlock = 245,
- CaseBlock = 246,
- NamespaceExportDeclaration = 247,
- ImportEqualsDeclaration = 248,
- ImportDeclaration = 249,
- ImportClause = 250,
- NamespaceImport = 251,
- NamedImports = 252,
- ImportSpecifier = 253,
- ExportAssignment = 254,
- ExportDeclaration = 255,
- NamedExports = 256,
- ExportSpecifier = 257,
- MissingDeclaration = 258,
- ExternalModuleReference = 259,
- JsxElement = 260,
- JsxSelfClosingElement = 261,
- JsxOpeningElement = 262,
- JsxClosingElement = 263,
- JsxFragment = 264,
- JsxOpeningFragment = 265,
- JsxClosingFragment = 266,
- JsxAttribute = 267,
- JsxAttributes = 268,
- JsxSpreadAttribute = 269,
- JsxExpression = 270,
- CaseClause = 271,
- DefaultClause = 272,
- HeritageClause = 273,
- CatchClause = 274,
- PropertyAssignment = 275,
- ShorthandPropertyAssignment = 276,
- SpreadAssignment = 277,
- EnumMember = 278,
- UnparsedPrologue = 279,
- UnparsedPrepend = 280,
- UnparsedText = 281,
- UnparsedInternalText = 282,
- UnparsedSyntheticReference = 283,
- SourceFile = 284,
- Bundle = 285,
- UnparsedSource = 286,
- InputFiles = 287,
- JSDocTypeExpression = 288,
- JSDocAllType = 289,
- JSDocUnknownType = 290,
- JSDocNullableType = 291,
- JSDocNonNullableType = 292,
- JSDocOptionalType = 293,
- JSDocFunctionType = 294,
- JSDocVariadicType = 295,
- JSDocComment = 296,
- JSDocTypeLiteral = 297,
- JSDocSignature = 298,
- JSDocTag = 299,
- JSDocAugmentsTag = 300,
- JSDocClassTag = 301,
- JSDocCallbackTag = 302,
- JSDocEnumTag = 303,
- JSDocParameterTag = 304,
- JSDocReturnTag = 305,
- JSDocThisTag = 306,
- JSDocTypeTag = 307,
- JSDocTemplateTag = 308,
- JSDocTypedefTag = 309,
- JSDocPropertyTag = 310,
- SyntaxList = 311,
- NotEmittedStatement = 312,
- PartiallyEmittedExpression = 313,
- CommaListExpression = 314,
- MergeDeclarationMarker = 315,
- EndOfDeclarationMarker = 316,
- Count = 317,
- FirstAssignment = 59,
- LastAssignment = 71,
- FirstCompoundAssignment = 60,
- LastCompoundAssignment = 71,
- FirstReservedWord = 73,
- LastReservedWord = 108,
- FirstKeyword = 73,
- LastKeyword = 147,
- FirstFutureReservedWord = 109,
- LastFutureReservedWord = 117,
- FirstTypeNode = 163,
- LastTypeNode = 183,
+ /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */
+ BacktickToken = 59,
+ EqualsToken = 60,
+ PlusEqualsToken = 61,
+ MinusEqualsToken = 62,
+ AsteriskEqualsToken = 63,
+ AsteriskAsteriskEqualsToken = 64,
+ SlashEqualsToken = 65,
+ PercentEqualsToken = 66,
+ LessThanLessThanEqualsToken = 67,
+ GreaterThanGreaterThanEqualsToken = 68,
+ GreaterThanGreaterThanGreaterThanEqualsToken = 69,
+ AmpersandEqualsToken = 70,
+ BarEqualsToken = 71,
+ CaretEqualsToken = 72,
+ Identifier = 73,
+ BreakKeyword = 74,
+ CaseKeyword = 75,
+ CatchKeyword = 76,
+ ClassKeyword = 77,
+ ConstKeyword = 78,
+ ContinueKeyword = 79,
+ DebuggerKeyword = 80,
+ DefaultKeyword = 81,
+ DeleteKeyword = 82,
+ DoKeyword = 83,
+ ElseKeyword = 84,
+ EnumKeyword = 85,
+ ExportKeyword = 86,
+ ExtendsKeyword = 87,
+ FalseKeyword = 88,
+ FinallyKeyword = 89,
+ ForKeyword = 90,
+ FunctionKeyword = 91,
+ IfKeyword = 92,
+ ImportKeyword = 93,
+ InKeyword = 94,
+ InstanceOfKeyword = 95,
+ NewKeyword = 96,
+ NullKeyword = 97,
+ ReturnKeyword = 98,
+ SuperKeyword = 99,
+ SwitchKeyword = 100,
+ ThisKeyword = 101,
+ ThrowKeyword = 102,
+ TrueKeyword = 103,
+ TryKeyword = 104,
+ TypeOfKeyword = 105,
+ VarKeyword = 106,
+ VoidKeyword = 107,
+ WhileKeyword = 108,
+ WithKeyword = 109,
+ ImplementsKeyword = 110,
+ InterfaceKeyword = 111,
+ LetKeyword = 112,
+ PackageKeyword = 113,
+ PrivateKeyword = 114,
+ ProtectedKeyword = 115,
+ PublicKeyword = 116,
+ StaticKeyword = 117,
+ YieldKeyword = 118,
+ AbstractKeyword = 119,
+ AsKeyword = 120,
+ AnyKeyword = 121,
+ AsyncKeyword = 122,
+ AwaitKeyword = 123,
+ BooleanKeyword = 124,
+ ConstructorKeyword = 125,
+ DeclareKeyword = 126,
+ GetKeyword = 127,
+ InferKeyword = 128,
+ IsKeyword = 129,
+ KeyOfKeyword = 130,
+ ModuleKeyword = 131,
+ NamespaceKeyword = 132,
+ NeverKeyword = 133,
+ ReadonlyKeyword = 134,
+ RequireKeyword = 135,
+ NumberKeyword = 136,
+ ObjectKeyword = 137,
+ SetKeyword = 138,
+ StringKeyword = 139,
+ SymbolKeyword = 140,
+ TypeKeyword = 141,
+ UndefinedKeyword = 142,
+ UniqueKeyword = 143,
+ UnknownKeyword = 144,
+ FromKeyword = 145,
+ GlobalKeyword = 146,
+ BigIntKeyword = 147,
+ OfKeyword = 148,
+ QualifiedName = 149,
+ ComputedPropertyName = 150,
+ TypeParameter = 151,
+ Parameter = 152,
+ Decorator = 153,
+ PropertySignature = 154,
+ PropertyDeclaration = 155,
+ MethodSignature = 156,
+ MethodDeclaration = 157,
+ Constructor = 158,
+ GetAccessor = 159,
+ SetAccessor = 160,
+ CallSignature = 161,
+ ConstructSignature = 162,
+ IndexSignature = 163,
+ TypePredicate = 164,
+ TypeReference = 165,
+ FunctionType = 166,
+ ConstructorType = 167,
+ TypeQuery = 168,
+ TypeLiteral = 169,
+ ArrayType = 170,
+ TupleType = 171,
+ OptionalType = 172,
+ RestType = 173,
+ UnionType = 174,
+ IntersectionType = 175,
+ ConditionalType = 176,
+ InferType = 177,
+ ParenthesizedType = 178,
+ ThisType = 179,
+ TypeOperator = 180,
+ IndexedAccessType = 181,
+ MappedType = 182,
+ LiteralType = 183,
+ ImportType = 184,
+ ObjectBindingPattern = 185,
+ ArrayBindingPattern = 186,
+ BindingElement = 187,
+ ArrayLiteralExpression = 188,
+ ObjectLiteralExpression = 189,
+ PropertyAccessExpression = 190,
+ ElementAccessExpression = 191,
+ CallExpression = 192,
+ NewExpression = 193,
+ TaggedTemplateExpression = 194,
+ TypeAssertionExpression = 195,
+ ParenthesizedExpression = 196,
+ FunctionExpression = 197,
+ ArrowFunction = 198,
+ DeleteExpression = 199,
+ TypeOfExpression = 200,
+ VoidExpression = 201,
+ AwaitExpression = 202,
+ PrefixUnaryExpression = 203,
+ PostfixUnaryExpression = 204,
+ BinaryExpression = 205,
+ ConditionalExpression = 206,
+ TemplateExpression = 207,
+ YieldExpression = 208,
+ SpreadElement = 209,
+ ClassExpression = 210,
+ OmittedExpression = 211,
+ ExpressionWithTypeArguments = 212,
+ AsExpression = 213,
+ NonNullExpression = 214,
+ MetaProperty = 215,
+ SyntheticExpression = 216,
+ TemplateSpan = 217,
+ SemicolonClassElement = 218,
+ Block = 219,
+ VariableStatement = 220,
+ EmptyStatement = 221,
+ ExpressionStatement = 222,
+ IfStatement = 223,
+ DoStatement = 224,
+ WhileStatement = 225,
+ ForStatement = 226,
+ ForInStatement = 227,
+ ForOfStatement = 228,
+ ContinueStatement = 229,
+ BreakStatement = 230,
+ ReturnStatement = 231,
+ WithStatement = 232,
+ SwitchStatement = 233,
+ LabeledStatement = 234,
+ ThrowStatement = 235,
+ TryStatement = 236,
+ DebuggerStatement = 237,
+ VariableDeclaration = 238,
+ VariableDeclarationList = 239,
+ FunctionDeclaration = 240,
+ ClassDeclaration = 241,
+ InterfaceDeclaration = 242,
+ TypeAliasDeclaration = 243,
+ EnumDeclaration = 244,
+ ModuleDeclaration = 245,
+ ModuleBlock = 246,
+ CaseBlock = 247,
+ NamespaceExportDeclaration = 248,
+ ImportEqualsDeclaration = 249,
+ ImportDeclaration = 250,
+ ImportClause = 251,
+ NamespaceImport = 252,
+ NamedImports = 253,
+ ImportSpecifier = 254,
+ ExportAssignment = 255,
+ ExportDeclaration = 256,
+ NamedExports = 257,
+ ExportSpecifier = 258,
+ MissingDeclaration = 259,
+ ExternalModuleReference = 260,
+ JsxElement = 261,
+ JsxSelfClosingElement = 262,
+ JsxOpeningElement = 263,
+ JsxClosingElement = 264,
+ JsxFragment = 265,
+ JsxOpeningFragment = 266,
+ JsxClosingFragment = 267,
+ JsxAttribute = 268,
+ JsxAttributes = 269,
+ JsxSpreadAttribute = 270,
+ JsxExpression = 271,
+ CaseClause = 272,
+ DefaultClause = 273,
+ HeritageClause = 274,
+ CatchClause = 275,
+ PropertyAssignment = 276,
+ ShorthandPropertyAssignment = 277,
+ SpreadAssignment = 278,
+ EnumMember = 279,
+ UnparsedPrologue = 280,
+ UnparsedPrepend = 281,
+ UnparsedText = 282,
+ UnparsedInternalText = 283,
+ UnparsedSyntheticReference = 284,
+ SourceFile = 285,
+ Bundle = 286,
+ UnparsedSource = 287,
+ InputFiles = 288,
+ JSDocTypeExpression = 289,
+ JSDocAllType = 290,
+ JSDocUnknownType = 291,
+ JSDocNullableType = 292,
+ JSDocNonNullableType = 293,
+ JSDocOptionalType = 294,
+ JSDocFunctionType = 295,
+ JSDocVariadicType = 296,
+ JSDocComment = 297,
+ JSDocTypeLiteral = 298,
+ JSDocSignature = 299,
+ JSDocTag = 300,
+ JSDocAugmentsTag = 301,
+ JSDocClassTag = 302,
+ JSDocCallbackTag = 303,
+ JSDocEnumTag = 304,
+ JSDocParameterTag = 305,
+ JSDocReturnTag = 306,
+ JSDocThisTag = 307,
+ JSDocTypeTag = 308,
+ JSDocTemplateTag = 309,
+ JSDocTypedefTag = 310,
+ JSDocPropertyTag = 311,
+ SyntaxList = 312,
+ NotEmittedStatement = 313,
+ PartiallyEmittedExpression = 314,
+ CommaListExpression = 315,
+ MergeDeclarationMarker = 316,
+ EndOfDeclarationMarker = 317,
+ Count = 318,
+ FirstAssignment = 60,
+ LastAssignment = 72,
+ FirstCompoundAssignment = 61,
+ LastCompoundAssignment = 72,
+ FirstReservedWord = 74,
+ LastReservedWord = 109,
+ FirstKeyword = 74,
+ LastKeyword = 148,
+ FirstFutureReservedWord = 110,
+ LastFutureReservedWord = 118,
+ FirstTypeNode = 164,
+ LastTypeNode = 184,
FirstPunctuation = 18,
- LastPunctuation = 71,
+ LastPunctuation = 72,
FirstToken = 0,
- LastToken = 147,
+ LastToken = 148,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -417,12 +419,12 @@ declare namespace ts {
FirstTemplateToken = 14,
LastTemplateToken = 17,
FirstBinaryOperator = 28,
- LastBinaryOperator = 71,
- FirstNode = 148,
- FirstJSDocNode = 288,
- LastJSDocNode = 310,
- FirstJSDocTagNode = 299,
- LastJSDocTagNode = 310,
+ LastBinaryOperator = 72,
+ FirstNode = 149,
+ FirstJSDocNode = 289,
+ LastJSDocNode = 311,
+ FirstJSDocTagNode = 300,
+ LastJSDocTagNode = 311,
}
enum NodeFlags {
None = 0,
@@ -3159,7 +3161,7 @@ declare namespace ts {
reScanJsxToken(): JsxTokenSyntaxKind;
reScanLessThanToken(): SyntaxKind;
scanJsxToken(): JsxTokenSyntaxKind;
- scanJSDocToken(): JsDocSyntaxKind;
+ scanJsDocToken(): JSDocSyntaxKind;
scan(): SyntaxKind;
getText(): string;
setText(text: string | undefined, start?: number, length?: number): void;