acorn
Advanced tools
Comparing version 2.7.0 to 3.0.0
@@ -1,11 +0,17 @@ | ||
// Note: run `npm install unicode-7.0.0` first. | ||
// Which Unicode version should be used? | ||
var version = '7.0.0'; | ||
var version = '8.0.0'; | ||
var start = require('unicode-' + version + '/properties/ID_Start/code-points') | ||
.filter(function(ch) { return ch > 127; }); | ||
var last = -1; | ||
var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/properties/ID_Continue/code-points') | ||
.filter(function(ch) { return ch > 127 && start.indexOf(ch) == -1; })); | ||
.filter(function(ch) { return ch > 127 && search(start, ch, last + 1) == -1; })); | ||
function search(arr, ch, starting) { | ||
for (var i = starting; arr[i] <= ch && i < arr.length; last = i++) | ||
if (arr[i] === ch) | ||
return i; | ||
return -1; | ||
} | ||
function pad(str, width) { | ||
@@ -44,5 +50,5 @@ while (str.length < width) str = "0" + str; | ||
console.log(" var nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\";"); | ||
console.log(" var nonASCIIidentifierChars = \"" + contData.nonASCII + "\";"); | ||
console.log(" var astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"); | ||
console.log(" var astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"); | ||
console.log("let nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\""); | ||
console.log("let nonASCIIidentifierChars = \"" + contData.nonASCII + "\""); | ||
console.log("const astralIdentifierStartCodes = " + JSON.stringify(startData.astral)); | ||
console.log("const astralIdentifierCodes = " + JSON.stringify(contData.astral)); |
@@ -55,2 +55,15 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.acorn || (g.acorn = {})).loose = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
lp.parseMaybeAssign = function (noIn) { | ||
if (this.toks.isContextual("yield")) { | ||
var node = this.startNode(); | ||
this.next(); | ||
if (this.semicolon() || this.canInsertSemicolon() || this.tok.type != _.tokTypes.star && !this.tok.type.startsExpr) { | ||
node.delegate = false; | ||
node.argument = null; | ||
} else { | ||
node.delegate = this.eat(_.tokTypes.star); | ||
node.argument = this.parseMaybeAssign(); | ||
} | ||
return this.finishNode(node, "YieldExpression"); | ||
} | ||
var start = this.storeCurrentPos(); | ||
@@ -137,2 +150,11 @@ var left = this.parseMaybeConditional(noIn); | ||
} | ||
if (this.eat(_.tokTypes.starstar)) { | ||
var node = this.startNodeAt(start); | ||
node.operator = "**"; | ||
node.left = expr; | ||
node.right = this.parseMaybeUnary(noIn); | ||
return this.finishNode(node, "BinaryExpression"); | ||
} | ||
return expr; | ||
@@ -256,14 +278,2 @@ }; | ||
case _.tokTypes._yield: | ||
node = this.startNode(); | ||
this.next(); | ||
if (this.semicolon() || this.canInsertSemicolon() || this.tok.type != _.tokTypes.star && !this.tok.type.startsExpr) { | ||
node.delegate = false; | ||
node.argument = null; | ||
} else { | ||
node.delegate = this.eat(_.tokTypes.star); | ||
node.argument = this.parseMaybeAssign(); | ||
} | ||
return this.finishNode(node, "YieldExpression"); | ||
case _.tokTypes.backQuote: | ||
@@ -790,4 +800,10 @@ return this.parseTemplate(); | ||
var starttype = this.tok.type, | ||
node = this.startNode(); | ||
node = this.startNode(), | ||
kind = undefined; | ||
if (this.toks.isLet()) { | ||
starttype = _.tokTypes._var; | ||
kind = "let"; | ||
} | ||
switch (starttype) { | ||
@@ -822,4 +838,5 @@ case _.tokTypes._break:case _.tokTypes._continue: | ||
if (this.tok.type === _.tokTypes.semi) return this.parseFor(node, null); | ||
if (this.tok.type === _.tokTypes._var || this.tok.type === _.tokTypes._let || this.tok.type === _.tokTypes._const) { | ||
var _init = this.parseVar(true); | ||
var isLet = this.toks.isLet(); | ||
if (isLet || this.tok.type === _.tokTypes._var || this.tok.type === _.tokTypes._const) { | ||
var _init = this.parseVar(true, isLet ? "let" : this.tok.value); | ||
if (_init.declarations.length === 1 && (this.tok.type === _.tokTypes._in || this.isContextual("of"))) { | ||
@@ -909,5 +926,4 @@ return this.parseForIn(node, _init); | ||
case _.tokTypes._var: | ||
case _.tokTypes._let: | ||
case _.tokTypes._const: | ||
return this.parseVar(); | ||
return this.parseVar(false, kind || this.tok.value); | ||
@@ -995,5 +1011,5 @@ case _.tokTypes._while: | ||
lp.parseVar = function (noIn) { | ||
lp.parseVar = function (noIn, kind) { | ||
var node = this.startNode(); | ||
node.kind = this.tok.type.keyword; | ||
node.kind = kind; | ||
this.next(); | ||
@@ -1107,3 +1123,3 @@ node.declarations = []; | ||
} | ||
if (this.tok.type.keyword) { | ||
if (this.tok.type.keyword || this.toks.isLet()) { | ||
node.declaration = this.parseStatement(); | ||
@@ -1110,0 +1126,0 @@ node.specifiers = []; |
@@ -370,9 +370,4 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.acorn || (g.acorn = {})).walk = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
}; | ||
base.ComprehensionExpression = function (node, st, c) { | ||
for (var i = 0; i < node.blocks.length; i++) { | ||
c(node.blocks[i].right, st, "Expression"); | ||
}c(node.body, st, "Expression"); | ||
}; | ||
},{}]},{},[1])(1) | ||
}); |
@@ -6,3 +6,3 @@ { | ||
"main": "dist/acorn.js", | ||
"version": "2.7.0", | ||
"version": "3.0.0", | ||
"engines": { | ||
@@ -40,4 +40,4 @@ "node": ">=0.4.0" | ||
"browserify-derequire": "^0.9.4", | ||
"unicode-7.0.0": "~0.1.5" | ||
"unicode-8.0.0": "^0.1.5" | ||
} | ||
} |
@@ -65,3 +65,3 @@ # Acorn | ||
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be | ||
either 3, 5, or 6. This influences support for strict mode, the set | ||
either 3, 5, 6, or 7. This influences support for strict mode, the set | ||
of reserved words, and support for new syntax features. Default is 5. | ||
@@ -308,3 +308,3 @@ | ||
- `--ecma3|--ecma5|--ecma6`: Sets the ECMAScript version to parse. Default is | ||
- `--ecma3|--ecma5|--ecma6|--ecma7`: Sets the ECMAScript version to parse. Default is | ||
version 5. | ||
@@ -311,0 +311,0 @@ |
@@ -12,3 +12,3 @@ #!/usr/bin/env node | ||
const print = (status == 0) ? console.log : console.error | ||
print("usage: " + basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6]") | ||
print("usage: " + basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7]") | ||
print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]") | ||
@@ -25,2 +25,3 @@ process.exit(status) | ||
else if (arg == "--ecma6") options.ecmaVersion = 6 | ||
else if (arg == "--ecma7") options.ecmaVersion = 7 | ||
else if (arg == "--locations") options.locations = true | ||
@@ -27,0 +28,0 @@ else if (arg == "--allow-hash-bang") options.allowHashBang = true |
@@ -41,3 +41,3 @@ // A recursive descent parser operates by defining functions for all | ||
if (name === "__proto__" && kind === "init") { | ||
if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); | ||
if (propHash.proto) this.raiseRecoverable(key.start, "Redefinition of __proto__ property") | ||
propHash.proto = true | ||
@@ -52,3 +52,3 @@ } | ||
if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) | ||
this.raise(key.start, "Redefinition of property") | ||
this.raiseRecoverable(key.start, "Redefinition of property") | ||
} else { | ||
@@ -95,3 +95,3 @@ other = propHash[name] = { | ||
pp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { | ||
if (this.type == tt._yield && this.inGenerator) return this.parseYield() | ||
if (this.inGenerator && this.isContextual("yield")) return this.parseYield() | ||
@@ -145,3 +145,3 @@ let validateDestructuring = false | ||
let startPos = this.start, startLoc = this.startLoc | ||
let expr = this.parseMaybeUnary(refDestructuringErrors) | ||
let expr = this.parseMaybeUnary(refDestructuringErrors, false) | ||
if (this.checkExpressionErrors(refDestructuringErrors)) return expr | ||
@@ -161,10 +161,8 @@ return this.parseExprOp(expr, startPos, startLoc, -1, noIn) | ||
if (prec > minPrec) { | ||
let node = this.startNodeAt(leftStartPos, leftStartLoc) | ||
node.left = left | ||
node.operator = this.value | ||
let op = this.type | ||
let logical = this.type === tt.logicalOR || this.type === tt.logicalAND | ||
let op = this.value | ||
this.next() | ||
let startPos = this.start, startLoc = this.startLoc | ||
node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn) | ||
this.finishNode(node, (op === tt.logicalOR || op === tt.logicalAND) ? "LogicalExpression" : "BinaryExpression") | ||
let right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn) | ||
let node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical) | ||
return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) | ||
@@ -176,6 +174,15 @@ } | ||
pp.buildBinary = function(startPos, startLoc, left, right, op, logical) { | ||
let node = this.startNodeAt(startPos, startLoc) | ||
node.left = left | ||
node.operator = op | ||
node.right = right | ||
return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") | ||
} | ||
// Parse unary operators, both prefix and postfix. | ||
pp.parseMaybeUnary = function(refDestructuringErrors) { | ||
pp.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { | ||
if (this.type.prefix) { | ||
sawUnary = true | ||
let node = this.startNode(), update = this.type === tt.incDec | ||
@@ -185,3 +192,3 @@ node.operator = this.value | ||
this.next() | ||
node.argument = this.parseMaybeUnary() | ||
node.argument = this.parseMaybeUnary(null, true) | ||
this.checkExpressionErrors(refDestructuringErrors, true) | ||
@@ -191,3 +198,3 @@ if (update) this.checkLVal(node.argument) | ||
node.argument.type === "Identifier") | ||
this.raise(node.start, "Deleting local variable in strict mode") | ||
this.raiseRecoverable(node.start, "Deleting local variable in strict mode") | ||
return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression") | ||
@@ -199,2 +206,3 @@ } | ||
while (this.type.postfix && !this.canInsertSemicolon()) { | ||
sawUnary = true | ||
let node = this.startNodeAt(startPos, startLoc) | ||
@@ -208,3 +216,7 @@ node.operator = this.value | ||
} | ||
return expr | ||
if (!sawUnary && this.eat(tt.starstar)) | ||
return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) | ||
else | ||
return expr | ||
} | ||
@@ -217,3 +229,3 @@ | ||
let expr = this.parseExprAtom(refDestructuringErrors) | ||
let skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; | ||
let skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")" | ||
if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr | ||
@@ -265,2 +277,3 @@ return this.parseSubscripts(expr, startPos, startLoc) | ||
this.raise(this.start, "'super' outside of function or class") | ||
case tt._this: | ||
@@ -272,5 +285,2 @@ let type = this.type === tt._this ? "ThisExpression" : "Super" | ||
case tt._yield: | ||
if (this.inGenerator) this.unexpected() | ||
case tt.name: | ||
@@ -305,6 +315,2 @@ let startPos = this.start, startLoc = this.startLoc | ||
this.next() | ||
// check whether this is array comprehension or regular array | ||
if (this.options.ecmaVersion >= 7 && this.type === tt._for) { | ||
return this.parseComprehension(node, false) | ||
} | ||
node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors) | ||
@@ -355,6 +361,2 @@ return this.finishNode(node, "ArrayExpression") | ||
if (this.options.ecmaVersion >= 7 && this.type === tt._for) { | ||
return this.parseComprehension(this.startNodeAt(startPos, startLoc), true) | ||
} | ||
let innerStartPos = this.start, innerStartLoc = this.startLoc | ||
@@ -432,5 +434,5 @@ let exprList = [], first = true | ||
if (node.property.name !== "target") | ||
this.raise(node.property.start, "The only valid meta property for new is new.target") | ||
this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target") | ||
if (!this.inFunction) | ||
this.raise(node.start, "new.target can only be used in functions") | ||
this.raiseRecoverable(node.start, "new.target can only be used in functions") | ||
return this.finishNode(node, "MetaProperty") | ||
@@ -525,8 +527,8 @@ } | ||
if (prop.kind === "get") | ||
this.raise(start, "getter should have no params"); | ||
this.raiseRecoverable(start, "getter should have no params") | ||
else | ||
this.raise(start, "setter should have exactly one param") | ||
this.raiseRecoverable(start, "setter should have exactly one param") | ||
} | ||
if (prop.kind === "set" && prop.value.params[0].type === "RestElement") | ||
this.raise(prop.value.params[0].start, "Setter cannot use rest params") | ||
this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params") | ||
} else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { | ||
@@ -536,4 +538,5 @@ prop.kind = "init" | ||
if (this.keywords.test(prop.key.name) || | ||
(this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name)) | ||
this.raise(prop.key.start, "Binding " + prop.key.name) | ||
(this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name) || | ||
(this.inGenerator && prop.key.name == "yield")) | ||
this.raiseRecoverable(prop.key.start, "Binding " + prop.key.name) | ||
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key) | ||
@@ -578,3 +581,4 @@ } else if (this.type === tt.eq && refDestructuringErrors) { | ||
pp.parseMethod = function(isGenerator) { | ||
let node = this.startNode() | ||
let node = this.startNode(), oldInGen = this.inGenerator | ||
this.inGenerator = isGenerator | ||
this.initFunction(node) | ||
@@ -586,2 +590,3 @@ this.expect(tt.parenL) | ||
this.parseFunctionBody(node, false) | ||
this.inGenerator = oldInGen | ||
return this.finishNode(node, "FunctionExpression") | ||
@@ -593,5 +598,8 @@ } | ||
pp.parseArrowExpression = function(node, params) { | ||
let oldInGen = this.inGenerator | ||
this.inGenerator = false | ||
this.initFunction(node) | ||
node.params = this.toAssignableList(params, true) | ||
this.parseFunctionBody(node, true) | ||
this.inGenerator = oldInGen | ||
return this.finishNode(node, "ArrowFunctionExpression") | ||
@@ -611,7 +619,7 @@ } | ||
// flag (restore them to their old value afterwards). | ||
let oldInFunc = this.inFunction, oldInGen = this.inGenerator, oldLabels = this.labels | ||
this.inFunction = true; this.inGenerator = node.generator; this.labels = [] | ||
let oldInFunc = this.inFunction, oldLabels = this.labels | ||
this.inFunction = true; this.labels = [] | ||
node.body = this.parseBlock(true) | ||
node.expression = false | ||
this.inFunction = oldInFunc; this.inGenerator = oldInGen; this.labels = oldLabels | ||
this.inFunction = oldInFunc; this.labels = oldLabels | ||
} | ||
@@ -627,6 +635,6 @@ | ||
this.checkLVal(node.id, true) | ||
this.checkParams(node); | ||
this.checkParams(node) | ||
this.strict = oldStrict | ||
} else if (isArrowFunction) { | ||
this.checkParams(node); | ||
this.checkParams(node) | ||
} | ||
@@ -639,6 +647,6 @@ } | ||
pp.checkParams = function(node) { | ||
let nameHash = {}; | ||
let nameHash = {} | ||
for (let i = 0; i < node.params.length; i++) | ||
this.checkLVal(node.params[i], true, nameHash) | ||
}; | ||
} | ||
@@ -685,3 +693,5 @@ // Parses a comma-separated list of expressions, and returns them as | ||
this.input.slice(this.start, this.end).indexOf("\\") == -1)) | ||
this.raise(this.start, "The keyword '" + this.value + "' is reserved") | ||
this.raiseRecoverable(this.start, "The keyword '" + this.value + "' is reserved") | ||
if (!liberal && this.inGenerator && this.value === "yield") | ||
this.raiseRecoverable(this.start, "Can not use 'yield' as identifier inside a generator") | ||
node.name = this.value | ||
@@ -711,23 +721,1 @@ } else if (liberal && this.type.keyword) { | ||
} | ||
// Parses array and generator comprehensions. | ||
pp.parseComprehension = function(node, isGenerator) { | ||
node.blocks = [] | ||
while (this.type === tt._for) { | ||
let block = this.startNode() | ||
this.next() | ||
this.expect(tt.parenL) | ||
block.left = this.parseBindingAtom() | ||
this.checkLVal(block.left, true) | ||
this.expectContextual("of") | ||
block.right = this.parseExpression() | ||
this.expect(tt.parenR) | ||
node.blocks.push(this.finishNode(block, "ComprehensionBlock")) | ||
} | ||
node.filter = this.eat(tt._if) ? this.parseParenExpression() : null | ||
node.body = this.parseExpression() | ||
this.expect(isGenerator ? tt.parenR : tt.bracketR) | ||
node.generator = isGenerator | ||
return this.finishNode(node, "ComprehensionExpression") | ||
} |
@@ -1,10 +0,1 @@ | ||
// This is a trick taken from Esprima. It turns out that, on | ||
// non-Chrome browsers, to check whether a string is in a set, a | ||
// predicate containing a big ugly `switch` statement is faster than | ||
// a regular expression, and on Chrome the two are about on par. | ||
// This function uses `eval` (non-lexical) to produce such a | ||
// predicate from a space-separated string of words. | ||
// | ||
// It starts by sorting the words by length. | ||
// Reserved word lists for various dialects of the language | ||
@@ -26,3 +17,3 @@ | ||
5: ecma5AndLessKeywords, | ||
6: ecma5AndLessKeywords + " let const class extends export import yield super" | ||
6: ecma5AndLessKeywords + " const class extends export import super" | ||
} | ||
@@ -38,4 +29,4 @@ | ||
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\u0561-\u0587\u05d0-\u05ea\u05f0-\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\u08a0-\u08b2\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\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\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\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\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-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\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-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua7ad\ua7b0\ua7b1\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab5f\uab64\uab65\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc" | ||
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2d\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f" | ||
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\u0561-\u0587\u05d0-\u05ea\u05f0-\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\u08a0-\u08b4\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\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\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\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-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\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-\u2c2e\u2c30-\u2c5e\u2c60-\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-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fd5\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ad\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc" | ||
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f" | ||
@@ -51,5 +42,5 @@ const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]") | ||
// offset to the next range, and then a size of the range. They were | ||
// generated by tools/generate-identifier-regex.js | ||
var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,99,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,98,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,955,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,38,17,2,24,133,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,32,4,287,47,21,1,2,0,185,46,82,47,21,0,60,42,502,63,32,0,449,56,1288,920,104,110,2962,1070,13266,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,16481,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,1340,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,16355,541] | ||
var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,16,9,83,11,168,11,6,9,8,2,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,316,19,13,9,214,6,3,8,112,16,16,9,82,12,9,9,535,9,20855,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,4305,6,792618,239] | ||
// generated by bin/generate-identifier-regex.js | ||
const astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,99,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,287,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,1288,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,16481,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,1340,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541] | ||
const astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,168,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,316,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,20855,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,3617,6,792618,239] | ||
@@ -56,0 +47,0 @@ // This has a complexity linear to the value of the code. The |
@@ -39,3 +39,3 @@ // Acorn is a tiny, fast JavaScript parser written in JavaScript. | ||
export const version = "2.7.0" | ||
export const version = "3.0.0" | ||
@@ -42,0 +42,0 @@ // The main exported interface (under `self.acorn` when in the |
@@ -20,2 +20,4 @@ import {Parser} from "./state" | ||
pp.raiseRecoverable = pp.raise | ||
pp.curPosition = function() { | ||
@@ -22,0 +24,0 @@ if (this.options.locations) { |
@@ -45,2 +45,15 @@ import {LooseParser} from "./state" | ||
lp.parseMaybeAssign = function(noIn) { | ||
if (this.toks.isContextual("yield")) { | ||
let node = this.startNode() | ||
this.next() | ||
if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type != tt.star && !this.tok.type.startsExpr)) { | ||
node.delegate = false | ||
node.argument = null | ||
} else { | ||
node.delegate = this.eat(tt.star) | ||
node.argument = this.parseMaybeAssign() | ||
} | ||
return this.finishNode(node, "YieldExpression") | ||
} | ||
let start = this.storeCurrentPos() | ||
@@ -125,2 +138,11 @@ let left = this.parseMaybeConditional(noIn) | ||
} | ||
if (this.eat(tt.starstar)) { | ||
let node = this.startNodeAt(start) | ||
node.operator = "**" | ||
node.left = expr | ||
node.right = this.parseMaybeUnary(noIn) | ||
return this.finishNode(node, "BinaryExpression") | ||
} | ||
return expr | ||
@@ -250,14 +272,2 @@ } | ||
case tt._yield: | ||
node = this.startNode() | ||
this.next() | ||
if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type != tt.star && !this.tok.type.startsExpr)) { | ||
node.delegate = false | ||
node.argument = null | ||
} else { | ||
node.delegate = this.eat(tt.star) | ||
node.argument = this.parseMaybeAssign() | ||
} | ||
return this.finishNode(node, "YieldExpression") | ||
case tt.backQuote: | ||
@@ -481,3 +491,3 @@ return this.parseTemplate() | ||
let indent = this.curIndent, line = this.curLineStart, elts = [] | ||
this.next(); // Opening bracket | ||
this.next() // Opening bracket | ||
while (!this.closes(close, indent + 1, line)) { | ||
@@ -484,0 +494,0 @@ if (this.eat(tt.comma)) { |
@@ -16,4 +16,4 @@ import {tokenizer, SourceLocation, tokTypes as tt, Node, lineBreak, isNewLine} from ".." | ||
} | ||
this.ahead = []; // Tokens ahead | ||
this.context = []; // Indentation contexted | ||
this.ahead = [] // Tokens ahead | ||
this.context = [] // Indentation contexted | ||
this.curIndent = 0 | ||
@@ -20,0 +20,0 @@ this.curLineStart = 0 |
@@ -19,4 +19,9 @@ import {LooseParser} from "./state" | ||
lp.parseStatement = function() { | ||
let starttype = this.tok.type, node = this.startNode() | ||
let starttype = this.tok.type, node = this.startNode(), kind | ||
if (this.toks.isLet()) { | ||
starttype = tt._var | ||
kind = "let" | ||
} | ||
switch (starttype) { | ||
@@ -51,4 +56,5 @@ case tt._break: case tt._continue: | ||
if (this.tok.type === tt.semi) return this.parseFor(node, null) | ||
if (this.tok.type === tt._var || this.tok.type === tt._let || this.tok.type === tt._const) { | ||
let init = this.parseVar(true) | ||
let isLet = this.toks.isLet() | ||
if (isLet || this.tok.type === tt._var || this.tok.type === tt._const) { | ||
let init = this.parseVar(true, isLet ? "let" : this.tok.value) | ||
if (init.declarations.length === 1 && (this.tok.type === tt._in || this.isContextual("of"))) { | ||
@@ -138,5 +144,4 @@ return this.parseForIn(node, init) | ||
case tt._var: | ||
case tt._let: | ||
case tt._const: | ||
return this.parseVar() | ||
return this.parseVar(false, kind || this.tok.value) | ||
@@ -224,5 +229,5 @@ case tt._while: | ||
lp.parseVar = function(noIn) { | ||
lp.parseVar = function(noIn, kind) { | ||
let node = this.startNode() | ||
node.kind = this.tok.type.keyword | ||
node.kind = kind | ||
this.next() | ||
@@ -336,3 +341,3 @@ node.declarations = [] | ||
} | ||
if (this.tok.type.keyword) { | ||
if (this.tok.type.keyword || this.toks.isLet()) { | ||
node.declaration = this.parseStatement() | ||
@@ -339,0 +344,0 @@ node.specifiers = [] |
@@ -39,3 +39,3 @@ import {types as tt} from "./tokentype" | ||
this.raise(node.left.end, "Only '=' operator can be used for specifying default value.") | ||
break; | ||
break | ||
} | ||
@@ -46,3 +46,3 @@ | ||
this.raise(node.right.start, "Yield expression cannot be a default value") | ||
break; | ||
break | ||
@@ -81,3 +81,3 @@ case "ParenthesizedExpression": | ||
if (isBinding && last.type === "RestElement" && last.argument.type !== "Identifier") | ||
this.unexpected(last.argument.start); | ||
this.unexpected(last.argument.start) | ||
} | ||
@@ -179,6 +179,6 @@ for (let i = 0; i < end; i++) { | ||
if (this.strict && this.reservedWordsStrictBind.test(expr.name)) | ||
this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode") | ||
this.raiseRecoverable(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode") | ||
if (checkClashes) { | ||
if (has(checkClashes, expr.name)) | ||
this.raise(expr.start, "Argument name clash") | ||
this.raiseRecoverable(expr.start, "Argument name clash") | ||
checkClashes[expr.name] = true | ||
@@ -189,3 +189,3 @@ } | ||
case "MemberExpression": | ||
if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression") | ||
if (isBinding) this.raiseRecoverable(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression") | ||
break | ||
@@ -192,0 +192,0 @@ |
@@ -11,4 +11,4 @@ import {has, isArray} from "./util" | ||
// mode, the set of reserved words, support for getters and | ||
// setters and other features. | ||
ecmaVersion: 5, | ||
// setters and other features. The default is 6. | ||
ecmaVersion: 6, | ||
// Source type ("script" or "module") for different semantics | ||
@@ -15,0 +15,0 @@ sourceType: "script", |
@@ -29,3 +29,3 @@ import {reservedWords, keywords} from "./identifier" | ||
// escape sequences must not be interpreted as keywords. | ||
this.containsEsc = false; | ||
this.containsEsc = false | ||
@@ -32,0 +32,0 @@ // Load plugins |
import {types as tt} from "./tokentype" | ||
import {Parser} from "./state" | ||
import {lineBreak} from "./whitespace" | ||
import {lineBreak, skipWhiteSpace} from "./whitespace" | ||
import {isIdentifierStart, isIdentifierChar} from "./identifier" | ||
@@ -34,2 +35,16 @@ const pp = Parser.prototype | ||
pp.isLet = function() { | ||
if (this.type !== tt.name || this.options.ecmaVersion < 6 || this.value != "let") return false | ||
skipWhiteSpace.lastIndex = this.pos | ||
let skip = skipWhiteSpace.exec(this.input) | ||
let next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next) | ||
if (nextCh === 91 || nextCh == 123) return true // '{' and '[' | ||
if (isIdentifierStart(nextCh, true)) { | ||
for (var pos = next + 1; isIdentifierChar(this.input.charCodeAt(pos, true)); ++pos) {} | ||
let ident = this.input.slice(next, pos) | ||
if (!this.isKeyword(ident)) return true | ||
} | ||
return false | ||
} | ||
// Parse a single statement. | ||
@@ -43,4 +58,9 @@ // | ||
pp.parseStatement = function(declaration, topLevel) { | ||
let starttype = this.type, node = this.startNode() | ||
let starttype = this.type, node = this.startNode(), kind | ||
if (this.isLet()) { | ||
starttype = tt._var | ||
kind = "let" | ||
} | ||
// Most types of statements are recognized by the keyword they | ||
@@ -66,4 +86,6 @@ // start with. Many are trivial to parse, some require a bit of | ||
case tt._try: return this.parseTryStatement(node) | ||
case tt._let: case tt._const: if (!declaration) this.unexpected() // NOTE: falls through to _var | ||
case tt._var: return this.parseVarStatement(node, starttype) | ||
case tt._const: case tt._var: | ||
kind = kind || this.value | ||
if (!declaration && kind != "var") this.unexpected() | ||
return this.parseVarStatement(node, kind) | ||
case tt._while: return this.parseWhileStatement(node) | ||
@@ -152,9 +174,10 @@ case tt._with: return this.parseWithStatement(node) | ||
if (this.type === tt.semi) return this.parseFor(node, null) | ||
if (this.type === tt._var || this.type === tt._let || this.type === tt._const) { | ||
let init = this.startNode(), varKind = this.type | ||
let isLet = this.isLet() | ||
if (this.type === tt._var || this.type === tt._const || isLet) { | ||
let init = this.startNode(), kind = isLet ? "let" : this.value | ||
this.next() | ||
this.parseVar(init, true, varKind) | ||
this.parseVar(init, true, kind) | ||
this.finishNode(init, "VariableDeclaration") | ||
if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1 && | ||
!(varKind !== tt._var && init.declarations[0].init)) | ||
!(kind !== "var" && init.declarations[0].init)) | ||
return this.parseForIn(node, init) | ||
@@ -224,3 +247,3 @@ return this.parseFor(node, init) | ||
} else { | ||
if (sawDefault) this.raise(this.lastTokStart, "Multiple default clauses") | ||
if (sawDefault) this.raiseRecoverable(this.lastTokStart, "Multiple default clauses") | ||
sawDefault = true | ||
@@ -310,5 +333,5 @@ cur.test = null | ||
if (label.statementStart == node.start) { | ||
label.statementStart = this.start; | ||
label.kind = kind; | ||
} else break; | ||
label.statementStart = this.start | ||
label.kind = kind | ||
} else break | ||
} | ||
@@ -383,3 +406,3 @@ this.labels.push({name: maybeName, kind: kind, statementStart: this.start}) | ||
node.declarations = [] | ||
node.kind = kind.keyword | ||
node.kind = kind | ||
for (;;) { | ||
@@ -390,3 +413,3 @@ let decl = this.startNode() | ||
decl.init = this.parseMaybeAssign(isFor) | ||
} else if (kind === tt._const && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { | ||
} else if (kind === "const" && !(this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { | ||
this.unexpected() | ||
@@ -416,2 +439,4 @@ } else if (decl.id.type != "Identifier" && !(isFor && (this.type === tt._in || this.isContextual("of")))) { | ||
node.generator = this.eat(tt.star) | ||
var oldInGen = this.inGenerator | ||
this.inGenerator = node.generator | ||
if (isStatement || this.type === tt.name) | ||
@@ -421,2 +446,3 @@ node.id = this.parseIdent() | ||
this.parseFunctionBody(node, allowExpressionBody) | ||
this.inGenerator = oldInGen | ||
return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression") | ||
@@ -477,5 +503,5 @@ } | ||
if (method.kind === "get") | ||
this.raise(start, "getter should have no params"); | ||
this.raiseRecoverable(start, "getter should have no params") | ||
else | ||
this.raise(start, "setter should have exactly one param") | ||
this.raiseRecoverable(start, "setter should have exactly one param") | ||
} | ||
@@ -515,6 +541,7 @@ if (method.kind === "set" && method.value.params[0].type === "RestElement") | ||
if (this.eat(tt._default)) { // export default ... | ||
let parens = this.type == tt.parenL | ||
let expr = this.parseMaybeAssign() | ||
let needsSemi = true | ||
if (expr.type == "FunctionExpression" || | ||
expr.type == "ClassExpression") { | ||
if (!parens && (expr.type == "FunctionExpression" || | ||
expr.type == "ClassExpression")) { | ||
needsSemi = false | ||
@@ -557,3 +584,3 @@ if (expr.id) { | ||
pp.shouldParseExportStatement = function() { | ||
return this.type.keyword | ||
return this.type.keyword || this.isLet() | ||
} | ||
@@ -560,0 +587,0 @@ |
@@ -226,3 +226,3 @@ import {isIdentifierStart, isIdentifierChar} from "./identifier" | ||
let next = this.input.charCodeAt(this.pos + 1) | ||
if (this.exprAllowed) {++this.pos; return this.readRegexp();} | ||
if (this.exprAllowed) {++this.pos; return this.readRegexp()} | ||
if (next === 61) return this.finishOp(tt.assign, 2) | ||
@@ -232,6 +232,16 @@ return this.finishOp(tt.slash, 1) | ||
pp.readToken_mult_modulo = function(code) { // '%*' | ||
pp.readToken_mult_modulo_exp = function(code) { // '%*' | ||
let next = this.input.charCodeAt(this.pos + 1) | ||
if (next === 61) return this.finishOp(tt.assign, 2) | ||
return this.finishOp(code === 42 ? tt.star : tt.modulo, 1) | ||
let size = 1 | ||
let tokentype = code === 42 ? tt.star : tt.modulo | ||
// exponentiation operator ** and **= | ||
if (this.options.ecmaVersion >= 7 && next === 42) { | ||
++size | ||
tokentype = tt.starstar | ||
next = this.input.charCodeAt(this.pos + 2) | ||
} | ||
if (next === 61) return this.finishOp(tt.assign, size + 1) | ||
return this.finishOp(tokentype, size) | ||
} | ||
@@ -325,6 +335,6 @@ | ||
let next = this.input.charCodeAt(this.pos + 1) | ||
if (next === 120 || next === 88) return this.readRadixNumber(16); // '0x', '0X' - hex number | ||
if (next === 120 || next === 88) return this.readRadixNumber(16) // '0x', '0X' - hex number | ||
if (this.options.ecmaVersion >= 6) { | ||
if (next === 111 || next === 79) return this.readRadixNumber(8); // '0o', '0O' - octal number | ||
if (next === 98 || next === 66) return this.readRadixNumber(2); // '0b', '0B' - binary number | ||
if (next === 111 || next === 79) return this.readRadixNumber(8) // '0o', '0O' - octal number | ||
if (next === 98 || next === 66) return this.readRadixNumber(2) // '0b', '0B' - binary number | ||
} | ||
@@ -349,3 +359,3 @@ // Anything else beginning with a digit is an integer, octal | ||
case 37: case 42: // '%*' | ||
return this.readToken_mult_modulo(code) | ||
return this.readToken_mult_modulo_exp(code) | ||
@@ -385,3 +395,3 @@ case 124: case 38: // '|&' | ||
try { | ||
return new RegExp(src, flags); | ||
return new RegExp(src, flags) | ||
} catch (e) { | ||
@@ -395,3 +405,3 @@ if (throwErrorAt !== undefined) { | ||
var regexpUnicodeSupport = !!tryCreateRegexp("\uffff", "u"); | ||
var regexpUnicodeSupport = !!tryCreateRegexp("\uffff", "u") | ||
@@ -435,3 +445,3 @@ pp.readRegexp = function() { | ||
return "x" | ||
}); | ||
}) | ||
tmp = tmp.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x") | ||
@@ -445,3 +455,3 @@ } | ||
if (!isRhino) { | ||
tryCreateRegexp(tmp, undefined, start, this); | ||
tryCreateRegexp(tmp, undefined, start, this) | ||
// Get a regular expression object for this pattern-flag pair, or `null` in | ||
@@ -462,5 +472,5 @@ // case the current environment doesn't support the flags it uses. | ||
let code = this.input.charCodeAt(this.pos), val | ||
if (code >= 97) val = code - 97 + 10; // a | ||
else if (code >= 65) val = code - 65 + 10; // A | ||
else if (code >= 48 && code <= 57) val = code - 48; // 0-9 | ||
if (code >= 97) val = code - 97 + 10 // a | ||
else if (code >= 65) val = code - 65 + 10 // A | ||
else if (code >= 48 && code <= 57) val = code - 48 // 0-9 | ||
else val = Infinity | ||
@@ -477,3 +487,3 @@ if (val >= radix) break | ||
pp.readRadixNumber = function(radix) { | ||
this.pos += 2; // 0x | ||
this.pos += 2 // 0x | ||
let val = this.readInt(radix) | ||
@@ -499,3 +509,3 @@ if (val == null) this.raise(this.start + 2, "Expected number in radix " + radix) | ||
next = this.input.charCodeAt(++this.pos) | ||
if (next === 43 || next === 45) ++this.pos; // '+-' | ||
if (next === 43 || next === 45) ++this.pos // '+-' | ||
if (this.readInt(10) === null) this.raise(start, "Invalid number") | ||
@@ -586,9 +596,9 @@ isFloat = true | ||
case 13: | ||
if (this.input.charCodeAt(this.pos) === 10) ++this.pos; | ||
if (this.input.charCodeAt(this.pos) === 10) ++this.pos | ||
case 10: | ||
out += "\n"; | ||
break; | ||
out += "\n" | ||
break | ||
default: | ||
out += String.fromCharCode(ch); | ||
break; | ||
out += String.fromCharCode(ch) | ||
break | ||
} | ||
@@ -612,11 +622,11 @@ if (this.options.locations) { | ||
switch (ch) { | ||
case 110: return "\n"; // 'n' -> '\n' | ||
case 114: return "\r"; // 'r' -> '\r' | ||
case 120: return String.fromCharCode(this.readHexChar(2)); // 'x' | ||
case 117: return codePointToString(this.readCodePoint()); // 'u' | ||
case 116: return "\t"; // 't' -> '\t' | ||
case 98: return "\b"; // 'b' -> '\b' | ||
case 118: return "\u000b"; // 'v' -> '\u000b' | ||
case 102: return "\f"; // 'f' -> '\f' | ||
case 13: if (this.input.charCodeAt(this.pos) === 10) ++this.pos; // '\r\n' | ||
case 110: return "\n" // 'n' -> '\n' | ||
case 114: return "\r" // 'r' -> '\r' | ||
case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' | ||
case 117: return codePointToString(this.readCodePoint()) // 'u' | ||
case 116: return "\t" // 't' -> '\t' | ||
case 98: return "\b" // 'b' -> '\b' | ||
case 118: return "\u000b" // 'v' -> '\u000b' | ||
case 102: return "\f" // 'f' -> '\f' | ||
case 13: if (this.input.charCodeAt(this.pos) === 10) ++this.pos // '\r\n' | ||
case 10: // ' \n' | ||
@@ -623,0 +633,0 @@ if (this.options.locations) { this.lineStart = this.pos; ++this.curLine } |
@@ -98,3 +98,4 @@ // ## Token types | ||
star: binop("*", 10), | ||
slash: binop("/", 10) | ||
slash: binop("/", 10), | ||
starstar: new TokenType("**", {beforeExpr: true}) | ||
} | ||
@@ -129,3 +130,2 @@ | ||
kw("var") | ||
kw("let") | ||
kw("const") | ||
@@ -141,3 +141,2 @@ kw("while", {isLoop: true}) | ||
kw("import") | ||
kw("yield", {beforeExpr: true, startsExpr: true}) | ||
kw("null", startsExpr) | ||
@@ -144,0 +143,0 @@ kw("true", startsExpr) |
@@ -336,6 +336,1 @@ // AST walker module for Mozilla Parser API compatible trees | ||
} | ||
base.ComprehensionExpression = (node, st, c) => { | ||
for (let i = 0; i < node.blocks.length; i++) | ||
c(node.blocks[i].right, st, "Expression") | ||
c(node.body, st, "Expression") | ||
} |
@@ -13,1 +13,2 @@ // Matches a whole line break (where CRLF is considered a single | ||
export const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
376514
43
8781
11