@babel/parser
Version:
A JavaScript parser
1,311 lines (1,310 loc) • 492 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
class Position {
constructor(line, col, index) {
this.line = void 0;
this.column = void 0;
this.index = void 0;
this.line = line;
this.column = col;
this.index = index;
}
}
class SourceLocation {
constructor(start, end) {
this.start = void 0;
this.end = void 0;
this.filename = void 0;
this.identifierName = void 0;
this.start = start;
this.end = end;
}
}
function createPositionWithColumnOffset(position, columnOffset) {
const {
line,
column,
index
} = position;
return new Position(line, column + columnOffset, index + columnOffset);
}
var ParseErrorCode = {
SyntaxError: "BABEL_PARSER_SYNTAX_ERROR",
SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
};
const reflect = (keys, last = keys.length - 1) => ({
get() {
return keys.reduce((object, key) => object[key], this);
},
set(value) {
keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this);
}
});
const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? {
value: descriptor,
enumerable: false
} : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({
configurable: true
}, descriptor)), Object.assign(new constructor(), properties));
var ModuleErrors = {
ImportMetaOutsideModule: {
message: `import.meta may appear only with 'sourceType: "module"'`,
code: ParseErrorCode.SourceTypeModuleError
},
ImportOutsideModule: {
message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
code: ParseErrorCode.SourceTypeModuleError
}
};
const NodeDescriptions = {
ArrayPattern: "array destructuring pattern",
AssignmentExpression: "assignment expression",
AssignmentPattern: "assignment expression",
ArrowFunctionExpression: "arrow function expression",
ConditionalExpression: "conditional expression",
CatchClause: "catch clause",
ForOfStatement: "for-of statement",
ForInStatement: "for-in statement",
ForStatement: "for-loop",
FormalParameters: "function parameter list",
Identifier: "identifier",
ImportSpecifier: "import specifier",
ImportDefaultSpecifier: "import default specifier",
ImportNamespaceSpecifier: "import namespace specifier",
ObjectPattern: "object destructuring pattern",
ParenthesizedExpression: "parenthesized expression",
RestElement: "rest element",
UpdateExpression: {
true: "prefix operation",
false: "postfix operation"
},
VariableDeclarator: "variable declaration",
YieldExpression: "yield expression"
};
const toNodeDescription = ({
type,
prefix
}) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type];
var StandardErrors = {
AccessorIsGenerator: ({
kind
}) => `A ${kind}ter cannot be a generator.`,
ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.",
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
ConstructorClassField: "Classes may not have a field named 'constructor'.",
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
ConstructorIsAccessor: "Class constructor may not be an accessor.",
ConstructorIsAsync: "Constructor can't be an async function.",
ConstructorIsGenerator: "Constructor can't be a generator.",
DeclarationMissingInitializer: ({
kind
}) => `Missing initializer in ${kind} declaration.`,
DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",
DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",
DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
DecoratorStaticBlock: "Decorators can't be used with a static block.",
DeletePrivateField: "Deleting a private field is not allowed.",
DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
DuplicateConstructor: "Duplicate constructor in the same class.",
DuplicateDefaultExport: "Only one default export allowed per module.",
DuplicateExport: ({
exportName
}) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`,
DuplicateProto: "Redefinition of __proto__ property.",
DuplicateRegExpFlags: "Duplicate regular expression flag.",
ElementAfterRest: "Rest element must be last element.",
EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
ExportBindingIsString: ({
localName,
exportName
}) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
ForInOfLoopInitializer: ({
type
}) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
ForInUsing: "For-in loop may not start with 'using' declaration.",
ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
IllegalBreakContinue: ({
type
}) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`,
IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
IllegalReturn: "'return' outside of function.",
ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",
ImportBindingIsString: ({
importName
}) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`,
ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.",
ImportCallArity: ({
maxArgumentCount
}) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`,
ImportCallNotNewExpression: "Cannot use new with import(...).",
ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
ImportReflectionHasAssertion: "`import module x` cannot have assertions.",
ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.',
IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
InvalidBigIntLiteral: "Invalid BigIntLiteral.",
InvalidCodePoint: "Code point out of bounds.",
InvalidCoverInitializedName: "Invalid shorthand property initializer.",
InvalidDecimal: "Invalid decimal.",
InvalidDigit: ({
radix
}) => `Expected number in radix ${radix}.`,
InvalidEscapeSequence: "Bad character escape sequence.",
InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
InvalidEscapedReservedWord: ({
reservedWord
}) => `Escape sequence in keyword ${reservedWord}.`,
InvalidIdentifier: ({
identifierName
}) => `Invalid identifier ${identifierName}.`,
InvalidLhs: ({
ancestor
}) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,
InvalidLhsBinding: ({
ancestor
}) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,
InvalidNumber: "Invalid number.",
InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
InvalidOrUnexpectedToken: ({
unexpected
}) => `Unexpected character '${unexpected}'.`,
InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
InvalidPrivateFieldResolution: ({
identifierName
}) => `Private name #${identifierName} is not defined.`,
InvalidPropertyBindingPattern: "Binding member expression.",
InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
LabelRedeclaration: ({
labelName
}) => `Label '${labelName}' is already declared.`,
LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
MalformedRegExpFlags: "Invalid regular expression flag.",
MissingClassName: "A class name is required.",
MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
MissingSemicolon: "Missing semicolon.",
MissingPlugin: ({
missingPlugin
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
MissingOneOfPlugins: ({
missingPlugin
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
ModuleAttributesWithDuplicateKeys: ({
key
}) => `Duplicate key "${key}" is not allowed in module attributes.`,
ModuleExportNameHasLoneSurrogate: ({
surrogateCharCode
}) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`,
ModuleExportUndefined: ({
localName
}) => `Export '${localName}' is not defined.`,
MultipleDefaultsInSwitch: "Multiple default clauses.",
NewlineAfterThrow: "Illegal newline after throw.",
NoCatchOrFinally: "Missing catch or finally clause.",
NumberIdentifier: "Identifier directly after number.",
NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
ParamDupe: "Argument name clash.",
PatternHasAccessor: "Object pattern can't contain getter or setter.",
PatternHasMethod: "Object pattern can't contain methods.",
PrivateInExpectedIn: ({
identifierName
}) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`,
PrivateNameRedeclaration: ({
identifierName
}) => `Duplicate private name #${identifierName}.`,
RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
RecordNoProto: "'__proto__' is not allowed in Record expressions.",
RestTrailingComma: "Unexpected trailing comma after rest element.",
SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.",
SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
StaticPrototype: "Classes may not have static property named prototype.",
SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
SuperPrivateField: "Private fields can't be accessed on super.",
TrailingDecorator: "Decorators must be attached to a class element.",
TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
UnexpectedKeyword: ({
keyword
}) => `Unexpected keyword '${keyword}'.`,
UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
UnexpectedPrivateField: "Unexpected private name.",
UnexpectedReservedWord: ({
reservedWord
}) => `Unexpected reserved word '${reservedWord}'.`,
UnexpectedSuper: "'super' is only allowed in object methods and classes.",
UnexpectedToken: ({
expected,
unexpected
}) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.",
UnsupportedBind: "Binding should be performed on object property.",
UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
UnsupportedMetaProperty: ({
target,
onlyValidPropertyName
}) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,
UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
UnterminatedComment: "Unterminated comment.",
UnterminatedRegExp: "Unterminated regular expression.",
UnterminatedString: "Unterminated string constant.",
UnterminatedTemplate: "Unterminated template.",
UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.",
VarRedeclaration: ({
identifierName
}) => `Identifier '${identifierName}' has already been declared.`,
YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
YieldInParameter: "Yield expression is not allowed in formal parameters.",
ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
};
var StrictModeErrors = {
StrictDelete: "Deleting local variable in strict mode.",
StrictEvalArguments: ({
referenceName
}) => `Assigning to '${referenceName}' in strict mode.`,
StrictEvalArgumentsBinding: ({
bindingName
}) => `Binding '${bindingName}' in strict mode.`,
StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
StrictWith: "'with' in strict mode."
};
const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
var PipelineOperatorErrors = {
PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
PipeTopicUnconfiguredToken: ({
token
}) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
PipeUnparenthesizedBody: ({
type
}) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({
type
})}; please wrap it in parentheses.`,
PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
};
const _excluded$1 = ["toMessage"],
_excluded2$1 = ["message"];
function toParseErrorConstructor(_ref) {
let {
toMessage
} = _ref,
properties = _objectWithoutPropertiesLoose(_ref, _excluded$1);
return function constructor({
loc,
details
}) {
return instantiate(SyntaxError, Object.assign({}, properties, {
loc
}), {
clone(overrides = {}) {
const loc = overrides.loc || {};
return constructor({
loc: new Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index),
details: Object.assign({}, this.details, overrides.details)
});
},
details: {
value: details,
enumerable: false
},
message: {
get() {
return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`;
},
set(value) {
Object.defineProperty(this, "message", {
value
});
}
},
pos: {
reflect: "loc.index",
enumerable: true
},
missingPlugin: "missingPlugin" in details && {
reflect: "details.missingPlugin",
enumerable: true
}
});
};
}
function ParseErrorEnum(argument, syntaxPlugin) {
if (Array.isArray(argument)) {
return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]);
}
const ParseErrorConstructors = {};
for (const reasonCode of Object.keys(argument)) {
const template = argument[reasonCode];
const _ref2 = typeof template === "string" ? {
message: () => template
} : typeof template === "function" ? {
message: template
} : template,
{
message
} = _ref2,
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);
const toMessage = typeof message === "string" ? () => message : message;
ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
code: ParseErrorCode.SyntaxError,
reasonCode,
toMessage
}, syntaxPlugin ? {
syntaxPlugin
} : {}, rest));
}
return ParseErrorConstructors;
}
const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
const {
defineProperty
} = Object;
const toUnenumerable = (object, key) => defineProperty(object, key, {
enumerable: false,
value: object[key]
});
function toESTreeLocation(node) {
node.loc.start && toUnenumerable(node.loc.start, "index");
node.loc.end && toUnenumerable(node.loc.end, "index");
return node;
}
var estree = superClass => class ESTreeParserMixin extends superClass {
parse() {
const file = toESTreeLocation(super.parse());
if (this.options.tokens) {
file.tokens = file.tokens.map(toESTreeLocation);
}
return file;
}
parseRegExpLiteral({
pattern,
flags
}) {
let regex = null;
try {
regex = new RegExp(pattern, flags);
} catch (e) {}
const node = this.estreeParseLiteral(regex);
node.regex = {
pattern,
flags
};
return node;
}
parseBigIntLiteral(value) {
let bigInt;
try {
bigInt = BigInt(value);
} catch (_unused) {
bigInt = null;
}
const node = this.estreeParseLiteral(bigInt);
node.bigint = String(node.value || value);
return node;
}
parseDecimalLiteral(value) {
const decimal = null;
const node = this.estreeParseLiteral(decimal);
node.decimal = String(node.value || value);
return node;
}
estreeParseLiteral(value) {
return this.parseLiteral(value, "Literal");
}
parseStringLiteral(value) {
return this.estreeParseLiteral(value);
}
parseNumericLiteral(value) {
return this.estreeParseLiteral(value);
}
parseNullLiteral() {
return this.estreeParseLiteral(null);
}
parseBooleanLiteral(value) {
return this.estreeParseLiteral(value);
}
directiveToStmt(directive) {
const expression = directive.value;
delete directive.value;
expression.type = "Literal";
expression.raw = expression.extra.raw;
expression.value = expression.extra.expressionValue;
const stmt = directive;
stmt.type = "ExpressionStatement";
stmt.expression = expression;
stmt.directive = expression.extra.rawValue;
delete expression.extra;
return stmt;
}
initFunction(node, isAsync) {
super.initFunction(node, isAsync);
node.expression = false;
}
checkDeclaration(node) {
if (node != null && this.isObjectProperty(node)) {
this.checkDeclaration(node.value);
} else {
super.checkDeclaration(node);
}
}
getObjectOrClassMethodParams(method) {
return method.value.params;
}
isValidDirective(stmt) {
var _stmt$expression$extr;
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
}
parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);
const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
node.body = directiveStatements.concat(node.body);
delete node.directives;
}
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
if (method.typeParameters) {
method.value.typeParameters = method.typeParameters;
delete method.typeParameters;
}
classBody.body.push(method);
}
parsePrivateName() {
const node = super.parsePrivateName();
{
if (!this.getPluginOption("estree", "classFeatures")) {
return node;
}
}
return this.convertPrivateNameToPrivateIdentifier(node);
}
convertPrivateNameToPrivateIdentifier(node) {
const name = super.getPrivateNameSV(node);
node = node;
delete node.id;
node.name = name;
node.type = "PrivateIdentifier";
return node;
}
isPrivateName(node) {
{
if (!this.getPluginOption("estree", "classFeatures")) {
return super.isPrivateName(node);
}
}
return node.type === "PrivateIdentifier";
}
getPrivateNameSV(node) {
{
if (!this.getPluginOption("estree", "classFeatures")) {
return super.getPrivateNameSV(node);
}
}
return node.name;
}
parseLiteral(value, type) {
const node = super.parseLiteral(value, type);
node.raw = node.extra.raw;
delete node.extra;
return node;
}
parseFunctionBody(node, allowExpression, isMethod = false) {
super.parseFunctionBody(node, allowExpression, isMethod);
node.expression = node.body.type !== "BlockStatement";
}
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
let funcNode = this.startNode();
funcNode.kind = node.kind;
funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
funcNode.type = "FunctionExpression";
delete funcNode.kind;
node.value = funcNode;
if (type === "ClassPrivateMethod") {
node.computed = false;
}
return this.finishNode(node, "MethodDefinition");
}
parseClassProperty(...args) {
const propertyNode = super.parseClassProperty(...args);
{
if (!this.getPluginOption("estree", "classFeatures")) {
return propertyNode;
}
}
propertyNode.type = "PropertyDefinition";
return propertyNode;
}
parseClassPrivateProperty(...args) {
const propertyNode = super.parseClassPrivateProperty(...args);
{
if (!this.getPluginOption("estree", "classFeatures")) {
return propertyNode;
}
}
propertyNode.type = "PropertyDefinition";
propertyNode.computed = false;
return propertyNode;
}
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
if (node) {
node.type = "Property";
if (node.kind === "method") {
node.kind = "init";
}
node.shorthand = false;
}
return node;
}
parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
if (node) {
node.kind = "init";
node.type = "Property";
}
return node;
}
isValidLVal(type, isUnparenthesizedInAssign, binding) {
return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
}
isAssignable(node, isBinding) {
if (node != null && this.isObjectProperty(node)) {
return this.isAssignable(node.value, isBinding);
}
return super.isAssignable(node, isBinding);
}
toAssignable(node, isLHS = false) {
if (node != null && this.isObjectProperty(node)) {
const {
key,
value
} = node;
if (this.isPrivateName(key)) {
this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
}
this.toAssignable(value, isLHS);
} else {
super.toAssignable(node, isLHS);
}
}
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
if (prop.kind === "get" || prop.kind === "set") {
this.raise(Errors.PatternHasAccessor, {
at: prop.key
});
} else if (prop.method) {
this.raise(Errors.PatternHasMethod, {
at: prop.key
});
} else {
super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
}
}
finishCallExpression(unfinished, optional) {
const node = super.finishCallExpression(unfinished, optional);
if (node.callee.type === "Import") {
node.type = "ImportExpression";
node.source = node.arguments[0];
if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) {
var _node$arguments$;
node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;
}
delete node.arguments;
delete node.callee;
}
return node;
}
toReferencedArguments(node) {
if (node.type === "ImportExpression") {
return;
}
super.toReferencedArguments(node);
}
parseExport(unfinished, decorators) {
const exportStartLoc = this.state.lastTokStartLoc;
const node = super.parseExport(unfinished, decorators);
switch (node.type) {
case "ExportAllDeclaration":
node.exported = null;
break;
case "ExportNamedDeclaration":
if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
node.type = "ExportAllDeclaration";
node.exported = node.specifiers[0].exported;
delete node.specifiers;
}
case "ExportDefaultDeclaration":
{
var _declaration$decorato;
const {
declaration
} = node;
if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) {
this.resetStartLocation(node, exportStartLoc);
}
}
break;
}
return node;
}
parseSubscript(base, startLoc, noCalls, state) {
const node = super.parseSubscript(base, startLoc, noCalls, state);
if (state.optionalChainMember) {
if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
node.type = node.type.substring(8);
}
if (state.stop) {
const chain = this.startNodeAtNode(node);
chain.expression = node;
return this.finishNode(chain, "ChainExpression");
}
} else if (node.type === "MemberExpression" || node.type === "CallExpression") {
node.optional = false;
}
return node;
}
hasPropertyAsPrivateName(node) {
if (node.type === "ChainExpression") {
node = node.expression;
}
return super.hasPropertyAsPrivateName(node);
}
isObjectProperty(node) {
return node.type === "Property" && node.kind === "init" && !node.method;
}
isObjectMethod(node) {
return node.method || node.kind === "get" || node.kind === "set";
}
finishNodeAt(node, type, endLoc) {
return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
}
resetStartLocation(node, startLoc) {
super.resetStartLocation(node, startLoc);
toESTreeLocation(node);
}
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
super.resetEndLocation(node, endLoc);
toESTreeLocation(node);
}
};
class TokContext {
constructor(token, preserveSpace) {
this.token = void 0;
this.preserveSpace = void 0;
this.token = token;
this.preserveSpace = !!preserveSpace;
}
}
const types = {
brace: new TokContext("{"),
j_oTag: new TokContext("<tag"),
j_cTag: new TokContext("</tag"),
j_expr: new TokContext("<tag>...</tag>", true)
};
{
types.template = new TokContext("`", true);
}
const beforeExpr = true;
const startsExpr = true;
const isLoop = true;
const isAssign = true;
const prefix = true;
const postfix = true;
class ExportedTokenType {
constructor(label, conf = {}) {
this.label = void 0;
this.keyword = void 0;
this.beforeExpr = void 0;
this.startsExpr = void 0;
this.rightAssociative = void 0;
this.isLoop = void 0;
this.isAssign = void 0;
this.prefix = void 0;
this.postfix = void 0;
this.binop = void 0;
this.label = label;
this.keyword = conf.keyword;
this.beforeExpr = !!conf.beforeExpr;
this.startsExpr = !!conf.startsExpr;
this.rightAssociative = !!conf.rightAssociative;
this.isLoop = !!conf.isLoop;
this.isAssign = !!conf.isAssign;
this.prefix = !!conf.prefix;
this.postfix = !!conf.postfix;
this.binop = conf.binop != null ? conf.binop : null;
{
this.updateContext = null;
}
}
}
const keywords$1 = new Map();
function createKeyword(name, options = {}) {
options.keyword = name;
const token = createToken(name, options);
keywords$1.set(name, token);
return token;
}
function createBinop(name, binop) {
return createToken(name, {
beforeExpr,
binop
});
}
let tokenTypeCounter = -1;
const tokenTypes = [];
const tokenLabels = [];
const tokenBinops = [];
const tokenBeforeExprs = [];
const tokenStartsExprs = [];
const tokenPrefixes = [];
function createToken(name, options = {}) {
var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
++tokenTypeCounter;
tokenLabels.push(name);
tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
tokenTypes.push(new ExportedTokenType(name, options));
return tokenTypeCounter;
}
function createKeywordLike(name, options = {}) {
var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
++tokenTypeCounter;
keywords$1.set(name, tokenTypeCounter);
tokenLabels.push(name);
tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);
tokenTypes.push(new ExportedTokenType("name", options));
return tokenTypeCounter;
}
const tt = {
bracketL: createToken("[", {
beforeExpr,
startsExpr
}),
bracketHashL: createToken("#[", {
beforeExpr,
startsExpr
}),
bracketBarL: createToken("[|", {
beforeExpr,
startsExpr
}),
bracketR: createToken("]"),
bracketBarR: createToken("|]"),
braceL: createToken("{", {
beforeExpr,
startsExpr
}),
braceBarL: createToken("{|", {
beforeExpr,
startsExpr
}),
braceHashL: createToken("#{", {
beforeExpr,
startsExpr
}),
braceR: createToken("}"),
braceBarR: createToken("|}"),
parenL: createToken("(", {
beforeExpr,
startsExpr
}),
parenR: createToken(")"),
comma: createToken(",", {
beforeExpr
}),
semi: createToken(";", {
beforeExpr
}),
colon: createToken(":", {
beforeExpr
}),
doubleColon: createToken("::", {
beforeExpr
}),
dot: createToken("."),
question: createToken("?", {
beforeExpr
}),
questionDot: createToken("?."),
arrow: createToken("=>", {
beforeExpr
}),
template: createToken("template"),
ellipsis: createToken("...", {
beforeExpr
}),
backQuote: createToken("`", {
startsExpr
}),
dollarBraceL: createToken("${", {
beforeExpr,
startsExpr
}),
templateTail: createToken("...`", {
startsExpr
}),
templateNonTail: createToken("...${", {
beforeExpr,
startsExpr
}),
at: createToken("@"),
hash: createToken("#", {
startsExpr
}),
interpreterDirective: createToken("#!..."),
eq: createToken("=", {
beforeExpr,
isAssign
}),
assign: createToken("_=", {
beforeExpr,
isAssign
}),
slashAssign: createToken("_=", {
beforeExpr,
isAssign
}),
xorAssign: createToken("_=", {
beforeExpr,
isAssign
}),
moduloAssign: createToken("_=", {
beforeExpr,
isAssign
}),
incDec: createToken("++/--", {
prefix,
postfix,
startsExpr
}),
bang: createToken("!", {
beforeExpr,
prefix,
startsExpr
}),
tilde: createToken("~", {
beforeExpr,
prefix,
startsExpr
}),
doubleCaret: createToken("^^", {
startsExpr
}),
doubleAt: createToken("@@", {
startsExpr
}),
pipeline: createBinop("|>", 0),
nullishCoalescing: createBinop("??", 1),
logicalOR: createBinop("||", 1),
logicalAND: createBinop("&&", 2),
bitwiseOR: createBinop("|", 3),
bitwiseXOR: createBinop("^", 4),
bitwiseAND: createBinop("&", 5),
equality: createBinop("==/!=/===/!==", 6),
lt: createBinop("</>/<=/>=", 7),
gt: createBinop("</>/<=/>=", 7),
relational: createBinop("</>/<=/>=", 7),
bitShift: createBinop("<</>>/>>>", 8),
bitShiftL: createBinop("<</>>/>>>", 8),
bitShiftR: createBinop("<</>>/>>>", 8),
plusMin: createToken("+/-", {
beforeExpr,
binop: 9,
prefix,
startsExpr
}),
modulo: createToken("%", {
binop: 10,
startsExpr
}),
star: createToken("*", {
binop: 10
}),
slash: createBinop("/", 10),
exponent: createToken("**", {
beforeExpr,
binop: 11,
rightAssociative: true
}),
_in: createKeyword("in", {
beforeExpr,
binop: 7
}),
_instanceof: createKeyword("instanceof", {
beforeExpr,
binop: 7
}),
_break: createKeyword("break"),
_case: createKeyword("case", {
beforeExpr
}),
_catch: createKeyword("catch"),
_continue: createKeyword("continue"),
_debugger: createKeyword("debugger"),
_default: createKeyword("default", {
beforeExpr
}),
_else: createKeyword("else", {
beforeExpr
}),
_finally: createKeyword("finally"),
_function: createKeyword("function", {
startsExpr
}),
_if: createKeyword("if"),
_return: createKeyword("return", {
beforeExpr
}),
_switch: createKeyword("switch"),
_throw: createKeyword("throw", {
beforeExpr,
prefix,
startsExpr
}),
_try: createKeyword("try"),
_var: createKeyword("var"),
_const: createKeyword("const"),
_with: createKeyword("with"),
_new: createKeyword("new", {
beforeExpr,
startsExpr
}),
_this: createKeyword("this", {
startsExpr
}),
_super: createKeyword("super", {
startsExpr
}),
_class: createKeyword("class", {
startsExpr
}),
_extends: createKeyword("extends", {
beforeExpr
}),
_export: createKeyword("export"),
_import: createKeyword("import", {
startsExpr
}),
_null: createKeyword("null", {
startsExpr
}),
_true: createKeyword("true", {
startsExpr
}),
_false: createKeyword("false", {
startsExpr
}),
_typeof: createKeyword("typeof", {
beforeExpr,
prefix,
startsExpr
}),
_void: createKeyword("void", {
beforeExpr,
prefix,
startsExpr
}),
_delete: createKeyword("delete", {
beforeExpr,
prefix,
startsExpr
}),
_do: createKeyword("do", {
isLoop,
beforeExpr
}),
_for: createKeyword("for", {
isLoop
}),
_while: createKeyword("while", {
isLoop
}),
_as: createKeywordLike("as", {
startsExpr
}),
_assert: createKeywordLike("assert", {
startsExpr
}),
_async: createKeywordLike("async", {
startsExpr
}),
_await: createKeywordLike("await", {
startsExpr
}),
_from: createKeywordLike("from", {
startsExpr
}),
_get: createKeywordLike("get", {
startsExpr
}),
_let: createKeywordLike("let", {
startsExpr
}),
_meta: createKeywordLike("meta", {
startsExpr
}),
_of: createKeywordLike("of", {
startsExpr
}),
_sent: createKeywordLike("sent", {
startsExpr
}),
_set: createKeywordLike("set", {
startsExpr
}),
_static: createKeywordLike("static", {
startsExpr
}),
_using: createKeywordLike("using", {
startsExpr
}),
_yield: createKeywordLike("yield", {
startsExpr
}),
_asserts: createKeywordLike("asserts", {
startsExpr
}),
_checks: createKeywordLike("checks", {
startsExpr
}),
_exports: createKeywordLike("exports", {
startsExpr
}),
_global: createKeywordLike("global", {
startsExpr
}),
_implements: createKeywordLike("implements", {
startsExpr
}),
_intrinsic: createKeywordLike("intrinsic", {
startsExpr
}),
_infer: createKeywordLike("infer", {
startsExpr
}),
_is: createKeywordLike("is", {
startsExpr
}),
_mixins: createKeywordLike("mixins", {
startsExpr
}),
_proto: createKeywordLike("proto", {
startsExpr
}),
_require: createKeywordLike("require", {
startsExpr
}),
_satisfies: createKeywordLike("satisfies", {
startsExpr
}),
_keyof: createKeywordLike("keyof", {
startsExpr
}),
_readonly: createKeywordLike("readonly", {
startsExpr
}),
_unique: createKeywordLike("unique", {
startsExpr
}),
_abstract: createKeywordLike("abstract", {
startsExpr
}),
_declare: createKeywordLike("declare", {
startsExpr
}),
_enum: createKeywordLike("enum", {
startsExpr
}),
_module: createKeywordLike("module", {
startsExpr
}),
_namespace: createKeywordLike("namespace", {
startsExpr
}),
_interface: createKeywordLike("interface", {
startsExpr
}),
_type: createKeywordLike("type", {
startsExpr
}),
_opaque: createKeywordLike("opaque", {
startsExpr
}),
name: createToken("name", {
startsExpr
}),
string: createToken("string", {
startsExpr
}),
num: createToken("num", {
startsExpr
}),
bigint: createToken("bigint", {
startsExpr
}),
decimal: createToken("decimal", {
startsExpr
}),
regexp: createToken("regexp", {
startsExpr
}),
privateName: createToken("#name", {
startsExpr
}),
eof: createToken("eof"),
jsxName: createToken("jsxName"),
jsxText: createToken("jsxText", {
beforeExpr: true
}),
jsxTagStart: createToken("jsxTagStart", {
startsExpr: true
}),
jsxTagEnd: createToken("jsxTagEnd"),
placeholder: createToken("%%", {
startsExpr: true
})
};
function tokenIsIdentifier(token) {
return token >= 93 && token <= 130;
}
function tokenKeywordOrIdentifierIsKeyword(token) {
return token <= 92;
}
function tokenIsKeywordOrIdentifier(token) {
return token >= 58 && token <= 130;
}
function tokenIsLiteralPropertyName(token) {
return token >= 58 && token <= 134;
}
function tokenComesBeforeExpression(token) {
return tokenBeforeExprs[token];
}
function tokenCanStartExpression(token) {
return tokenStartsExprs[token];
}
function tokenIsAssignment(token) {
return token >= 29 && token <= 33;
}
function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
return token >= 127 && token <= 129;
}
function tokenIsLoop(token) {
return token >= 90 && token <= 92;
}
function tokenIsKeyword(token) {
return token >= 58 && token <= 92;
}
function tokenIsOperator(token) {
return token >= 39 && token <= 59;
}
function tokenIsPostfix(token) {
return token === 34;
}
function tokenIsPrefix(token) {
return tokenPrefixes[token];
}
function tokenIsTSTypeOperator(token) {
return token >= 119 && token <= 121;
}
function tokenIsTSDeclarationStart(token) {
return token >= 122 && token <= 128;
}
function tokenLabelName(token) {
return tokenLabels[token];
}
function tokenOperatorPrecedence(token) {
return tokenBinops[token];
}
function tokenIsRightAssociative(token) {
return token === 57;
}
function tokenIsTemplate(token) {
return token >= 24 && token <= 25;
}
function getExportedToken(token) {
return tokenTypes[token];
}
{
tokenTypes[8].updateContext = context => {
context.pop();
};
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => {
context.push(types.brace);
};
tokenTypes[22].updateContext = context => {
if (context[context.length - 1] === types.template) {
context.pop();
} else {
context.push(types.template);
}
};
tokenTypes[140].updateContext = context => {
context.push(types.j_expr, types.j_oTag);
};
}
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a