FIN INIT
This commit is contained in:
31
node_modules/sucrase/dist/esm/parser/index.js
generated
vendored
Normal file
31
node_modules/sucrase/dist/esm/parser/index.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
import {augmentError, initParser, state} from "./traverser/base";
|
||||
import {parseFile} from "./traverser/index";
|
||||
|
||||
export class File {
|
||||
|
||||
|
||||
|
||||
constructor(tokens, scopes) {
|
||||
this.tokens = tokens;
|
||||
this.scopes = scopes;
|
||||
}
|
||||
}
|
||||
|
||||
export function parse(
|
||||
input,
|
||||
isJSXEnabled,
|
||||
isTypeScriptEnabled,
|
||||
isFlowEnabled,
|
||||
) {
|
||||
if (isFlowEnabled && isTypeScriptEnabled) {
|
||||
throw new Error("Cannot combine flow and typescript plugins.");
|
||||
}
|
||||
initParser(input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled);
|
||||
const result = parseFile();
|
||||
if (state.error) {
|
||||
throw augmentError(state.error);
|
||||
}
|
||||
return result;
|
||||
}
|
1105
node_modules/sucrase/dist/esm/parser/plugins/flow.js
generated
vendored
Normal file
1105
node_modules/sucrase/dist/esm/parser/plugins/flow.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
367
node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js
generated
vendored
Normal file
367
node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js
generated
vendored
Normal file
@ -0,0 +1,367 @@
|
||||
import {
|
||||
eat,
|
||||
finishToken,
|
||||
getTokenFromCode,
|
||||
IdentifierRole,
|
||||
JSXRole,
|
||||
match,
|
||||
next,
|
||||
skipSpace,
|
||||
Token,
|
||||
} from "../../tokenizer/index";
|
||||
import {TokenType as tt} from "../../tokenizer/types";
|
||||
import {input, isTypeScriptEnabled, state} from "../../traverser/base";
|
||||
import {parseExpression, parseMaybeAssign} from "../../traverser/expression";
|
||||
import {expect, unexpected} from "../../traverser/util";
|
||||
import {charCodes} from "../../util/charcodes";
|
||||
import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../../util/identifier";
|
||||
import {tsTryParseJSXTypeArgument} from "../typescript";
|
||||
|
||||
/**
|
||||
* Read token with JSX contents.
|
||||
*
|
||||
* In addition to detecting jsxTagStart and also regular tokens that might be
|
||||
* part of an expression, this code detects the start and end of text ranges
|
||||
* within JSX children. In order to properly count the number of children, we
|
||||
* distinguish jsxText from jsxEmptyText, which is a text range that simplifies
|
||||
* to the empty string after JSX whitespace trimming.
|
||||
*
|
||||
* It turns out that a JSX text range will simplify to the empty string if and
|
||||
* only if both of these conditions hold:
|
||||
* - The range consists entirely of whitespace characters (only counting space,
|
||||
* tab, \r, and \n).
|
||||
* - The range has at least one newline.
|
||||
* This can be proven by analyzing any implementation of whitespace trimming,
|
||||
* e.g. formatJSXTextLiteral in Sucrase or cleanJSXElementLiteralChild in Babel.
|
||||
*/
|
||||
function jsxReadToken() {
|
||||
let sawNewline = false;
|
||||
let sawNonWhitespace = false;
|
||||
while (true) {
|
||||
if (state.pos >= input.length) {
|
||||
unexpected("Unterminated JSX contents");
|
||||
return;
|
||||
}
|
||||
|
||||
const ch = input.charCodeAt(state.pos);
|
||||
if (ch === charCodes.lessThan || ch === charCodes.leftCurlyBrace) {
|
||||
if (state.pos === state.start) {
|
||||
if (ch === charCodes.lessThan) {
|
||||
state.pos++;
|
||||
finishToken(tt.jsxTagStart);
|
||||
return;
|
||||
}
|
||||
getTokenFromCode(ch);
|
||||
return;
|
||||
}
|
||||
if (sawNewline && !sawNonWhitespace) {
|
||||
finishToken(tt.jsxEmptyText);
|
||||
} else {
|
||||
finishToken(tt.jsxText);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// This is part of JSX text.
|
||||
if (ch === charCodes.lineFeed) {
|
||||
sawNewline = true;
|
||||
} else if (ch !== charCodes.space && ch !== charCodes.carriageReturn && ch !== charCodes.tab) {
|
||||
sawNonWhitespace = true;
|
||||
}
|
||||
state.pos++;
|
||||
}
|
||||
}
|
||||
|
||||
function jsxReadString(quote) {
|
||||
state.pos++;
|
||||
for (;;) {
|
||||
if (state.pos >= input.length) {
|
||||
unexpected("Unterminated string constant");
|
||||
return;
|
||||
}
|
||||
|
||||
const ch = input.charCodeAt(state.pos);
|
||||
if (ch === quote) {
|
||||
state.pos++;
|
||||
break;
|
||||
}
|
||||
state.pos++;
|
||||
}
|
||||
finishToken(tt.string);
|
||||
}
|
||||
|
||||
// Read a JSX identifier (valid tag or attribute name).
|
||||
//
|
||||
// Optimized version since JSX identifiers can't contain
|
||||
// escape characters and so can be read as single slice.
|
||||
// Also assumes that first character was already checked
|
||||
// by isIdentifierStart in readToken.
|
||||
|
||||
function jsxReadWord() {
|
||||
let ch;
|
||||
do {
|
||||
if (state.pos > input.length) {
|
||||
unexpected("Unexpectedly reached the end of input.");
|
||||
return;
|
||||
}
|
||||
ch = input.charCodeAt(++state.pos);
|
||||
} while (IS_IDENTIFIER_CHAR[ch] || ch === charCodes.dash);
|
||||
finishToken(tt.jsxName);
|
||||
}
|
||||
|
||||
// Parse next token as JSX identifier
|
||||
function jsxParseIdentifier() {
|
||||
nextJSXTagToken();
|
||||
}
|
||||
|
||||
// Parse namespaced identifier.
|
||||
function jsxParseNamespacedName(identifierRole) {
|
||||
jsxParseIdentifier();
|
||||
if (!eat(tt.colon)) {
|
||||
// Plain identifier, so this is an access.
|
||||
state.tokens[state.tokens.length - 1].identifierRole = identifierRole;
|
||||
return;
|
||||
}
|
||||
// Process the second half of the namespaced name.
|
||||
jsxParseIdentifier();
|
||||
}
|
||||
|
||||
// Parses element name in any form - namespaced, member
|
||||
// or single identifier.
|
||||
function jsxParseElementName() {
|
||||
const firstTokenIndex = state.tokens.length;
|
||||
jsxParseNamespacedName(IdentifierRole.Access);
|
||||
let hadDot = false;
|
||||
while (match(tt.dot)) {
|
||||
hadDot = true;
|
||||
nextJSXTagToken();
|
||||
jsxParseIdentifier();
|
||||
}
|
||||
// For tags like <div> with a lowercase letter and no dots, the name is
|
||||
// actually *not* an identifier access, since it's referring to a built-in
|
||||
// tag name. Remove the identifier role in this case so that it's not
|
||||
// accidentally transformed by the imports transform when preserving JSX.
|
||||
if (!hadDot) {
|
||||
const firstToken = state.tokens[firstTokenIndex];
|
||||
const firstChar = input.charCodeAt(firstToken.start);
|
||||
if (firstChar >= charCodes.lowercaseA && firstChar <= charCodes.lowercaseZ) {
|
||||
firstToken.identifierRole = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Parses any type of JSX attribute value.
|
||||
function jsxParseAttributeValue() {
|
||||
switch (state.type) {
|
||||
case tt.braceL:
|
||||
next();
|
||||
parseExpression();
|
||||
nextJSXTagToken();
|
||||
return;
|
||||
|
||||
case tt.jsxTagStart:
|
||||
jsxParseElement();
|
||||
nextJSXTagToken();
|
||||
return;
|
||||
|
||||
case tt.string:
|
||||
nextJSXTagToken();
|
||||
return;
|
||||
|
||||
default:
|
||||
unexpected("JSX value should be either an expression or a quoted JSX text");
|
||||
}
|
||||
}
|
||||
|
||||
// Parse JSX spread child, after already processing the {
|
||||
// Does not parse the closing }
|
||||
function jsxParseSpreadChild() {
|
||||
expect(tt.ellipsis);
|
||||
parseExpression();
|
||||
}
|
||||
|
||||
// Parses JSX opening tag starting after "<".
|
||||
// Returns true if the tag was self-closing.
|
||||
// Does not parse the last token.
|
||||
function jsxParseOpeningElement(initialTokenIndex) {
|
||||
if (match(tt.jsxTagEnd)) {
|
||||
// This is an open-fragment.
|
||||
return false;
|
||||
}
|
||||
jsxParseElementName();
|
||||
if (isTypeScriptEnabled) {
|
||||
tsTryParseJSXTypeArgument();
|
||||
}
|
||||
let hasSeenPropSpread = false;
|
||||
while (!match(tt.slash) && !match(tt.jsxTagEnd) && !state.error) {
|
||||
if (eat(tt.braceL)) {
|
||||
hasSeenPropSpread = true;
|
||||
expect(tt.ellipsis);
|
||||
parseMaybeAssign();
|
||||
// }
|
||||
nextJSXTagToken();
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
hasSeenPropSpread &&
|
||||
state.end - state.start === 3 &&
|
||||
input.charCodeAt(state.start) === charCodes.lowercaseK &&
|
||||
input.charCodeAt(state.start + 1) === charCodes.lowercaseE &&
|
||||
input.charCodeAt(state.start + 2) === charCodes.lowercaseY
|
||||
) {
|
||||
state.tokens[initialTokenIndex].jsxRole = JSXRole.KeyAfterPropSpread;
|
||||
}
|
||||
jsxParseNamespacedName(IdentifierRole.ObjectKey);
|
||||
if (match(tt.eq)) {
|
||||
nextJSXTagToken();
|
||||
jsxParseAttributeValue();
|
||||
}
|
||||
}
|
||||
const isSelfClosing = match(tt.slash);
|
||||
if (isSelfClosing) {
|
||||
// /
|
||||
nextJSXTagToken();
|
||||
}
|
||||
return isSelfClosing;
|
||||
}
|
||||
|
||||
// Parses JSX closing tag starting after "</".
|
||||
// Does not parse the last token.
|
||||
function jsxParseClosingElement() {
|
||||
if (match(tt.jsxTagEnd)) {
|
||||
// Fragment syntax, so we immediately have a tag end.
|
||||
return;
|
||||
}
|
||||
jsxParseElementName();
|
||||
}
|
||||
|
||||
// Parses entire JSX element, including its opening tag
|
||||
// (starting after "<"), attributes, contents and closing tag.
|
||||
// Does not parse the last token.
|
||||
function jsxParseElementAt() {
|
||||
const initialTokenIndex = state.tokens.length - 1;
|
||||
state.tokens[initialTokenIndex].jsxRole = JSXRole.NoChildren;
|
||||
let numExplicitChildren = 0;
|
||||
const isSelfClosing = jsxParseOpeningElement(initialTokenIndex);
|
||||
if (!isSelfClosing) {
|
||||
nextJSXExprToken();
|
||||
while (true) {
|
||||
switch (state.type) {
|
||||
case tt.jsxTagStart:
|
||||
nextJSXTagToken();
|
||||
if (match(tt.slash)) {
|
||||
nextJSXTagToken();
|
||||
jsxParseClosingElement();
|
||||
// Key after prop spread takes precedence over number of children,
|
||||
// since it means we switch to createElement, which doesn't care
|
||||
// about number of children.
|
||||
if (state.tokens[initialTokenIndex].jsxRole !== JSXRole.KeyAfterPropSpread) {
|
||||
if (numExplicitChildren === 1) {
|
||||
state.tokens[initialTokenIndex].jsxRole = JSXRole.OneChild;
|
||||
} else if (numExplicitChildren > 1) {
|
||||
state.tokens[initialTokenIndex].jsxRole = JSXRole.StaticChildren;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
numExplicitChildren++;
|
||||
jsxParseElementAt();
|
||||
nextJSXExprToken();
|
||||
break;
|
||||
|
||||
case tt.jsxText:
|
||||
numExplicitChildren++;
|
||||
nextJSXExprToken();
|
||||
break;
|
||||
|
||||
case tt.jsxEmptyText:
|
||||
nextJSXExprToken();
|
||||
break;
|
||||
|
||||
case tt.braceL:
|
||||
next();
|
||||
if (match(tt.ellipsis)) {
|
||||
jsxParseSpreadChild();
|
||||
nextJSXExprToken();
|
||||
// Spread children are a mechanism to explicitly mark children as
|
||||
// static, so count it as 2 children to satisfy the "more than one
|
||||
// child" condition.
|
||||
numExplicitChildren += 2;
|
||||
} else {
|
||||
// If we see {}, this is an empty pseudo-expression that doesn't
|
||||
// count as a child.
|
||||
if (!match(tt.braceR)) {
|
||||
numExplicitChildren++;
|
||||
parseExpression();
|
||||
}
|
||||
nextJSXExprToken();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// istanbul ignore next - should never happen
|
||||
default:
|
||||
unexpected();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Parses entire JSX element from current position.
|
||||
// Does not parse the last token.
|
||||
export function jsxParseElement() {
|
||||
nextJSXTagToken();
|
||||
jsxParseElementAt();
|
||||
}
|
||||
|
||||
// ==================================
|
||||
// Overrides
|
||||
// ==================================
|
||||
|
||||
export function nextJSXTagToken() {
|
||||
state.tokens.push(new Token());
|
||||
skipSpace();
|
||||
state.start = state.pos;
|
||||
const code = input.charCodeAt(state.pos);
|
||||
|
||||
if (IS_IDENTIFIER_START[code]) {
|
||||
jsxReadWord();
|
||||
} else if (code === charCodes.quotationMark || code === charCodes.apostrophe) {
|
||||
jsxReadString(code);
|
||||
} else {
|
||||
// The following tokens are just one character each.
|
||||
++state.pos;
|
||||
switch (code) {
|
||||
case charCodes.greaterThan:
|
||||
finishToken(tt.jsxTagEnd);
|
||||
break;
|
||||
case charCodes.lessThan:
|
||||
finishToken(tt.jsxTagStart);
|
||||
break;
|
||||
case charCodes.slash:
|
||||
finishToken(tt.slash);
|
||||
break;
|
||||
case charCodes.equalsTo:
|
||||
finishToken(tt.eq);
|
||||
break;
|
||||
case charCodes.leftCurlyBrace:
|
||||
finishToken(tt.braceL);
|
||||
break;
|
||||
case charCodes.dot:
|
||||
finishToken(tt.dot);
|
||||
break;
|
||||
case charCodes.colon:
|
||||
finishToken(tt.colon);
|
||||
break;
|
||||
default:
|
||||
unexpected();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function nextJSXExprToken() {
|
||||
state.tokens.push(new Token());
|
||||
state.start = state.pos;
|
||||
jsxReadToken();
|
||||
}
|
256
node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js
generated
vendored
Normal file
256
node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js
generated
vendored
Normal file
@ -0,0 +1,256 @@
|
||||
// Use a Map rather than object to avoid unexpected __proto__ access.
|
||||
export default new Map([
|
||||
["quot", "\u0022"],
|
||||
["amp", "&"],
|
||||
["apos", "\u0027"],
|
||||
["lt", "<"],
|
||||
["gt", ">"],
|
||||
["nbsp", "\u00A0"],
|
||||
["iexcl", "\u00A1"],
|
||||
["cent", "\u00A2"],
|
||||
["pound", "\u00A3"],
|
||||
["curren", "\u00A4"],
|
||||
["yen", "\u00A5"],
|
||||
["brvbar", "\u00A6"],
|
||||
["sect", "\u00A7"],
|
||||
["uml", "\u00A8"],
|
||||
["copy", "\u00A9"],
|
||||
["ordf", "\u00AA"],
|
||||
["laquo", "\u00AB"],
|
||||
["not", "\u00AC"],
|
||||
["shy", "\u00AD"],
|
||||
["reg", "\u00AE"],
|
||||
["macr", "\u00AF"],
|
||||
["deg", "\u00B0"],
|
||||
["plusmn", "\u00B1"],
|
||||
["sup2", "\u00B2"],
|
||||
["sup3", "\u00B3"],
|
||||
["acute", "\u00B4"],
|
||||
["micro", "\u00B5"],
|
||||
["para", "\u00B6"],
|
||||
["middot", "\u00B7"],
|
||||
["cedil", "\u00B8"],
|
||||
["sup1", "\u00B9"],
|
||||
["ordm", "\u00BA"],
|
||||
["raquo", "\u00BB"],
|
||||
["frac14", "\u00BC"],
|
||||
["frac12", "\u00BD"],
|
||||
["frac34", "\u00BE"],
|
||||
["iquest", "\u00BF"],
|
||||
["Agrave", "\u00C0"],
|
||||
["Aacute", "\u00C1"],
|
||||
["Acirc", "\u00C2"],
|
||||
["Atilde", "\u00C3"],
|
||||
["Auml", "\u00C4"],
|
||||
["Aring", "\u00C5"],
|
||||
["AElig", "\u00C6"],
|
||||
["Ccedil", "\u00C7"],
|
||||
["Egrave", "\u00C8"],
|
||||
["Eacute", "\u00C9"],
|
||||
["Ecirc", "\u00CA"],
|
||||
["Euml", "\u00CB"],
|
||||
["Igrave", "\u00CC"],
|
||||
["Iacute", "\u00CD"],
|
||||
["Icirc", "\u00CE"],
|
||||
["Iuml", "\u00CF"],
|
||||
["ETH", "\u00D0"],
|
||||
["Ntilde", "\u00D1"],
|
||||
["Ograve", "\u00D2"],
|
||||
["Oacute", "\u00D3"],
|
||||
["Ocirc", "\u00D4"],
|
||||
["Otilde", "\u00D5"],
|
||||
["Ouml", "\u00D6"],
|
||||
["times", "\u00D7"],
|
||||
["Oslash", "\u00D8"],
|
||||
["Ugrave", "\u00D9"],
|
||||
["Uacute", "\u00DA"],
|
||||
["Ucirc", "\u00DB"],
|
||||
["Uuml", "\u00DC"],
|
||||
["Yacute", "\u00DD"],
|
||||
["THORN", "\u00DE"],
|
||||
["szlig", "\u00DF"],
|
||||
["agrave", "\u00E0"],
|
||||
["aacute", "\u00E1"],
|
||||
["acirc", "\u00E2"],
|
||||
["atilde", "\u00E3"],
|
||||
["auml", "\u00E4"],
|
||||
["aring", "\u00E5"],
|
||||
["aelig", "\u00E6"],
|
||||
["ccedil", "\u00E7"],
|
||||
["egrave", "\u00E8"],
|
||||
["eacute", "\u00E9"],
|
||||
["ecirc", "\u00EA"],
|
||||
["euml", "\u00EB"],
|
||||
["igrave", "\u00EC"],
|
||||
["iacute", "\u00ED"],
|
||||
["icirc", "\u00EE"],
|
||||
["iuml", "\u00EF"],
|
||||
["eth", "\u00F0"],
|
||||
["ntilde", "\u00F1"],
|
||||
["ograve", "\u00F2"],
|
||||
["oacute", "\u00F3"],
|
||||
["ocirc", "\u00F4"],
|
||||
["otilde", "\u00F5"],
|
||||
["ouml", "\u00F6"],
|
||||
["divide", "\u00F7"],
|
||||
["oslash", "\u00F8"],
|
||||
["ugrave", "\u00F9"],
|
||||
["uacute", "\u00FA"],
|
||||
["ucirc", "\u00FB"],
|
||||
["uuml", "\u00FC"],
|
||||
["yacute", "\u00FD"],
|
||||
["thorn", "\u00FE"],
|
||||
["yuml", "\u00FF"],
|
||||
["OElig", "\u0152"],
|
||||
["oelig", "\u0153"],
|
||||
["Scaron", "\u0160"],
|
||||
["scaron", "\u0161"],
|
||||
["Yuml", "\u0178"],
|
||||
["fnof", "\u0192"],
|
||||
["circ", "\u02C6"],
|
||||
["tilde", "\u02DC"],
|
||||
["Alpha", "\u0391"],
|
||||
["Beta", "\u0392"],
|
||||
["Gamma", "\u0393"],
|
||||
["Delta", "\u0394"],
|
||||
["Epsilon", "\u0395"],
|
||||
["Zeta", "\u0396"],
|
||||
["Eta", "\u0397"],
|
||||
["Theta", "\u0398"],
|
||||
["Iota", "\u0399"],
|
||||
["Kappa", "\u039A"],
|
||||
["Lambda", "\u039B"],
|
||||
["Mu", "\u039C"],
|
||||
["Nu", "\u039D"],
|
||||
["Xi", "\u039E"],
|
||||
["Omicron", "\u039F"],
|
||||
["Pi", "\u03A0"],
|
||||
["Rho", "\u03A1"],
|
||||
["Sigma", "\u03A3"],
|
||||
["Tau", "\u03A4"],
|
||||
["Upsilon", "\u03A5"],
|
||||
["Phi", "\u03A6"],
|
||||
["Chi", "\u03A7"],
|
||||
["Psi", "\u03A8"],
|
||||
["Omega", "\u03A9"],
|
||||
["alpha", "\u03B1"],
|
||||
["beta", "\u03B2"],
|
||||
["gamma", "\u03B3"],
|
||||
["delta", "\u03B4"],
|
||||
["epsilon", "\u03B5"],
|
||||
["zeta", "\u03B6"],
|
||||
["eta", "\u03B7"],
|
||||
["theta", "\u03B8"],
|
||||
["iota", "\u03B9"],
|
||||
["kappa", "\u03BA"],
|
||||
["lambda", "\u03BB"],
|
||||
["mu", "\u03BC"],
|
||||
["nu", "\u03BD"],
|
||||
["xi", "\u03BE"],
|
||||
["omicron", "\u03BF"],
|
||||
["pi", "\u03C0"],
|
||||
["rho", "\u03C1"],
|
||||
["sigmaf", "\u03C2"],
|
||||
["sigma", "\u03C3"],
|
||||
["tau", "\u03C4"],
|
||||
["upsilon", "\u03C5"],
|
||||
["phi", "\u03C6"],
|
||||
["chi", "\u03C7"],
|
||||
["psi", "\u03C8"],
|
||||
["omega", "\u03C9"],
|
||||
["thetasym", "\u03D1"],
|
||||
["upsih", "\u03D2"],
|
||||
["piv", "\u03D6"],
|
||||
["ensp", "\u2002"],
|
||||
["emsp", "\u2003"],
|
||||
["thinsp", "\u2009"],
|
||||
["zwnj", "\u200C"],
|
||||
["zwj", "\u200D"],
|
||||
["lrm", "\u200E"],
|
||||
["rlm", "\u200F"],
|
||||
["ndash", "\u2013"],
|
||||
["mdash", "\u2014"],
|
||||
["lsquo", "\u2018"],
|
||||
["rsquo", "\u2019"],
|
||||
["sbquo", "\u201A"],
|
||||
["ldquo", "\u201C"],
|
||||
["rdquo", "\u201D"],
|
||||
["bdquo", "\u201E"],
|
||||
["dagger", "\u2020"],
|
||||
["Dagger", "\u2021"],
|
||||
["bull", "\u2022"],
|
||||
["hellip", "\u2026"],
|
||||
["permil", "\u2030"],
|
||||
["prime", "\u2032"],
|
||||
["Prime", "\u2033"],
|
||||
["lsaquo", "\u2039"],
|
||||
["rsaquo", "\u203A"],
|
||||
["oline", "\u203E"],
|
||||
["frasl", "\u2044"],
|
||||
["euro", "\u20AC"],
|
||||
["image", "\u2111"],
|
||||
["weierp", "\u2118"],
|
||||
["real", "\u211C"],
|
||||
["trade", "\u2122"],
|
||||
["alefsym", "\u2135"],
|
||||
["larr", "\u2190"],
|
||||
["uarr", "\u2191"],
|
||||
["rarr", "\u2192"],
|
||||
["darr", "\u2193"],
|
||||
["harr", "\u2194"],
|
||||
["crarr", "\u21B5"],
|
||||
["lArr", "\u21D0"],
|
||||
["uArr", "\u21D1"],
|
||||
["rArr", "\u21D2"],
|
||||
["dArr", "\u21D3"],
|
||||
["hArr", "\u21D4"],
|
||||
["forall", "\u2200"],
|
||||
["part", "\u2202"],
|
||||
["exist", "\u2203"],
|
||||
["empty", "\u2205"],
|
||||
["nabla", "\u2207"],
|
||||
["isin", "\u2208"],
|
||||
["notin", "\u2209"],
|
||||
["ni", "\u220B"],
|
||||
["prod", "\u220F"],
|
||||
["sum", "\u2211"],
|
||||
["minus", "\u2212"],
|
||||
["lowast", "\u2217"],
|
||||
["radic", "\u221A"],
|
||||
["prop", "\u221D"],
|
||||
["infin", "\u221E"],
|
||||
["ang", "\u2220"],
|
||||
["and", "\u2227"],
|
||||
["or", "\u2228"],
|
||||
["cap", "\u2229"],
|
||||
["cup", "\u222A"],
|
||||
["int", "\u222B"],
|
||||
["there4", "\u2234"],
|
||||
["sim", "\u223C"],
|
||||
["cong", "\u2245"],
|
||||
["asymp", "\u2248"],
|
||||
["ne", "\u2260"],
|
||||
["equiv", "\u2261"],
|
||||
["le", "\u2264"],
|
||||
["ge", "\u2265"],
|
||||
["sub", "\u2282"],
|
||||
["sup", "\u2283"],
|
||||
["nsub", "\u2284"],
|
||||
["sube", "\u2286"],
|
||||
["supe", "\u2287"],
|
||||
["oplus", "\u2295"],
|
||||
["otimes", "\u2297"],
|
||||
["perp", "\u22A5"],
|
||||
["sdot", "\u22C5"],
|
||||
["lceil", "\u2308"],
|
||||
["rceil", "\u2309"],
|
||||
["lfloor", "\u230A"],
|
||||
["rfloor", "\u230B"],
|
||||
["lang", "\u2329"],
|
||||
["rang", "\u232A"],
|
||||
["loz", "\u25CA"],
|
||||
["spades", "\u2660"],
|
||||
["clubs", "\u2663"],
|
||||
["hearts", "\u2665"],
|
||||
["diams", "\u2666"],
|
||||
]);
|
37
node_modules/sucrase/dist/esm/parser/plugins/types.js
generated
vendored
Normal file
37
node_modules/sucrase/dist/esm/parser/plugins/types.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
import {eatTypeToken, lookaheadType, match} from "../tokenizer/index";
|
||||
import {TokenType as tt} from "../tokenizer/types";
|
||||
import {isFlowEnabled, isTypeScriptEnabled} from "../traverser/base";
|
||||
import {baseParseConditional} from "../traverser/expression";
|
||||
import {flowParseTypeAnnotation} from "./flow";
|
||||
import {tsParseTypeAnnotation} from "./typescript";
|
||||
|
||||
/**
|
||||
* Common parser code for TypeScript and Flow.
|
||||
*/
|
||||
|
||||
// An apparent conditional expression could actually be an optional parameter in an arrow function.
|
||||
export function typedParseConditional(noIn) {
|
||||
// If we see ?:, this can't possibly be a valid conditional. typedParseParenItem will be called
|
||||
// later to finish off the arrow parameter. We also need to handle bare ? tokens for optional
|
||||
// parameters without type annotations, i.e. ?, and ?) .
|
||||
if (match(tt.question)) {
|
||||
const nextType = lookaheadType();
|
||||
if (nextType === tt.colon || nextType === tt.comma || nextType === tt.parenR) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
baseParseConditional(noIn);
|
||||
}
|
||||
|
||||
// Note: These "type casts" are *not* valid TS expressions.
|
||||
// But we parse them here and change them when completing the arrow function.
|
||||
export function typedParseParenItem() {
|
||||
eatTypeToken(tt.question);
|
||||
if (match(tt.colon)) {
|
||||
if (isTypeScriptEnabled) {
|
||||
tsParseTypeAnnotation();
|
||||
} else if (isFlowEnabled) {
|
||||
flowParseTypeAnnotation();
|
||||
}
|
||||
}
|
||||
}
|
1632
node_modules/sucrase/dist/esm/parser/plugins/typescript.js
generated
vendored
Normal file
1632
node_modules/sucrase/dist/esm/parser/plugins/typescript.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1004
node_modules/sucrase/dist/esm/parser/tokenizer/index.js
generated
vendored
Normal file
1004
node_modules/sucrase/dist/esm/parser/tokenizer/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
43
node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js
generated
vendored
Normal file
43
node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
export var ContextualKeyword; (function (ContextualKeyword) {
|
||||
const NONE = 0; ContextualKeyword[ContextualKeyword["NONE"] = NONE] = "NONE";
|
||||
const _abstract = NONE + 1; ContextualKeyword[ContextualKeyword["_abstract"] = _abstract] = "_abstract";
|
||||
const _accessor = _abstract + 1; ContextualKeyword[ContextualKeyword["_accessor"] = _accessor] = "_accessor";
|
||||
const _as = _accessor + 1; ContextualKeyword[ContextualKeyword["_as"] = _as] = "_as";
|
||||
const _assert = _as + 1; ContextualKeyword[ContextualKeyword["_assert"] = _assert] = "_assert";
|
||||
const _asserts = _assert + 1; ContextualKeyword[ContextualKeyword["_asserts"] = _asserts] = "_asserts";
|
||||
const _async = _asserts + 1; ContextualKeyword[ContextualKeyword["_async"] = _async] = "_async";
|
||||
const _await = _async + 1; ContextualKeyword[ContextualKeyword["_await"] = _await] = "_await";
|
||||
const _checks = _await + 1; ContextualKeyword[ContextualKeyword["_checks"] = _checks] = "_checks";
|
||||
const _constructor = _checks + 1; ContextualKeyword[ContextualKeyword["_constructor"] = _constructor] = "_constructor";
|
||||
const _declare = _constructor + 1; ContextualKeyword[ContextualKeyword["_declare"] = _declare] = "_declare";
|
||||
const _enum = _declare + 1; ContextualKeyword[ContextualKeyword["_enum"] = _enum] = "_enum";
|
||||
const _exports = _enum + 1; ContextualKeyword[ContextualKeyword["_exports"] = _exports] = "_exports";
|
||||
const _from = _exports + 1; ContextualKeyword[ContextualKeyword["_from"] = _from] = "_from";
|
||||
const _get = _from + 1; ContextualKeyword[ContextualKeyword["_get"] = _get] = "_get";
|
||||
const _global = _get + 1; ContextualKeyword[ContextualKeyword["_global"] = _global] = "_global";
|
||||
const _implements = _global + 1; ContextualKeyword[ContextualKeyword["_implements"] = _implements] = "_implements";
|
||||
const _infer = _implements + 1; ContextualKeyword[ContextualKeyword["_infer"] = _infer] = "_infer";
|
||||
const _interface = _infer + 1; ContextualKeyword[ContextualKeyword["_interface"] = _interface] = "_interface";
|
||||
const _is = _interface + 1; ContextualKeyword[ContextualKeyword["_is"] = _is] = "_is";
|
||||
const _keyof = _is + 1; ContextualKeyword[ContextualKeyword["_keyof"] = _keyof] = "_keyof";
|
||||
const _mixins = _keyof + 1; ContextualKeyword[ContextualKeyword["_mixins"] = _mixins] = "_mixins";
|
||||
const _module = _mixins + 1; ContextualKeyword[ContextualKeyword["_module"] = _module] = "_module";
|
||||
const _namespace = _module + 1; ContextualKeyword[ContextualKeyword["_namespace"] = _namespace] = "_namespace";
|
||||
const _of = _namespace + 1; ContextualKeyword[ContextualKeyword["_of"] = _of] = "_of";
|
||||
const _opaque = _of + 1; ContextualKeyword[ContextualKeyword["_opaque"] = _opaque] = "_opaque";
|
||||
const _out = _opaque + 1; ContextualKeyword[ContextualKeyword["_out"] = _out] = "_out";
|
||||
const _override = _out + 1; ContextualKeyword[ContextualKeyword["_override"] = _override] = "_override";
|
||||
const _private = _override + 1; ContextualKeyword[ContextualKeyword["_private"] = _private] = "_private";
|
||||
const _protected = _private + 1; ContextualKeyword[ContextualKeyword["_protected"] = _protected] = "_protected";
|
||||
const _proto = _protected + 1; ContextualKeyword[ContextualKeyword["_proto"] = _proto] = "_proto";
|
||||
const _public = _proto + 1; ContextualKeyword[ContextualKeyword["_public"] = _public] = "_public";
|
||||
const _readonly = _public + 1; ContextualKeyword[ContextualKeyword["_readonly"] = _readonly] = "_readonly";
|
||||
const _require = _readonly + 1; ContextualKeyword[ContextualKeyword["_require"] = _require] = "_require";
|
||||
const _satisfies = _require + 1; ContextualKeyword[ContextualKeyword["_satisfies"] = _satisfies] = "_satisfies";
|
||||
const _set = _satisfies + 1; ContextualKeyword[ContextualKeyword["_set"] = _set] = "_set";
|
||||
const _static = _set + 1; ContextualKeyword[ContextualKeyword["_static"] = _static] = "_static";
|
||||
const _symbol = _static + 1; ContextualKeyword[ContextualKeyword["_symbol"] = _symbol] = "_symbol";
|
||||
const _type = _symbol + 1; ContextualKeyword[ContextualKeyword["_type"] = _type] = "_type";
|
||||
const _unique = _type + 1; ContextualKeyword[ContextualKeyword["_unique"] = _unique] = "_unique";
|
||||
const _using = _unique + 1; ContextualKeyword[ContextualKeyword["_using"] = _using] = "_using";
|
||||
})(ContextualKeyword || (ContextualKeyword = {}));
|
64
node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js
generated
vendored
Normal file
64
node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
import {input, state} from "../traverser/base";
|
||||
import {charCodes} from "../util/charcodes";
|
||||
import {IS_IDENTIFIER_CHAR} from "../util/identifier";
|
||||
import {finishToken} from "./index";
|
||||
import {READ_WORD_TREE} from "./readWordTree";
|
||||
import {TokenType as tt} from "./types";
|
||||
|
||||
/**
|
||||
* Read an identifier, producing either a name token or matching on one of the existing keywords.
|
||||
* For performance, we pre-generate big decision tree that we traverse. Each node represents a
|
||||
* prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if
|
||||
* not), and the other 26 values are the transitions to other nodes, or -1 to stop.
|
||||
*/
|
||||
export default function readWord() {
|
||||
let treePos = 0;
|
||||
let code = 0;
|
||||
let pos = state.pos;
|
||||
while (pos < input.length) {
|
||||
code = input.charCodeAt(pos);
|
||||
if (code < charCodes.lowercaseA || code > charCodes.lowercaseZ) {
|
||||
break;
|
||||
}
|
||||
const next = READ_WORD_TREE[treePos + (code - charCodes.lowercaseA) + 1];
|
||||
if (next === -1) {
|
||||
break;
|
||||
} else {
|
||||
treePos = next;
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
const keywordValue = READ_WORD_TREE[treePos];
|
||||
if (keywordValue > -1 && !IS_IDENTIFIER_CHAR[code]) {
|
||||
state.pos = pos;
|
||||
if (keywordValue & 1) {
|
||||
finishToken(keywordValue >>> 1);
|
||||
} else {
|
||||
finishToken(tt.name, keywordValue >>> 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
while (pos < input.length) {
|
||||
const ch = input.charCodeAt(pos);
|
||||
if (IS_IDENTIFIER_CHAR[ch]) {
|
||||
pos++;
|
||||
} else if (ch === charCodes.backslash) {
|
||||
// \u
|
||||
pos += 2;
|
||||
if (input.charCodeAt(pos) === charCodes.leftCurlyBrace) {
|
||||
while (pos < input.length && input.charCodeAt(pos) !== charCodes.rightCurlyBrace) {
|
||||
pos++;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
} else if (ch === charCodes.atSign && input.charCodeAt(pos + 1) === charCodes.atSign) {
|
||||
pos += 2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
state.pos = pos;
|
||||
finishToken(tt.name);
|
||||
}
|
671
node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js
generated
vendored
Normal file
671
node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js
generated
vendored
Normal file
@ -0,0 +1,671 @@
|
||||
// Generated file, do not edit! Run "yarn generate" to re-generate this file.
|
||||
import {ContextualKeyword} from "./keywords";
|
||||
import {TokenType as tt} from "./types";
|
||||
|
||||
// prettier-ignore
|
||||
export const READ_WORD_TREE = new Int32Array([
|
||||
// ""
|
||||
-1, 27, 783, 918, 1755, 2376, 2862, 3483, -1, 3699, -1, 4617, 4752, 4833, 5130, 5508, 5940, -1, 6480, 6939, 7749, 8181, 8451, 8613, -1, 8829, -1,
|
||||
// "a"
|
||||
-1, -1, 54, 243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, -1, -1, -1, 675, -1, -1, -1,
|
||||
// "ab"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "abs"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1,
|
||||
// "abst"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "abstr"
|
||||
-1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "abstra"
|
||||
-1, -1, -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "abstrac"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 216, -1, -1, -1, -1, -1, -1,
|
||||
// "abstract"
|
||||
ContextualKeyword._abstract << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ac"
|
||||
-1, -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "acc"
|
||||
-1, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "acce"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "acces"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "access"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "accesso"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "accessor"
|
||||
ContextualKeyword._accessor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "as"
|
||||
ContextualKeyword._as << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, 594, -1,
|
||||
// "ass"
|
||||
-1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "asse"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "asser"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 540, -1, -1, -1, -1, -1, -1,
|
||||
// "assert"
|
||||
ContextualKeyword._assert << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 567, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "asserts"
|
||||
ContextualKeyword._asserts << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "asy"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "asyn"
|
||||
-1, -1, -1, 648, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "async"
|
||||
ContextualKeyword._async << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "aw"
|
||||
-1, 702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "awa"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "awai"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 756, -1, -1, -1, -1, -1, -1,
|
||||
// "await"
|
||||
ContextualKeyword._await << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "b"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "br"
|
||||
-1, -1, -1, -1, -1, 837, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "bre"
|
||||
-1, 864, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "brea"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "break"
|
||||
(tt._break << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "c"
|
||||
-1, 945, -1, -1, -1, -1, -1, -1, 1107, -1, -1, -1, 1242, -1, -1, 1350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ca"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 972, 1026, -1, -1, -1, -1, -1, -1,
|
||||
// "cas"
|
||||
-1, -1, -1, -1, -1, 999, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "case"
|
||||
(tt._case << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "cat"
|
||||
-1, -1, -1, 1053, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "catc"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "catch"
|
||||
(tt._catch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ch"
|
||||
-1, -1, -1, -1, -1, 1134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "che"
|
||||
-1, -1, -1, 1161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "chec"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "check"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1215, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "checks"
|
||||
ContextualKeyword._checks << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "cl"
|
||||
-1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "cla"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1296, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "clas"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1323, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "class"
|
||||
(tt._class << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "co"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1377, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "con"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, 1620, -1, -1, -1, -1, -1, -1,
|
||||
// "cons"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1431, -1, -1, -1, -1, -1, -1,
|
||||
// "const"
|
||||
(tt._const << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1458, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "constr"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1485, -1, -1, -1, -1, -1,
|
||||
// "constru"
|
||||
-1, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "construc"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1539, -1, -1, -1, -1, -1, -1,
|
||||
// "construct"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "constructo"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1593, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "constructor"
|
||||
ContextualKeyword._constructor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "cont"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 1647, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "conti"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1674, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "contin"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1701, -1, -1, -1, -1, -1,
|
||||
// "continu"
|
||||
-1, -1, -1, -1, -1, 1728, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "continue"
|
||||
(tt._continue << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "d"
|
||||
-1, -1, -1, -1, -1, 1782, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "de"
|
||||
-1, -1, 1809, 1971, -1, -1, 2106, -1, -1, -1, -1, -1, 2241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "deb"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1836, -1, -1, -1, -1, -1,
|
||||
// "debu"
|
||||
-1, -1, -1, -1, -1, -1, -1, 1863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "debug"
|
||||
-1, -1, -1, -1, -1, -1, -1, 1890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "debugg"
|
||||
-1, -1, -1, -1, -1, 1917, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "debugge"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1944, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "debugger"
|
||||
(tt._debugger << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "dec"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1998, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "decl"
|
||||
-1, 2025, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "decla"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2052, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "declar"
|
||||
-1, -1, -1, -1, -1, 2079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "declare"
|
||||
ContextualKeyword._declare << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "def"
|
||||
-1, 2133, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "defa"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2160, -1, -1, -1, -1, -1,
|
||||
// "defau"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "defaul"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2214, -1, -1, -1, -1, -1, -1,
|
||||
// "default"
|
||||
(tt._default << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "del"
|
||||
-1, -1, -1, -1, -1, 2268, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "dele"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, -1, -1,
|
||||
// "delet"
|
||||
-1, -1, -1, -1, -1, 2322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "delete"
|
||||
(tt._delete << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "do"
|
||||
(tt._do << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "e"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2403, -1, 2484, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2565, -1, -1,
|
||||
// "el"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2430, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "els"
|
||||
-1, -1, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "else"
|
||||
(tt._else << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "en"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2511, -1, -1, -1, -1, -1,
|
||||
// "enu"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "enum"
|
||||
ContextualKeyword._enum << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ex"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2592, -1, -1, -1, 2727, -1, -1, -1, -1, -1, -1,
|
||||
// "exp"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2619, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "expo"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2646, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "expor"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2673, -1, -1, -1, -1, -1, -1,
|
||||
// "export"
|
||||
(tt._export << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2700, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "exports"
|
||||
ContextualKeyword._exports << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ext"
|
||||
-1, -1, -1, -1, -1, 2754, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "exte"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2781, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "exten"
|
||||
-1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "extend"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2835, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "extends"
|
||||
(tt._extends << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "f"
|
||||
-1, 2889, -1, -1, -1, -1, -1, -1, -1, 2997, -1, -1, -1, -1, -1, 3159, -1, -1, 3213, -1, -1, 3294, -1, -1, -1, -1, -1,
|
||||
// "fa"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2916, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fal"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2943, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fals"
|
||||
-1, -1, -1, -1, -1, 2970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "false"
|
||||
(tt._false << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fin"
|
||||
-1, 3051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fina"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "final"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "finall"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3132, -1,
|
||||
// "finally"
|
||||
(tt._finally << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fo"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3186, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "for"
|
||||
(tt._for << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fr"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fro"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "from"
|
||||
ContextualKeyword._from << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fu"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "fun"
|
||||
-1, -1, -1, 3348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "func"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3375, -1, -1, -1, -1, -1, -1,
|
||||
// "funct"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 3402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "functi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "functio"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3456, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "function"
|
||||
(tt._function << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "g"
|
||||
-1, -1, -1, -1, -1, 3510, -1, -1, -1, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ge"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3537, -1, -1, -1, -1, -1, -1,
|
||||
// "get"
|
||||
ContextualKeyword._get << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "gl"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "glo"
|
||||
-1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "glob"
|
||||
-1, 3645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "globa"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "global"
|
||||
ContextualKeyword._global << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "i"
|
||||
-1, -1, -1, -1, -1, -1, 3726, -1, -1, -1, -1, -1, -1, 3753, 4077, -1, -1, -1, -1, 4590, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "if"
|
||||
(tt._if << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "im"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "imp"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3807, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "impl"
|
||||
-1, -1, -1, -1, -1, 3834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "imple"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "implem"
|
||||
-1, -1, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "impleme"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3915, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "implemen"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3942, -1, -1, -1, -1, -1, -1,
|
||||
// "implement"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3969, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "implements"
|
||||
ContextualKeyword._implements << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "impo"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "impor"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4050, -1, -1, -1, -1, -1, -1,
|
||||
// "import"
|
||||
(tt._import << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "in"
|
||||
(tt._in << 1) + 1, -1, -1, -1, -1, -1, 4104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4185, 4401, -1, -1, -1, -1, -1, -1,
|
||||
// "inf"
|
||||
-1, -1, -1, -1, -1, 4131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "infe"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "infer"
|
||||
ContextualKeyword._infer << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ins"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4212, -1, -1, -1, -1, -1, -1,
|
||||
// "inst"
|
||||
-1, 4239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "insta"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "instan"
|
||||
-1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "instanc"
|
||||
-1, -1, -1, -1, -1, 4320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "instance"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "instanceo"
|
||||
-1, -1, -1, -1, -1, -1, 4374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "instanceof"
|
||||
(tt._instanceof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "int"
|
||||
-1, -1, -1, -1, -1, 4428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "inte"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4455, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "inter"
|
||||
-1, -1, -1, -1, -1, -1, 4482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "interf"
|
||||
-1, 4509, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "interfa"
|
||||
-1, -1, -1, 4536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "interfac"
|
||||
-1, -1, -1, -1, -1, 4563, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "interface"
|
||||
ContextualKeyword._interface << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "is"
|
||||
ContextualKeyword._is << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "k"
|
||||
-1, -1, -1, -1, -1, 4644, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ke"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4671, -1,
|
||||
// "key"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "keyo"
|
||||
-1, -1, -1, -1, -1, -1, 4725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "keyof"
|
||||
ContextualKeyword._keyof << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "l"
|
||||
-1, -1, -1, -1, -1, 4779, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "le"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4806, -1, -1, -1, -1, -1, -1,
|
||||
// "let"
|
||||
(tt._let << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "m"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 4860, -1, -1, -1, -1, -1, 4995, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "mi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4887, -1, -1,
|
||||
// "mix"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 4914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "mixi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "mixin"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "mixins"
|
||||
ContextualKeyword._mixins << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "mo"
|
||||
-1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "mod"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5049, -1, -1, -1, -1, -1,
|
||||
// "modu"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "modul"
|
||||
-1, -1, -1, -1, -1, 5103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "module"
|
||||
ContextualKeyword._module << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "n"
|
||||
-1, 5157, -1, -1, -1, 5373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5427, -1, -1, -1, -1, -1,
|
||||
// "na"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "nam"
|
||||
-1, -1, -1, -1, -1, 5211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "name"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5238, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "names"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "namesp"
|
||||
-1, 5292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "namespa"
|
||||
-1, -1, -1, 5319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "namespac"
|
||||
-1, -1, -1, -1, -1, 5346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "namespace"
|
||||
ContextualKeyword._namespace << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ne"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5400, -1, -1, -1,
|
||||
// "new"
|
||||
(tt._new << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "nu"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "nul"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5481, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "null"
|
||||
(tt._null << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "o"
|
||||
-1, -1, -1, -1, -1, -1, 5535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5562, -1, -1, -1, -1, 5697, 5751, -1, -1, -1, -1,
|
||||
// "of"
|
||||
ContextualKeyword._of << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "op"
|
||||
-1, 5589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "opa"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5616, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "opaq"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5643, -1, -1, -1, -1, -1,
|
||||
// "opaqu"
|
||||
-1, -1, -1, -1, -1, 5670, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "opaque"
|
||||
ContextualKeyword._opaque << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ou"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5724, -1, -1, -1, -1, -1, -1,
|
||||
// "out"
|
||||
ContextualKeyword._out << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ov"
|
||||
-1, -1, -1, -1, -1, 5778, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ove"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5805, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "over"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "overr"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 5859, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "overri"
|
||||
-1, -1, -1, -1, 5886, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "overrid"
|
||||
-1, -1, -1, -1, -1, 5913, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "override"
|
||||
ContextualKeyword._override << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "p"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5967, -1, -1, 6345, -1, -1, -1, -1, -1,
|
||||
// "pr"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, -1, -1, -1, -1, -1, 6129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "pri"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6021, -1, -1, -1, -1,
|
||||
// "priv"
|
||||
-1, 6048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "priva"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6075, -1, -1, -1, -1, -1, -1,
|
||||
// "privat"
|
||||
-1, -1, -1, -1, -1, 6102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "private"
|
||||
ContextualKeyword._private << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "pro"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6156, -1, -1, -1, -1, -1, -1,
|
||||
// "prot"
|
||||
-1, -1, -1, -1, -1, 6183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "prote"
|
||||
-1, -1, -1, 6210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "protec"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6237, -1, -1, -1, -1, -1, -1,
|
||||
// "protect"
|
||||
-1, -1, -1, -1, -1, 6264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "protecte"
|
||||
-1, -1, -1, -1, 6291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "protected"
|
||||
ContextualKeyword._protected << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "proto"
|
||||
ContextualKeyword._proto << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "pu"
|
||||
-1, -1, 6372, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "pub"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6399, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "publ"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 6426, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "publi"
|
||||
-1, -1, -1, 6453, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "public"
|
||||
ContextualKeyword._public << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "r"
|
||||
-1, -1, -1, -1, -1, 6507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "re"
|
||||
-1, 6534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6696, -1, -1, 6831, -1, -1, -1, -1, -1, -1,
|
||||
// "rea"
|
||||
-1, -1, -1, -1, 6561, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "read"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "reado"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "readon"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "readonl"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6669, -1,
|
||||
// "readonly"
|
||||
ContextualKeyword._readonly << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "req"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6723, -1, -1, -1, -1, -1,
|
||||
// "requ"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 6750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "requi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6777, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "requir"
|
||||
-1, -1, -1, -1, -1, 6804, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "require"
|
||||
ContextualKeyword._require << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ret"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6858, -1, -1, -1, -1, -1,
|
||||
// "retu"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6885, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "retur"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6912, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "return"
|
||||
(tt._return << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "s"
|
||||
-1, 6966, -1, -1, -1, 7182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7236, 7371, -1, 7479, -1, 7614, -1,
|
||||
// "sa"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6993, -1, -1, -1, -1, -1, -1,
|
||||
// "sat"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7020, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "sati"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7047, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "satis"
|
||||
-1, -1, -1, -1, -1, -1, 7074, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "satisf"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "satisfi"
|
||||
-1, -1, -1, -1, -1, 7128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "satisfie"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7155, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "satisfies"
|
||||
ContextualKeyword._satisfies << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "se"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7209, -1, -1, -1, -1, -1, -1,
|
||||
// "set"
|
||||
ContextualKeyword._set << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "st"
|
||||
-1, 7263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "sta"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7290, -1, -1, -1, -1, -1, -1,
|
||||
// "stat"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "stati"
|
||||
-1, -1, -1, 7344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "static"
|
||||
ContextualKeyword._static << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "su"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7398, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "sup"
|
||||
-1, -1, -1, -1, -1, 7425, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "supe"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7452, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "super"
|
||||
(tt._super << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "sw"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7506, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "swi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7533, -1, -1, -1, -1, -1, -1,
|
||||
// "swit"
|
||||
-1, -1, -1, 7560, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "switc"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, 7587, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "switch"
|
||||
(tt._switch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "sy"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7641, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "sym"
|
||||
-1, -1, 7668, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "symb"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "symbo"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "symbol"
|
||||
ContextualKeyword._symbol << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "t"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, 7776, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7938, -1, -1, -1, -1, -1, -1, 8046, -1,
|
||||
// "th"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 7803, -1, -1, -1, -1, -1, -1, -1, -1, 7857, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "thi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7830, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "this"
|
||||
(tt._this << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "thr"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "thro"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7911, -1, -1, -1,
|
||||
// "throw"
|
||||
(tt._throw << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "tr"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7965, -1, -1, -1, 8019, -1,
|
||||
// "tru"
|
||||
-1, -1, -1, -1, -1, 7992, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "true"
|
||||
(tt._true << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "try"
|
||||
(tt._try << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "ty"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "typ"
|
||||
-1, -1, -1, -1, -1, 8100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "type"
|
||||
ContextualKeyword._type << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8127, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "typeo"
|
||||
-1, -1, -1, -1, -1, -1, 8154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "typeof"
|
||||
(tt._typeof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "u"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8208, -1, -1, -1, -1, 8343, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "un"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "uni"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8262, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "uniq"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8289, -1, -1, -1, -1, -1,
|
||||
// "uniqu"
|
||||
-1, -1, -1, -1, -1, 8316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "unique"
|
||||
ContextualKeyword._unique << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "us"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "usi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "usin"
|
||||
-1, -1, -1, -1, -1, -1, -1, 8424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "using"
|
||||
ContextualKeyword._using << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "v"
|
||||
-1, 8478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8532, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "va"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8505, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "var"
|
||||
(tt._var << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "vo"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8559, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "voi"
|
||||
-1, -1, -1, -1, 8586, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "void"
|
||||
(tt._void << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "w"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, 8640, 8748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "wh"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "whi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "whil"
|
||||
-1, -1, -1, -1, -1, 8721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "while"
|
||||
(tt._while << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "wi"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8775, -1, -1, -1, -1, -1, -1,
|
||||
// "wit"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, 8802, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "with"
|
||||
(tt._with << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "y"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "yi"
|
||||
-1, -1, -1, -1, -1, 8883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "yie"
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "yiel"
|
||||
-1, -1, -1, -1, 8937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
// "yield"
|
||||
(tt._yield << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
]);
|
106
node_modules/sucrase/dist/esm/parser/tokenizer/state.js
generated
vendored
Normal file
106
node_modules/sucrase/dist/esm/parser/tokenizer/state.js
generated
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
|
||||
import {ContextualKeyword} from "./keywords";
|
||||
import { TokenType as tt} from "./types";
|
||||
|
||||
export class Scope {
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(startTokenIndex, endTokenIndex, isFunctionScope) {
|
||||
this.startTokenIndex = startTokenIndex;
|
||||
this.endTokenIndex = endTokenIndex;
|
||||
this.isFunctionScope = isFunctionScope;
|
||||
}
|
||||
}
|
||||
|
||||
export class StateSnapshot {
|
||||
constructor(
|
||||
potentialArrowAt,
|
||||
noAnonFunctionType,
|
||||
inDisallowConditionalTypesContext,
|
||||
tokensLength,
|
||||
scopesLength,
|
||||
pos,
|
||||
type,
|
||||
contextualKeyword,
|
||||
start,
|
||||
end,
|
||||
isType,
|
||||
scopeDepth,
|
||||
error,
|
||||
) {;this.potentialArrowAt = potentialArrowAt;this.noAnonFunctionType = noAnonFunctionType;this.inDisallowConditionalTypesContext = inDisallowConditionalTypesContext;this.tokensLength = tokensLength;this.scopesLength = scopesLength;this.pos = pos;this.type = type;this.contextualKeyword = contextualKeyword;this.start = start;this.end = end;this.isType = isType;this.scopeDepth = scopeDepth;this.error = error;}
|
||||
}
|
||||
|
||||
export default class State {constructor() { State.prototype.__init.call(this);State.prototype.__init2.call(this);State.prototype.__init3.call(this);State.prototype.__init4.call(this);State.prototype.__init5.call(this);State.prototype.__init6.call(this);State.prototype.__init7.call(this);State.prototype.__init8.call(this);State.prototype.__init9.call(this);State.prototype.__init10.call(this);State.prototype.__init11.call(this);State.prototype.__init12.call(this);State.prototype.__init13.call(this); }
|
||||
// Used to signify the start of a potential arrow function
|
||||
__init() {this.potentialArrowAt = -1}
|
||||
|
||||
// Used by Flow to handle an edge case involving function type parsing.
|
||||
__init2() {this.noAnonFunctionType = false}
|
||||
|
||||
// Used by TypeScript to handle ambiguities when parsing conditional types.
|
||||
__init3() {this.inDisallowConditionalTypesContext = false}
|
||||
|
||||
// Token store.
|
||||
__init4() {this.tokens = []}
|
||||
|
||||
// Array of all observed scopes, ordered by their ending position.
|
||||
__init5() {this.scopes = []}
|
||||
|
||||
// The current position of the tokenizer in the input.
|
||||
__init6() {this.pos = 0}
|
||||
|
||||
// Information about the current token.
|
||||
__init7() {this.type = tt.eof}
|
||||
__init8() {this.contextualKeyword = ContextualKeyword.NONE}
|
||||
__init9() {this.start = 0}
|
||||
__init10() {this.end = 0}
|
||||
|
||||
__init11() {this.isType = false}
|
||||
__init12() {this.scopeDepth = 0}
|
||||
|
||||
/**
|
||||
* If the parser is in an error state, then the token is always tt.eof and all functions can
|
||||
* keep executing but should be written so they don't get into an infinite loop in this situation.
|
||||
*
|
||||
* This approach, combined with the ability to snapshot and restore state, allows us to implement
|
||||
* backtracking without exceptions and without needing to explicitly propagate error states
|
||||
* everywhere.
|
||||
*/
|
||||
__init13() {this.error = null}
|
||||
|
||||
snapshot() {
|
||||
return new StateSnapshot(
|
||||
this.potentialArrowAt,
|
||||
this.noAnonFunctionType,
|
||||
this.inDisallowConditionalTypesContext,
|
||||
this.tokens.length,
|
||||
this.scopes.length,
|
||||
this.pos,
|
||||
this.type,
|
||||
this.contextualKeyword,
|
||||
this.start,
|
||||
this.end,
|
||||
this.isType,
|
||||
this.scopeDepth,
|
||||
this.error,
|
||||
);
|
||||
}
|
||||
|
||||
restoreFromSnapshot(snapshot) {
|
||||
this.potentialArrowAt = snapshot.potentialArrowAt;
|
||||
this.noAnonFunctionType = snapshot.noAnonFunctionType;
|
||||
this.inDisallowConditionalTypesContext = snapshot.inDisallowConditionalTypesContext;
|
||||
this.tokens.length = snapshot.tokensLength;
|
||||
this.scopes.length = snapshot.scopesLength;
|
||||
this.pos = snapshot.pos;
|
||||
this.type = snapshot.type;
|
||||
this.contextualKeyword = snapshot.contextualKeyword;
|
||||
this.start = snapshot.start;
|
||||
this.end = snapshot.end;
|
||||
this.isType = snapshot.isType;
|
||||
this.scopeDepth = snapshot.scopeDepth;
|
||||
this.error = snapshot.error;
|
||||
}
|
||||
}
|
361
node_modules/sucrase/dist/esm/parser/tokenizer/types.js
generated
vendored
Normal file
361
node_modules/sucrase/dist/esm/parser/tokenizer/types.js
generated
vendored
Normal file
@ -0,0 +1,361 @@
|
||||
// Generated file, do not edit! Run "yarn generate" to re-generate this file.
|
||||
/* istanbul ignore file */
|
||||
/**
|
||||
* Enum of all token types, with bit fields to signify meaningful properties.
|
||||
*/
|
||||
export var TokenType; (function (TokenType) {
|
||||
// Precedence 0 means not an operator; otherwise it is a positive number up to 12.
|
||||
const PRECEDENCE_MASK = 0xf; TokenType[TokenType["PRECEDENCE_MASK"] = PRECEDENCE_MASK] = "PRECEDENCE_MASK";
|
||||
const IS_KEYWORD = 1 << 4; TokenType[TokenType["IS_KEYWORD"] = IS_KEYWORD] = "IS_KEYWORD";
|
||||
const IS_ASSIGN = 1 << 5; TokenType[TokenType["IS_ASSIGN"] = IS_ASSIGN] = "IS_ASSIGN";
|
||||
const IS_RIGHT_ASSOCIATIVE = 1 << 6; TokenType[TokenType["IS_RIGHT_ASSOCIATIVE"] = IS_RIGHT_ASSOCIATIVE] = "IS_RIGHT_ASSOCIATIVE";
|
||||
const IS_PREFIX = 1 << 7; TokenType[TokenType["IS_PREFIX"] = IS_PREFIX] = "IS_PREFIX";
|
||||
const IS_POSTFIX = 1 << 8; TokenType[TokenType["IS_POSTFIX"] = IS_POSTFIX] = "IS_POSTFIX";
|
||||
const IS_EXPRESSION_START = 1 << 9; TokenType[TokenType["IS_EXPRESSION_START"] = IS_EXPRESSION_START] = "IS_EXPRESSION_START";
|
||||
|
||||
const num = 512; TokenType[TokenType["num"] = num] = "num"; // num startsExpr
|
||||
const bigint = 1536; TokenType[TokenType["bigint"] = bigint] = "bigint"; // bigint startsExpr
|
||||
const decimal = 2560; TokenType[TokenType["decimal"] = decimal] = "decimal"; // decimal startsExpr
|
||||
const regexp = 3584; TokenType[TokenType["regexp"] = regexp] = "regexp"; // regexp startsExpr
|
||||
const string = 4608; TokenType[TokenType["string"] = string] = "string"; // string startsExpr
|
||||
const name = 5632; TokenType[TokenType["name"] = name] = "name"; // name startsExpr
|
||||
const eof = 6144; TokenType[TokenType["eof"] = eof] = "eof"; // eof
|
||||
const bracketL = 7680; TokenType[TokenType["bracketL"] = bracketL] = "bracketL"; // [ startsExpr
|
||||
const bracketR = 8192; TokenType[TokenType["bracketR"] = bracketR] = "bracketR"; // ]
|
||||
const braceL = 9728; TokenType[TokenType["braceL"] = braceL] = "braceL"; // { startsExpr
|
||||
const braceBarL = 10752; TokenType[TokenType["braceBarL"] = braceBarL] = "braceBarL"; // {| startsExpr
|
||||
const braceR = 11264; TokenType[TokenType["braceR"] = braceR] = "braceR"; // }
|
||||
const braceBarR = 12288; TokenType[TokenType["braceBarR"] = braceBarR] = "braceBarR"; // |}
|
||||
const parenL = 13824; TokenType[TokenType["parenL"] = parenL] = "parenL"; // ( startsExpr
|
||||
const parenR = 14336; TokenType[TokenType["parenR"] = parenR] = "parenR"; // )
|
||||
const comma = 15360; TokenType[TokenType["comma"] = comma] = "comma"; // ,
|
||||
const semi = 16384; TokenType[TokenType["semi"] = semi] = "semi"; // ;
|
||||
const colon = 17408; TokenType[TokenType["colon"] = colon] = "colon"; // :
|
||||
const doubleColon = 18432; TokenType[TokenType["doubleColon"] = doubleColon] = "doubleColon"; // ::
|
||||
const dot = 19456; TokenType[TokenType["dot"] = dot] = "dot"; // .
|
||||
const question = 20480; TokenType[TokenType["question"] = question] = "question"; // ?
|
||||
const questionDot = 21504; TokenType[TokenType["questionDot"] = questionDot] = "questionDot"; // ?.
|
||||
const arrow = 22528; TokenType[TokenType["arrow"] = arrow] = "arrow"; // =>
|
||||
const template = 23552; TokenType[TokenType["template"] = template] = "template"; // template
|
||||
const ellipsis = 24576; TokenType[TokenType["ellipsis"] = ellipsis] = "ellipsis"; // ...
|
||||
const backQuote = 25600; TokenType[TokenType["backQuote"] = backQuote] = "backQuote"; // `
|
||||
const dollarBraceL = 27136; TokenType[TokenType["dollarBraceL"] = dollarBraceL] = "dollarBraceL"; // ${ startsExpr
|
||||
const at = 27648; TokenType[TokenType["at"] = at] = "at"; // @
|
||||
const hash = 29184; TokenType[TokenType["hash"] = hash] = "hash"; // # startsExpr
|
||||
const eq = 29728; TokenType[TokenType["eq"] = eq] = "eq"; // = isAssign
|
||||
const assign = 30752; TokenType[TokenType["assign"] = assign] = "assign"; // _= isAssign
|
||||
const preIncDec = 32640; TokenType[TokenType["preIncDec"] = preIncDec] = "preIncDec"; // ++/-- prefix postfix startsExpr
|
||||
const postIncDec = 33664; TokenType[TokenType["postIncDec"] = postIncDec] = "postIncDec"; // ++/-- prefix postfix startsExpr
|
||||
const bang = 34432; TokenType[TokenType["bang"] = bang] = "bang"; // ! prefix startsExpr
|
||||
const tilde = 35456; TokenType[TokenType["tilde"] = tilde] = "tilde"; // ~ prefix startsExpr
|
||||
const pipeline = 35841; TokenType[TokenType["pipeline"] = pipeline] = "pipeline"; // |> prec:1
|
||||
const nullishCoalescing = 36866; TokenType[TokenType["nullishCoalescing"] = nullishCoalescing] = "nullishCoalescing"; // ?? prec:2
|
||||
const logicalOR = 37890; TokenType[TokenType["logicalOR"] = logicalOR] = "logicalOR"; // || prec:2
|
||||
const logicalAND = 38915; TokenType[TokenType["logicalAND"] = logicalAND] = "logicalAND"; // && prec:3
|
||||
const bitwiseOR = 39940; TokenType[TokenType["bitwiseOR"] = bitwiseOR] = "bitwiseOR"; // | prec:4
|
||||
const bitwiseXOR = 40965; TokenType[TokenType["bitwiseXOR"] = bitwiseXOR] = "bitwiseXOR"; // ^ prec:5
|
||||
const bitwiseAND = 41990; TokenType[TokenType["bitwiseAND"] = bitwiseAND] = "bitwiseAND"; // & prec:6
|
||||
const equality = 43015; TokenType[TokenType["equality"] = equality] = "equality"; // ==/!= prec:7
|
||||
const lessThan = 44040; TokenType[TokenType["lessThan"] = lessThan] = "lessThan"; // < prec:8
|
||||
const greaterThan = 45064; TokenType[TokenType["greaterThan"] = greaterThan] = "greaterThan"; // > prec:8
|
||||
const relationalOrEqual = 46088; TokenType[TokenType["relationalOrEqual"] = relationalOrEqual] = "relationalOrEqual"; // <=/>= prec:8
|
||||
const bitShiftL = 47113; TokenType[TokenType["bitShiftL"] = bitShiftL] = "bitShiftL"; // << prec:9
|
||||
const bitShiftR = 48137; TokenType[TokenType["bitShiftR"] = bitShiftR] = "bitShiftR"; // >>/>>> prec:9
|
||||
const plus = 49802; TokenType[TokenType["plus"] = plus] = "plus"; // + prec:10 prefix startsExpr
|
||||
const minus = 50826; TokenType[TokenType["minus"] = minus] = "minus"; // - prec:10 prefix startsExpr
|
||||
const modulo = 51723; TokenType[TokenType["modulo"] = modulo] = "modulo"; // % prec:11 startsExpr
|
||||
const star = 52235; TokenType[TokenType["star"] = star] = "star"; // * prec:11
|
||||
const slash = 53259; TokenType[TokenType["slash"] = slash] = "slash"; // / prec:11
|
||||
const exponent = 54348; TokenType[TokenType["exponent"] = exponent] = "exponent"; // ** prec:12 rightAssociative
|
||||
const jsxName = 55296; TokenType[TokenType["jsxName"] = jsxName] = "jsxName"; // jsxName
|
||||
const jsxText = 56320; TokenType[TokenType["jsxText"] = jsxText] = "jsxText"; // jsxText
|
||||
const jsxEmptyText = 57344; TokenType[TokenType["jsxEmptyText"] = jsxEmptyText] = "jsxEmptyText"; // jsxEmptyText
|
||||
const jsxTagStart = 58880; TokenType[TokenType["jsxTagStart"] = jsxTagStart] = "jsxTagStart"; // jsxTagStart startsExpr
|
||||
const jsxTagEnd = 59392; TokenType[TokenType["jsxTagEnd"] = jsxTagEnd] = "jsxTagEnd"; // jsxTagEnd
|
||||
const typeParameterStart = 60928; TokenType[TokenType["typeParameterStart"] = typeParameterStart] = "typeParameterStart"; // typeParameterStart startsExpr
|
||||
const nonNullAssertion = 61440; TokenType[TokenType["nonNullAssertion"] = nonNullAssertion] = "nonNullAssertion"; // nonNullAssertion
|
||||
const _break = 62480; TokenType[TokenType["_break"] = _break] = "_break"; // break keyword
|
||||
const _case = 63504; TokenType[TokenType["_case"] = _case] = "_case"; // case keyword
|
||||
const _catch = 64528; TokenType[TokenType["_catch"] = _catch] = "_catch"; // catch keyword
|
||||
const _continue = 65552; TokenType[TokenType["_continue"] = _continue] = "_continue"; // continue keyword
|
||||
const _debugger = 66576; TokenType[TokenType["_debugger"] = _debugger] = "_debugger"; // debugger keyword
|
||||
const _default = 67600; TokenType[TokenType["_default"] = _default] = "_default"; // default keyword
|
||||
const _do = 68624; TokenType[TokenType["_do"] = _do] = "_do"; // do keyword
|
||||
const _else = 69648; TokenType[TokenType["_else"] = _else] = "_else"; // else keyword
|
||||
const _finally = 70672; TokenType[TokenType["_finally"] = _finally] = "_finally"; // finally keyword
|
||||
const _for = 71696; TokenType[TokenType["_for"] = _for] = "_for"; // for keyword
|
||||
const _function = 73232; TokenType[TokenType["_function"] = _function] = "_function"; // function keyword startsExpr
|
||||
const _if = 73744; TokenType[TokenType["_if"] = _if] = "_if"; // if keyword
|
||||
const _return = 74768; TokenType[TokenType["_return"] = _return] = "_return"; // return keyword
|
||||
const _switch = 75792; TokenType[TokenType["_switch"] = _switch] = "_switch"; // switch keyword
|
||||
const _throw = 77456; TokenType[TokenType["_throw"] = _throw] = "_throw"; // throw keyword prefix startsExpr
|
||||
const _try = 77840; TokenType[TokenType["_try"] = _try] = "_try"; // try keyword
|
||||
const _var = 78864; TokenType[TokenType["_var"] = _var] = "_var"; // var keyword
|
||||
const _let = 79888; TokenType[TokenType["_let"] = _let] = "_let"; // let keyword
|
||||
const _const = 80912; TokenType[TokenType["_const"] = _const] = "_const"; // const keyword
|
||||
const _while = 81936; TokenType[TokenType["_while"] = _while] = "_while"; // while keyword
|
||||
const _with = 82960; TokenType[TokenType["_with"] = _with] = "_with"; // with keyword
|
||||
const _new = 84496; TokenType[TokenType["_new"] = _new] = "_new"; // new keyword startsExpr
|
||||
const _this = 85520; TokenType[TokenType["_this"] = _this] = "_this"; // this keyword startsExpr
|
||||
const _super = 86544; TokenType[TokenType["_super"] = _super] = "_super"; // super keyword startsExpr
|
||||
const _class = 87568; TokenType[TokenType["_class"] = _class] = "_class"; // class keyword startsExpr
|
||||
const _extends = 88080; TokenType[TokenType["_extends"] = _extends] = "_extends"; // extends keyword
|
||||
const _export = 89104; TokenType[TokenType["_export"] = _export] = "_export"; // export keyword
|
||||
const _import = 90640; TokenType[TokenType["_import"] = _import] = "_import"; // import keyword startsExpr
|
||||
const _yield = 91664; TokenType[TokenType["_yield"] = _yield] = "_yield"; // yield keyword startsExpr
|
||||
const _null = 92688; TokenType[TokenType["_null"] = _null] = "_null"; // null keyword startsExpr
|
||||
const _true = 93712; TokenType[TokenType["_true"] = _true] = "_true"; // true keyword startsExpr
|
||||
const _false = 94736; TokenType[TokenType["_false"] = _false] = "_false"; // false keyword startsExpr
|
||||
const _in = 95256; TokenType[TokenType["_in"] = _in] = "_in"; // in prec:8 keyword
|
||||
const _instanceof = 96280; TokenType[TokenType["_instanceof"] = _instanceof] = "_instanceof"; // instanceof prec:8 keyword
|
||||
const _typeof = 97936; TokenType[TokenType["_typeof"] = _typeof] = "_typeof"; // typeof keyword prefix startsExpr
|
||||
const _void = 98960; TokenType[TokenType["_void"] = _void] = "_void"; // void keyword prefix startsExpr
|
||||
const _delete = 99984; TokenType[TokenType["_delete"] = _delete] = "_delete"; // delete keyword prefix startsExpr
|
||||
const _async = 100880; TokenType[TokenType["_async"] = _async] = "_async"; // async keyword startsExpr
|
||||
const _get = 101904; TokenType[TokenType["_get"] = _get] = "_get"; // get keyword startsExpr
|
||||
const _set = 102928; TokenType[TokenType["_set"] = _set] = "_set"; // set keyword startsExpr
|
||||
const _declare = 103952; TokenType[TokenType["_declare"] = _declare] = "_declare"; // declare keyword startsExpr
|
||||
const _readonly = 104976; TokenType[TokenType["_readonly"] = _readonly] = "_readonly"; // readonly keyword startsExpr
|
||||
const _abstract = 106000; TokenType[TokenType["_abstract"] = _abstract] = "_abstract"; // abstract keyword startsExpr
|
||||
const _static = 107024; TokenType[TokenType["_static"] = _static] = "_static"; // static keyword startsExpr
|
||||
const _public = 107536; TokenType[TokenType["_public"] = _public] = "_public"; // public keyword
|
||||
const _private = 108560; TokenType[TokenType["_private"] = _private] = "_private"; // private keyword
|
||||
const _protected = 109584; TokenType[TokenType["_protected"] = _protected] = "_protected"; // protected keyword
|
||||
const _override = 110608; TokenType[TokenType["_override"] = _override] = "_override"; // override keyword
|
||||
const _as = 112144; TokenType[TokenType["_as"] = _as] = "_as"; // as keyword startsExpr
|
||||
const _enum = 113168; TokenType[TokenType["_enum"] = _enum] = "_enum"; // enum keyword startsExpr
|
||||
const _type = 114192; TokenType[TokenType["_type"] = _type] = "_type"; // type keyword startsExpr
|
||||
const _implements = 115216; TokenType[TokenType["_implements"] = _implements] = "_implements"; // implements keyword startsExpr
|
||||
})(TokenType || (TokenType = {}));
|
||||
export function formatTokenType(tokenType) {
|
||||
switch (tokenType) {
|
||||
case TokenType.num:
|
||||
return "num";
|
||||
case TokenType.bigint:
|
||||
return "bigint";
|
||||
case TokenType.decimal:
|
||||
return "decimal";
|
||||
case TokenType.regexp:
|
||||
return "regexp";
|
||||
case TokenType.string:
|
||||
return "string";
|
||||
case TokenType.name:
|
||||
return "name";
|
||||
case TokenType.eof:
|
||||
return "eof";
|
||||
case TokenType.bracketL:
|
||||
return "[";
|
||||
case TokenType.bracketR:
|
||||
return "]";
|
||||
case TokenType.braceL:
|
||||
return "{";
|
||||
case TokenType.braceBarL:
|
||||
return "{|";
|
||||
case TokenType.braceR:
|
||||
return "}";
|
||||
case TokenType.braceBarR:
|
||||
return "|}";
|
||||
case TokenType.parenL:
|
||||
return "(";
|
||||
case TokenType.parenR:
|
||||
return ")";
|
||||
case TokenType.comma:
|
||||
return ",";
|
||||
case TokenType.semi:
|
||||
return ";";
|
||||
case TokenType.colon:
|
||||
return ":";
|
||||
case TokenType.doubleColon:
|
||||
return "::";
|
||||
case TokenType.dot:
|
||||
return ".";
|
||||
case TokenType.question:
|
||||
return "?";
|
||||
case TokenType.questionDot:
|
||||
return "?.";
|
||||
case TokenType.arrow:
|
||||
return "=>";
|
||||
case TokenType.template:
|
||||
return "template";
|
||||
case TokenType.ellipsis:
|
||||
return "...";
|
||||
case TokenType.backQuote:
|
||||
return "`";
|
||||
case TokenType.dollarBraceL:
|
||||
return "${";
|
||||
case TokenType.at:
|
||||
return "@";
|
||||
case TokenType.hash:
|
||||
return "#";
|
||||
case TokenType.eq:
|
||||
return "=";
|
||||
case TokenType.assign:
|
||||
return "_=";
|
||||
case TokenType.preIncDec:
|
||||
return "++/--";
|
||||
case TokenType.postIncDec:
|
||||
return "++/--";
|
||||
case TokenType.bang:
|
||||
return "!";
|
||||
case TokenType.tilde:
|
||||
return "~";
|
||||
case TokenType.pipeline:
|
||||
return "|>";
|
||||
case TokenType.nullishCoalescing:
|
||||
return "??";
|
||||
case TokenType.logicalOR:
|
||||
return "||";
|
||||
case TokenType.logicalAND:
|
||||
return "&&";
|
||||
case TokenType.bitwiseOR:
|
||||
return "|";
|
||||
case TokenType.bitwiseXOR:
|
||||
return "^";
|
||||
case TokenType.bitwiseAND:
|
||||
return "&";
|
||||
case TokenType.equality:
|
||||
return "==/!=";
|
||||
case TokenType.lessThan:
|
||||
return "<";
|
||||
case TokenType.greaterThan:
|
||||
return ">";
|
||||
case TokenType.relationalOrEqual:
|
||||
return "<=/>=";
|
||||
case TokenType.bitShiftL:
|
||||
return "<<";
|
||||
case TokenType.bitShiftR:
|
||||
return ">>/>>>";
|
||||
case TokenType.plus:
|
||||
return "+";
|
||||
case TokenType.minus:
|
||||
return "-";
|
||||
case TokenType.modulo:
|
||||
return "%";
|
||||
case TokenType.star:
|
||||
return "*";
|
||||
case TokenType.slash:
|
||||
return "/";
|
||||
case TokenType.exponent:
|
||||
return "**";
|
||||
case TokenType.jsxName:
|
||||
return "jsxName";
|
||||
case TokenType.jsxText:
|
||||
return "jsxText";
|
||||
case TokenType.jsxEmptyText:
|
||||
return "jsxEmptyText";
|
||||
case TokenType.jsxTagStart:
|
||||
return "jsxTagStart";
|
||||
case TokenType.jsxTagEnd:
|
||||
return "jsxTagEnd";
|
||||
case TokenType.typeParameterStart:
|
||||
return "typeParameterStart";
|
||||
case TokenType.nonNullAssertion:
|
||||
return "nonNullAssertion";
|
||||
case TokenType._break:
|
||||
return "break";
|
||||
case TokenType._case:
|
||||
return "case";
|
||||
case TokenType._catch:
|
||||
return "catch";
|
||||
case TokenType._continue:
|
||||
return "continue";
|
||||
case TokenType._debugger:
|
||||
return "debugger";
|
||||
case TokenType._default:
|
||||
return "default";
|
||||
case TokenType._do:
|
||||
return "do";
|
||||
case TokenType._else:
|
||||
return "else";
|
||||
case TokenType._finally:
|
||||
return "finally";
|
||||
case TokenType._for:
|
||||
return "for";
|
||||
case TokenType._function:
|
||||
return "function";
|
||||
case TokenType._if:
|
||||
return "if";
|
||||
case TokenType._return:
|
||||
return "return";
|
||||
case TokenType._switch:
|
||||
return "switch";
|
||||
case TokenType._throw:
|
||||
return "throw";
|
||||
case TokenType._try:
|
||||
return "try";
|
||||
case TokenType._var:
|
||||
return "var";
|
||||
case TokenType._let:
|
||||
return "let";
|
||||
case TokenType._const:
|
||||
return "const";
|
||||
case TokenType._while:
|
||||
return "while";
|
||||
case TokenType._with:
|
||||
return "with";
|
||||
case TokenType._new:
|
||||
return "new";
|
||||
case TokenType._this:
|
||||
return "this";
|
||||
case TokenType._super:
|
||||
return "super";
|
||||
case TokenType._class:
|
||||
return "class";
|
||||
case TokenType._extends:
|
||||
return "extends";
|
||||
case TokenType._export:
|
||||
return "export";
|
||||
case TokenType._import:
|
||||
return "import";
|
||||
case TokenType._yield:
|
||||
return "yield";
|
||||
case TokenType._null:
|
||||
return "null";
|
||||
case TokenType._true:
|
||||
return "true";
|
||||
case TokenType._false:
|
||||
return "false";
|
||||
case TokenType._in:
|
||||
return "in";
|
||||
case TokenType._instanceof:
|
||||
return "instanceof";
|
||||
case TokenType._typeof:
|
||||
return "typeof";
|
||||
case TokenType._void:
|
||||
return "void";
|
||||
case TokenType._delete:
|
||||
return "delete";
|
||||
case TokenType._async:
|
||||
return "async";
|
||||
case TokenType._get:
|
||||
return "get";
|
||||
case TokenType._set:
|
||||
return "set";
|
||||
case TokenType._declare:
|
||||
return "declare";
|
||||
case TokenType._readonly:
|
||||
return "readonly";
|
||||
case TokenType._abstract:
|
||||
return "abstract";
|
||||
case TokenType._static:
|
||||
return "static";
|
||||
case TokenType._public:
|
||||
return "public";
|
||||
case TokenType._private:
|
||||
return "private";
|
||||
case TokenType._protected:
|
||||
return "protected";
|
||||
case TokenType._override:
|
||||
return "override";
|
||||
case TokenType._as:
|
||||
return "as";
|
||||
case TokenType._enum:
|
||||
return "enum";
|
||||
case TokenType._type:
|
||||
return "type";
|
||||
case TokenType._implements:
|
||||
return "implements";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
60
node_modules/sucrase/dist/esm/parser/traverser/base.js
generated
vendored
Normal file
60
node_modules/sucrase/dist/esm/parser/traverser/base.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
import State from "../tokenizer/state";
|
||||
import {charCodes} from "../util/charcodes";
|
||||
|
||||
export let isJSXEnabled;
|
||||
export let isTypeScriptEnabled;
|
||||
export let isFlowEnabled;
|
||||
export let state;
|
||||
export let input;
|
||||
export let nextContextId;
|
||||
|
||||
export function getNextContextId() {
|
||||
return nextContextId++;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function augmentError(error) {
|
||||
if ("pos" in error) {
|
||||
const loc = locationForIndex(error.pos);
|
||||
error.message += ` (${loc.line}:${loc.column})`;
|
||||
error.loc = loc;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
export class Loc {
|
||||
|
||||
|
||||
constructor(line, column) {
|
||||
this.line = line;
|
||||
this.column = column;
|
||||
}
|
||||
}
|
||||
|
||||
export function locationForIndex(pos) {
|
||||
let line = 1;
|
||||
let column = 1;
|
||||
for (let i = 0; i < pos; i++) {
|
||||
if (input.charCodeAt(i) === charCodes.lineFeed) {
|
||||
line++;
|
||||
column = 1;
|
||||
} else {
|
||||
column++;
|
||||
}
|
||||
}
|
||||
return new Loc(line, column);
|
||||
}
|
||||
|
||||
export function initParser(
|
||||
inputCode,
|
||||
isJSXEnabledArg,
|
||||
isTypeScriptEnabledArg,
|
||||
isFlowEnabledArg,
|
||||
) {
|
||||
input = inputCode;
|
||||
state = new State();
|
||||
nextContextId = 1;
|
||||
isJSXEnabled = isJSXEnabledArg;
|
||||
isTypeScriptEnabled = isTypeScriptEnabledArg;
|
||||
isFlowEnabled = isFlowEnabledArg;
|
||||
}
|
1022
node_modules/sucrase/dist/esm/parser/traverser/expression.js
generated
vendored
Normal file
1022
node_modules/sucrase/dist/esm/parser/traverser/expression.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18
node_modules/sucrase/dist/esm/parser/traverser/index.js
generated
vendored
Normal file
18
node_modules/sucrase/dist/esm/parser/traverser/index.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
import {nextToken, skipLineComment} from "../tokenizer/index";
|
||||
import {charCodes} from "../util/charcodes";
|
||||
import {input, state} from "./base";
|
||||
import {parseTopLevel} from "./statement";
|
||||
|
||||
export function parseFile() {
|
||||
// If enabled, skip leading hashbang line.
|
||||
if (
|
||||
state.pos === 0 &&
|
||||
input.charCodeAt(0) === charCodes.numberSign &&
|
||||
input.charCodeAt(1) === charCodes.exclamationMark
|
||||
) {
|
||||
skipLineComment(2);
|
||||
}
|
||||
nextToken();
|
||||
return parseTopLevel();
|
||||
}
|
159
node_modules/sucrase/dist/esm/parser/traverser/lval.js
generated
vendored
Normal file
159
node_modules/sucrase/dist/esm/parser/traverser/lval.js
generated
vendored
Normal file
@ -0,0 +1,159 @@
|
||||
import {flowParseAssignableListItemTypes} from "../plugins/flow";
|
||||
import {tsParseAssignableListItemTypes, tsParseModifiers} from "../plugins/typescript";
|
||||
import {
|
||||
eat,
|
||||
IdentifierRole,
|
||||
match,
|
||||
next,
|
||||
popTypeContext,
|
||||
pushTypeContext,
|
||||
} from "../tokenizer/index";
|
||||
import {ContextualKeyword} from "../tokenizer/keywords";
|
||||
import {TokenType, TokenType as tt} from "../tokenizer/types";
|
||||
import {isFlowEnabled, isTypeScriptEnabled, state} from "./base";
|
||||
import {parseIdentifier, parseMaybeAssign, parseObj} from "./expression";
|
||||
import {expect, unexpected} from "./util";
|
||||
|
||||
export function parseSpread() {
|
||||
next();
|
||||
parseMaybeAssign(false);
|
||||
}
|
||||
|
||||
export function parseRest(isBlockScope) {
|
||||
next();
|
||||
parseBindingAtom(isBlockScope);
|
||||
}
|
||||
|
||||
export function parseBindingIdentifier(isBlockScope) {
|
||||
parseIdentifier();
|
||||
markPriorBindingIdentifier(isBlockScope);
|
||||
}
|
||||
|
||||
export function parseImportedIdentifier() {
|
||||
parseIdentifier();
|
||||
state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;
|
||||
}
|
||||
|
||||
export function markPriorBindingIdentifier(isBlockScope) {
|
||||
let identifierRole;
|
||||
if (state.scopeDepth === 0) {
|
||||
identifierRole = IdentifierRole.TopLevelDeclaration;
|
||||
} else if (isBlockScope) {
|
||||
identifierRole = IdentifierRole.BlockScopedDeclaration;
|
||||
} else {
|
||||
identifierRole = IdentifierRole.FunctionScopedDeclaration;
|
||||
}
|
||||
state.tokens[state.tokens.length - 1].identifierRole = identifierRole;
|
||||
}
|
||||
|
||||
// Parses lvalue (assignable) atom.
|
||||
export function parseBindingAtom(isBlockScope) {
|
||||
switch (state.type) {
|
||||
case tt._this: {
|
||||
// In TypeScript, "this" may be the name of a parameter, so allow it.
|
||||
const oldIsType = pushTypeContext(0);
|
||||
next();
|
||||
popTypeContext(oldIsType);
|
||||
return;
|
||||
}
|
||||
|
||||
case tt._yield:
|
||||
case tt.name: {
|
||||
state.type = tt.name;
|
||||
parseBindingIdentifier(isBlockScope);
|
||||
return;
|
||||
}
|
||||
|
||||
case tt.bracketL: {
|
||||
next();
|
||||
parseBindingList(tt.bracketR, isBlockScope, true /* allowEmpty */);
|
||||
return;
|
||||
}
|
||||
|
||||
case tt.braceL:
|
||||
parseObj(true, isBlockScope);
|
||||
return;
|
||||
|
||||
default:
|
||||
unexpected();
|
||||
}
|
||||
}
|
||||
|
||||
export function parseBindingList(
|
||||
close,
|
||||
isBlockScope,
|
||||
allowEmpty = false,
|
||||
allowModifiers = false,
|
||||
contextId = 0,
|
||||
) {
|
||||
let first = true;
|
||||
|
||||
let hasRemovedComma = false;
|
||||
const firstItemTokenIndex = state.tokens.length;
|
||||
|
||||
while (!eat(close) && !state.error) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
expect(tt.comma);
|
||||
state.tokens[state.tokens.length - 1].contextId = contextId;
|
||||
// After a "this" type in TypeScript, we need to set the following comma (if any) to also be
|
||||
// a type token so that it will be removed.
|
||||
if (!hasRemovedComma && state.tokens[firstItemTokenIndex].isType) {
|
||||
state.tokens[state.tokens.length - 1].isType = true;
|
||||
hasRemovedComma = true;
|
||||
}
|
||||
}
|
||||
if (allowEmpty && match(tt.comma)) {
|
||||
// Empty item; nothing further to parse for this item.
|
||||
} else if (eat(close)) {
|
||||
break;
|
||||
} else if (match(tt.ellipsis)) {
|
||||
parseRest(isBlockScope);
|
||||
parseAssignableListItemTypes();
|
||||
// Support rest element trailing commas allowed by TypeScript <2.9.
|
||||
eat(TokenType.comma);
|
||||
expect(close);
|
||||
break;
|
||||
} else {
|
||||
parseAssignableListItem(allowModifiers, isBlockScope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parseAssignableListItem(allowModifiers, isBlockScope) {
|
||||
if (allowModifiers) {
|
||||
tsParseModifiers([
|
||||
ContextualKeyword._public,
|
||||
ContextualKeyword._protected,
|
||||
ContextualKeyword._private,
|
||||
ContextualKeyword._readonly,
|
||||
ContextualKeyword._override,
|
||||
]);
|
||||
}
|
||||
|
||||
parseMaybeDefault(isBlockScope);
|
||||
parseAssignableListItemTypes();
|
||||
parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */);
|
||||
}
|
||||
|
||||
function parseAssignableListItemTypes() {
|
||||
if (isFlowEnabled) {
|
||||
flowParseAssignableListItemTypes();
|
||||
} else if (isTypeScriptEnabled) {
|
||||
tsParseAssignableListItemTypes();
|
||||
}
|
||||
}
|
||||
|
||||
// Parses assignment pattern around given atom if possible.
|
||||
export function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) {
|
||||
if (!leftAlreadyParsed) {
|
||||
parseBindingAtom(isBlockScope);
|
||||
}
|
||||
if (!eat(tt.eq)) {
|
||||
return;
|
||||
}
|
||||
const eqIndex = state.tokens.length - 1;
|
||||
parseMaybeAssign();
|
||||
state.tokens[eqIndex].rhsEndIndex = state.tokens.length;
|
||||
}
|
1332
node_modules/sucrase/dist/esm/parser/traverser/statement.js
generated
vendored
Normal file
1332
node_modules/sucrase/dist/esm/parser/traverser/statement.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
104
node_modules/sucrase/dist/esm/parser/traverser/util.js
generated
vendored
Normal file
104
node_modules/sucrase/dist/esm/parser/traverser/util.js
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
import {eat, finishToken, lookaheadTypeAndKeyword, match, nextTokenStart} from "../tokenizer/index";
|
||||
|
||||
import {formatTokenType, TokenType as tt} from "../tokenizer/types";
|
||||
import {charCodes} from "../util/charcodes";
|
||||
import {input, state} from "./base";
|
||||
|
||||
// ## Parser utilities
|
||||
|
||||
// Tests whether parsed token is a contextual keyword.
|
||||
export function isContextual(contextualKeyword) {
|
||||
return state.contextualKeyword === contextualKeyword;
|
||||
}
|
||||
|
||||
export function isLookaheadContextual(contextualKeyword) {
|
||||
const l = lookaheadTypeAndKeyword();
|
||||
return l.type === tt.name && l.contextualKeyword === contextualKeyword;
|
||||
}
|
||||
|
||||
// Consumes contextual keyword if possible.
|
||||
export function eatContextual(contextualKeyword) {
|
||||
return state.contextualKeyword === contextualKeyword && eat(tt.name);
|
||||
}
|
||||
|
||||
// Asserts that following token is given contextual keyword.
|
||||
export function expectContextual(contextualKeyword) {
|
||||
if (!eatContextual(contextualKeyword)) {
|
||||
unexpected();
|
||||
}
|
||||
}
|
||||
|
||||
// Test whether a semicolon can be inserted at the current position.
|
||||
export function canInsertSemicolon() {
|
||||
return match(tt.eof) || match(tt.braceR) || hasPrecedingLineBreak();
|
||||
}
|
||||
|
||||
export function hasPrecedingLineBreak() {
|
||||
const prevToken = state.tokens[state.tokens.length - 1];
|
||||
const lastTokEnd = prevToken ? prevToken.end : 0;
|
||||
for (let i = lastTokEnd; i < state.start; i++) {
|
||||
const code = input.charCodeAt(i);
|
||||
if (
|
||||
code === charCodes.lineFeed ||
|
||||
code === charCodes.carriageReturn ||
|
||||
code === 0x2028 ||
|
||||
code === 0x2029
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function hasFollowingLineBreak() {
|
||||
const nextStart = nextTokenStart();
|
||||
for (let i = state.end; i < nextStart; i++) {
|
||||
const code = input.charCodeAt(i);
|
||||
if (
|
||||
code === charCodes.lineFeed ||
|
||||
code === charCodes.carriageReturn ||
|
||||
code === 0x2028 ||
|
||||
code === 0x2029
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isLineTerminator() {
|
||||
return eat(tt.semi) || canInsertSemicolon();
|
||||
}
|
||||
|
||||
// Consume a semicolon, or, failing that, see if we are allowed to
|
||||
// pretend that there is a semicolon at this position.
|
||||
export function semicolon() {
|
||||
if (!isLineTerminator()) {
|
||||
unexpected('Unexpected token, expected ";"');
|
||||
}
|
||||
}
|
||||
|
||||
// Expect a token of a given type. If found, consume it, otherwise,
|
||||
// raise an unexpected token error at given pos.
|
||||
export function expect(type) {
|
||||
const matched = eat(type);
|
||||
if (!matched) {
|
||||
unexpected(`Unexpected token, expected "${formatTokenType(type)}"`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Transition the parser to an error state. All code needs to be written to naturally unwind in this
|
||||
* state, which allows us to backtrack without exceptions and without error plumbing everywhere.
|
||||
*/
|
||||
export function unexpected(message = "Unexpected token", pos = state.start) {
|
||||
if (state.error) {
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const err = new SyntaxError(message);
|
||||
err.pos = pos;
|
||||
state.error = err;
|
||||
state.pos = input.length;
|
||||
finishToken(tt.eof);
|
||||
}
|
115
node_modules/sucrase/dist/esm/parser/util/charcodes.js
generated
vendored
Normal file
115
node_modules/sucrase/dist/esm/parser/util/charcodes.js
generated
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
export var charCodes; (function (charCodes) {
|
||||
const backSpace = 8; charCodes[charCodes["backSpace"] = backSpace] = "backSpace";
|
||||
const lineFeed = 10; charCodes[charCodes["lineFeed"] = lineFeed] = "lineFeed"; // '\n'
|
||||
const tab = 9; charCodes[charCodes["tab"] = tab] = "tab"; // '\t'
|
||||
const carriageReturn = 13; charCodes[charCodes["carriageReturn"] = carriageReturn] = "carriageReturn"; // '\r'
|
||||
const shiftOut = 14; charCodes[charCodes["shiftOut"] = shiftOut] = "shiftOut";
|
||||
const space = 32; charCodes[charCodes["space"] = space] = "space";
|
||||
const exclamationMark = 33; charCodes[charCodes["exclamationMark"] = exclamationMark] = "exclamationMark"; // '!'
|
||||
const quotationMark = 34; charCodes[charCodes["quotationMark"] = quotationMark] = "quotationMark"; // '"'
|
||||
const numberSign = 35; charCodes[charCodes["numberSign"] = numberSign] = "numberSign"; // '#'
|
||||
const dollarSign = 36; charCodes[charCodes["dollarSign"] = dollarSign] = "dollarSign"; // '$'
|
||||
const percentSign = 37; charCodes[charCodes["percentSign"] = percentSign] = "percentSign"; // '%'
|
||||
const ampersand = 38; charCodes[charCodes["ampersand"] = ampersand] = "ampersand"; // '&'
|
||||
const apostrophe = 39; charCodes[charCodes["apostrophe"] = apostrophe] = "apostrophe"; // '''
|
||||
const leftParenthesis = 40; charCodes[charCodes["leftParenthesis"] = leftParenthesis] = "leftParenthesis"; // '('
|
||||
const rightParenthesis = 41; charCodes[charCodes["rightParenthesis"] = rightParenthesis] = "rightParenthesis"; // ')'
|
||||
const asterisk = 42; charCodes[charCodes["asterisk"] = asterisk] = "asterisk"; // '*'
|
||||
const plusSign = 43; charCodes[charCodes["plusSign"] = plusSign] = "plusSign"; // '+'
|
||||
const comma = 44; charCodes[charCodes["comma"] = comma] = "comma"; // ','
|
||||
const dash = 45; charCodes[charCodes["dash"] = dash] = "dash"; // '-'
|
||||
const dot = 46; charCodes[charCodes["dot"] = dot] = "dot"; // '.'
|
||||
const slash = 47; charCodes[charCodes["slash"] = slash] = "slash"; // '/'
|
||||
const digit0 = 48; charCodes[charCodes["digit0"] = digit0] = "digit0"; // '0'
|
||||
const digit1 = 49; charCodes[charCodes["digit1"] = digit1] = "digit1"; // '1'
|
||||
const digit2 = 50; charCodes[charCodes["digit2"] = digit2] = "digit2"; // '2'
|
||||
const digit3 = 51; charCodes[charCodes["digit3"] = digit3] = "digit3"; // '3'
|
||||
const digit4 = 52; charCodes[charCodes["digit4"] = digit4] = "digit4"; // '4'
|
||||
const digit5 = 53; charCodes[charCodes["digit5"] = digit5] = "digit5"; // '5'
|
||||
const digit6 = 54; charCodes[charCodes["digit6"] = digit6] = "digit6"; // '6'
|
||||
const digit7 = 55; charCodes[charCodes["digit7"] = digit7] = "digit7"; // '7'
|
||||
const digit8 = 56; charCodes[charCodes["digit8"] = digit8] = "digit8"; // '8'
|
||||
const digit9 = 57; charCodes[charCodes["digit9"] = digit9] = "digit9"; // '9'
|
||||
const colon = 58; charCodes[charCodes["colon"] = colon] = "colon"; // ':'
|
||||
const semicolon = 59; charCodes[charCodes["semicolon"] = semicolon] = "semicolon"; // ';'
|
||||
const lessThan = 60; charCodes[charCodes["lessThan"] = lessThan] = "lessThan"; // '<'
|
||||
const equalsTo = 61; charCodes[charCodes["equalsTo"] = equalsTo] = "equalsTo"; // '='
|
||||
const greaterThan = 62; charCodes[charCodes["greaterThan"] = greaterThan] = "greaterThan"; // '>'
|
||||
const questionMark = 63; charCodes[charCodes["questionMark"] = questionMark] = "questionMark"; // '?'
|
||||
const atSign = 64; charCodes[charCodes["atSign"] = atSign] = "atSign"; // '@'
|
||||
const uppercaseA = 65; charCodes[charCodes["uppercaseA"] = uppercaseA] = "uppercaseA"; // 'A'
|
||||
const uppercaseB = 66; charCodes[charCodes["uppercaseB"] = uppercaseB] = "uppercaseB"; // 'B'
|
||||
const uppercaseC = 67; charCodes[charCodes["uppercaseC"] = uppercaseC] = "uppercaseC"; // 'C'
|
||||
const uppercaseD = 68; charCodes[charCodes["uppercaseD"] = uppercaseD] = "uppercaseD"; // 'D'
|
||||
const uppercaseE = 69; charCodes[charCodes["uppercaseE"] = uppercaseE] = "uppercaseE"; // 'E'
|
||||
const uppercaseF = 70; charCodes[charCodes["uppercaseF"] = uppercaseF] = "uppercaseF"; // 'F'
|
||||
const uppercaseG = 71; charCodes[charCodes["uppercaseG"] = uppercaseG] = "uppercaseG"; // 'G'
|
||||
const uppercaseH = 72; charCodes[charCodes["uppercaseH"] = uppercaseH] = "uppercaseH"; // 'H'
|
||||
const uppercaseI = 73; charCodes[charCodes["uppercaseI"] = uppercaseI] = "uppercaseI"; // 'I'
|
||||
const uppercaseJ = 74; charCodes[charCodes["uppercaseJ"] = uppercaseJ] = "uppercaseJ"; // 'J'
|
||||
const uppercaseK = 75; charCodes[charCodes["uppercaseK"] = uppercaseK] = "uppercaseK"; // 'K'
|
||||
const uppercaseL = 76; charCodes[charCodes["uppercaseL"] = uppercaseL] = "uppercaseL"; // 'L'
|
||||
const uppercaseM = 77; charCodes[charCodes["uppercaseM"] = uppercaseM] = "uppercaseM"; // 'M'
|
||||
const uppercaseN = 78; charCodes[charCodes["uppercaseN"] = uppercaseN] = "uppercaseN"; // 'N'
|
||||
const uppercaseO = 79; charCodes[charCodes["uppercaseO"] = uppercaseO] = "uppercaseO"; // 'O'
|
||||
const uppercaseP = 80; charCodes[charCodes["uppercaseP"] = uppercaseP] = "uppercaseP"; // 'P'
|
||||
const uppercaseQ = 81; charCodes[charCodes["uppercaseQ"] = uppercaseQ] = "uppercaseQ"; // 'Q'
|
||||
const uppercaseR = 82; charCodes[charCodes["uppercaseR"] = uppercaseR] = "uppercaseR"; // 'R'
|
||||
const uppercaseS = 83; charCodes[charCodes["uppercaseS"] = uppercaseS] = "uppercaseS"; // 'S'
|
||||
const uppercaseT = 84; charCodes[charCodes["uppercaseT"] = uppercaseT] = "uppercaseT"; // 'T'
|
||||
const uppercaseU = 85; charCodes[charCodes["uppercaseU"] = uppercaseU] = "uppercaseU"; // 'U'
|
||||
const uppercaseV = 86; charCodes[charCodes["uppercaseV"] = uppercaseV] = "uppercaseV"; // 'V'
|
||||
const uppercaseW = 87; charCodes[charCodes["uppercaseW"] = uppercaseW] = "uppercaseW"; // 'W'
|
||||
const uppercaseX = 88; charCodes[charCodes["uppercaseX"] = uppercaseX] = "uppercaseX"; // 'X'
|
||||
const uppercaseY = 89; charCodes[charCodes["uppercaseY"] = uppercaseY] = "uppercaseY"; // 'Y'
|
||||
const uppercaseZ = 90; charCodes[charCodes["uppercaseZ"] = uppercaseZ] = "uppercaseZ"; // 'Z'
|
||||
const leftSquareBracket = 91; charCodes[charCodes["leftSquareBracket"] = leftSquareBracket] = "leftSquareBracket"; // '['
|
||||
const backslash = 92; charCodes[charCodes["backslash"] = backslash] = "backslash"; // '\ '
|
||||
const rightSquareBracket = 93; charCodes[charCodes["rightSquareBracket"] = rightSquareBracket] = "rightSquareBracket"; // ']'
|
||||
const caret = 94; charCodes[charCodes["caret"] = caret] = "caret"; // '^'
|
||||
const underscore = 95; charCodes[charCodes["underscore"] = underscore] = "underscore"; // '_'
|
||||
const graveAccent = 96; charCodes[charCodes["graveAccent"] = graveAccent] = "graveAccent"; // '`'
|
||||
const lowercaseA = 97; charCodes[charCodes["lowercaseA"] = lowercaseA] = "lowercaseA"; // 'a'
|
||||
const lowercaseB = 98; charCodes[charCodes["lowercaseB"] = lowercaseB] = "lowercaseB"; // 'b'
|
||||
const lowercaseC = 99; charCodes[charCodes["lowercaseC"] = lowercaseC] = "lowercaseC"; // 'c'
|
||||
const lowercaseD = 100; charCodes[charCodes["lowercaseD"] = lowercaseD] = "lowercaseD"; // 'd'
|
||||
const lowercaseE = 101; charCodes[charCodes["lowercaseE"] = lowercaseE] = "lowercaseE"; // 'e'
|
||||
const lowercaseF = 102; charCodes[charCodes["lowercaseF"] = lowercaseF] = "lowercaseF"; // 'f'
|
||||
const lowercaseG = 103; charCodes[charCodes["lowercaseG"] = lowercaseG] = "lowercaseG"; // 'g'
|
||||
const lowercaseH = 104; charCodes[charCodes["lowercaseH"] = lowercaseH] = "lowercaseH"; // 'h'
|
||||
const lowercaseI = 105; charCodes[charCodes["lowercaseI"] = lowercaseI] = "lowercaseI"; // 'i'
|
||||
const lowercaseJ = 106; charCodes[charCodes["lowercaseJ"] = lowercaseJ] = "lowercaseJ"; // 'j'
|
||||
const lowercaseK = 107; charCodes[charCodes["lowercaseK"] = lowercaseK] = "lowercaseK"; // 'k'
|
||||
const lowercaseL = 108; charCodes[charCodes["lowercaseL"] = lowercaseL] = "lowercaseL"; // 'l'
|
||||
const lowercaseM = 109; charCodes[charCodes["lowercaseM"] = lowercaseM] = "lowercaseM"; // 'm'
|
||||
const lowercaseN = 110; charCodes[charCodes["lowercaseN"] = lowercaseN] = "lowercaseN"; // 'n'
|
||||
const lowercaseO = 111; charCodes[charCodes["lowercaseO"] = lowercaseO] = "lowercaseO"; // 'o'
|
||||
const lowercaseP = 112; charCodes[charCodes["lowercaseP"] = lowercaseP] = "lowercaseP"; // 'p'
|
||||
const lowercaseQ = 113; charCodes[charCodes["lowercaseQ"] = lowercaseQ] = "lowercaseQ"; // 'q'
|
||||
const lowercaseR = 114; charCodes[charCodes["lowercaseR"] = lowercaseR] = "lowercaseR"; // 'r'
|
||||
const lowercaseS = 115; charCodes[charCodes["lowercaseS"] = lowercaseS] = "lowercaseS"; // 's'
|
||||
const lowercaseT = 116; charCodes[charCodes["lowercaseT"] = lowercaseT] = "lowercaseT"; // 't'
|
||||
const lowercaseU = 117; charCodes[charCodes["lowercaseU"] = lowercaseU] = "lowercaseU"; // 'u'
|
||||
const lowercaseV = 118; charCodes[charCodes["lowercaseV"] = lowercaseV] = "lowercaseV"; // 'v'
|
||||
const lowercaseW = 119; charCodes[charCodes["lowercaseW"] = lowercaseW] = "lowercaseW"; // 'w'
|
||||
const lowercaseX = 120; charCodes[charCodes["lowercaseX"] = lowercaseX] = "lowercaseX"; // 'x'
|
||||
const lowercaseY = 121; charCodes[charCodes["lowercaseY"] = lowercaseY] = "lowercaseY"; // 'y'
|
||||
const lowercaseZ = 122; charCodes[charCodes["lowercaseZ"] = lowercaseZ] = "lowercaseZ"; // 'z'
|
||||
const leftCurlyBrace = 123; charCodes[charCodes["leftCurlyBrace"] = leftCurlyBrace] = "leftCurlyBrace"; // '{'
|
||||
const verticalBar = 124; charCodes[charCodes["verticalBar"] = verticalBar] = "verticalBar"; // '|'
|
||||
const rightCurlyBrace = 125; charCodes[charCodes["rightCurlyBrace"] = rightCurlyBrace] = "rightCurlyBrace"; // '}'
|
||||
const tilde = 126; charCodes[charCodes["tilde"] = tilde] = "tilde"; // '~'
|
||||
const nonBreakingSpace = 160; charCodes[charCodes["nonBreakingSpace"] = nonBreakingSpace] = "nonBreakingSpace";
|
||||
// eslint-disable-next-line no-irregular-whitespace
|
||||
const oghamSpaceMark = 5760; charCodes[charCodes["oghamSpaceMark"] = oghamSpaceMark] = "oghamSpaceMark"; // ' '
|
||||
const lineSeparator = 8232; charCodes[charCodes["lineSeparator"] = lineSeparator] = "lineSeparator";
|
||||
const paragraphSeparator = 8233; charCodes[charCodes["paragraphSeparator"] = paragraphSeparator] = "paragraphSeparator";
|
||||
})(charCodes || (charCodes = {}));
|
||||
|
||||
export function isDigit(code) {
|
||||
return (
|
||||
(code >= charCodes.digit0 && code <= charCodes.digit9) ||
|
||||
(code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) ||
|
||||
(code >= charCodes.uppercaseA && code <= charCodes.uppercaseF)
|
||||
);
|
||||
}
|
34
node_modules/sucrase/dist/esm/parser/util/identifier.js
generated
vendored
Normal file
34
node_modules/sucrase/dist/esm/parser/util/identifier.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
import {charCodes} from "./charcodes";
|
||||
import {WHITESPACE_CHARS} from "./whitespace";
|
||||
|
||||
function computeIsIdentifierChar(code) {
|
||||
if (code < 48) return code === 36;
|
||||
if (code < 58) return true;
|
||||
if (code < 65) return false;
|
||||
if (code < 91) return true;
|
||||
if (code < 97) return code === 95;
|
||||
if (code < 123) return true;
|
||||
if (code < 128) return false;
|
||||
throw new Error("Should not be called with non-ASCII char code.");
|
||||
}
|
||||
|
||||
export const IS_IDENTIFIER_CHAR = new Uint8Array(65536);
|
||||
for (let i = 0; i < 128; i++) {
|
||||
IS_IDENTIFIER_CHAR[i] = computeIsIdentifierChar(i) ? 1 : 0;
|
||||
}
|
||||
for (let i = 128; i < 65536; i++) {
|
||||
IS_IDENTIFIER_CHAR[i] = 1;
|
||||
}
|
||||
// Aside from whitespace and newlines, all characters outside the ASCII space are either
|
||||
// identifier characters or invalid. Since we're not performing code validation, we can just
|
||||
// treat all invalid characters as identifier characters.
|
||||
for (const whitespaceChar of WHITESPACE_CHARS) {
|
||||
IS_IDENTIFIER_CHAR[whitespaceChar] = 0;
|
||||
}
|
||||
IS_IDENTIFIER_CHAR[0x2028] = 0;
|
||||
IS_IDENTIFIER_CHAR[0x2029] = 0;
|
||||
|
||||
export const IS_IDENTIFIER_START = IS_IDENTIFIER_CHAR.slice();
|
||||
for (let numChar = charCodes.digit0; numChar <= charCodes.digit9; numChar++) {
|
||||
IS_IDENTIFIER_START[numChar] = 0;
|
||||
}
|
33
node_modules/sucrase/dist/esm/parser/util/whitespace.js
generated
vendored
Normal file
33
node_modules/sucrase/dist/esm/parser/util/whitespace.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
import {charCodes} from "./charcodes";
|
||||
|
||||
// https://tc39.github.io/ecma262/#sec-white-space
|
||||
export const WHITESPACE_CHARS = [
|
||||
0x0009,
|
||||
0x000b,
|
||||
0x000c,
|
||||
charCodes.space,
|
||||
charCodes.nonBreakingSpace,
|
||||
charCodes.oghamSpaceMark,
|
||||
0x2000, // EN QUAD
|
||||
0x2001, // EM QUAD
|
||||
0x2002, // EN SPACE
|
||||
0x2003, // EM SPACE
|
||||
0x2004, // THREE-PER-EM SPACE
|
||||
0x2005, // FOUR-PER-EM SPACE
|
||||
0x2006, // SIX-PER-EM SPACE
|
||||
0x2007, // FIGURE SPACE
|
||||
0x2008, // PUNCTUATION SPACE
|
||||
0x2009, // THIN SPACE
|
||||
0x200a, // HAIR SPACE
|
||||
0x202f, // NARROW NO-BREAK SPACE
|
||||
0x205f, // MEDIUM MATHEMATICAL SPACE
|
||||
0x3000, // IDEOGRAPHIC SPACE
|
||||
0xfeff, // ZERO WIDTH NO-BREAK SPACE
|
||||
];
|
||||
|
||||
export const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
||||
|
||||
export const IS_WHITESPACE = new Uint8Array(65536);
|
||||
for (const char of WHITESPACE_CHARS) {
|
||||
IS_WHITESPACE[char] = 1;
|
||||
}
|
Reference in New Issue
Block a user