unoverload Literal AST node
This commit is contained in:
parent
4088d85e32
commit
446b297465
@ -32,9 +32,17 @@ pp.checkPropClash = function (prop, propHash) {
|
||||
|
||||
let key = prop.key, name;
|
||||
switch (key.type) {
|
||||
case "Identifier": name = key.name; break;
|
||||
case "Literal": name = String(key.value); break;
|
||||
default: return;
|
||||
case "Identifier":
|
||||
name = key.name;
|
||||
break;
|
||||
|
||||
case "StringLiteral":
|
||||
case "NumberLiteral":
|
||||
name = String(key.value);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
let kind = prop.kind;
|
||||
@ -377,19 +385,28 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
|
||||
case tt.regexp:
|
||||
let value = this.state.value;
|
||||
node = this.parseLiteral(value.value);
|
||||
node.regex = {pattern: value.pattern, flags: value.flags};
|
||||
node = this.parseLiteral(value.value, "RegexLiteral");
|
||||
node.pattern = value.pattern;
|
||||
node.flags = value.flags;
|
||||
return node;
|
||||
|
||||
case tt.num: case tt.string:
|
||||
return this.parseLiteral(this.state.value);
|
||||
case tt.num:
|
||||
return this.parseLiteral(this.state.value, "NumberLiteral");
|
||||
|
||||
case tt._null: case tt._true: case tt._false:
|
||||
case tt.string:
|
||||
return this.parseLiteral(this.state.value, "StringLiteral");
|
||||
|
||||
case tt._null:
|
||||
node = this.startNode();
|
||||
node.rawValue = node.value = this.match(tt._null) ? null : this.match(tt._true);
|
||||
this.next();
|
||||
return this.finishNode(node, "NullLiteral");
|
||||
|
||||
case tt._true: case tt._false:
|
||||
node = this.startNode();
|
||||
node.rawValue = node.value = this.match(tt._true);
|
||||
node.raw = this.state.type.keyword;
|
||||
this.next();
|
||||
return this.finishNode(node, "Literal");
|
||||
return this.finishNode(node, "BooleanLiteral");
|
||||
|
||||
case tt.parenL:
|
||||
return this.parseParenAndDistinguishExpression(null, null, canBeArrow);
|
||||
@ -443,12 +460,12 @@ pp.parseExprAtom = function (refShorthandDefaultPos) {
|
||||
}
|
||||
};
|
||||
|
||||
pp.parseLiteral = function (value) {
|
||||
pp.parseLiteral = function (value, type) {
|
||||
let node = this.startNode();
|
||||
node.rawValue = node.value = value;
|
||||
node.raw = this.input.slice(this.state.start, this.state.end);
|
||||
this.next();
|
||||
return this.finishNode(node, "Literal");
|
||||
return this.finishNode(node, type);
|
||||
};
|
||||
|
||||
pp.parseParenExpression = function () {
|
||||
|
||||
@ -565,7 +565,7 @@ pp.parseClass = function (node, isStatement, optionalId) {
|
||||
key = this.parsePropertyName(method);
|
||||
}
|
||||
if (!method.static && (key.type === "Identifier" && key.name === "constructor" ||
|
||||
key.type === "Literal" && key.value === "constructor")) {
|
||||
key.type === "StringLiteral" && key.value === "constructor")) {
|
||||
if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class");
|
||||
if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier");
|
||||
if (isGenerator) this.raise(key.start, "Constructor can't be a generator");
|
||||
|
||||
@ -9,7 +9,7 @@ const pp = Parser.prototype;
|
||||
// Test whether a statement node is the string literal `"use strict"`.
|
||||
|
||||
pp.isUseStrict = function (stmt) {
|
||||
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.raw.slice(1, -1) === "use strict";
|
||||
return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && stmt.expression.raw.slice(1, -1) === "use strict";
|
||||
};
|
||||
|
||||
// TODO
|
||||
|
||||
@ -382,7 +382,7 @@ export default function(instance) {
|
||||
instance.extend("parseExprAtom", function(inner) {
|
||||
return function(refShortHandDefaultPos) {
|
||||
if (this.match(tt.jsxText)) {
|
||||
var node = this.parseLiteral(this.state.value);
|
||||
var node = this.parseLiteral(this.state.value, "JSXText");
|
||||
// https://github.com/babel/babel/issues/2078
|
||||
node.rawValue = null;
|
||||
return node;
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
}
|
||||
},
|
||||
"argument": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 42,
|
||||
"end": 44,
|
||||
"loc": {
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 37,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
},
|
||||
"consequent": [],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 66,
|
||||
"end": 67,
|
||||
"loc": {
|
||||
@ -267,7 +267,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 111,
|
||||
"end": 112,
|
||||
"loc": {
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"consequent": [],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 34,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
@ -202,7 +202,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 71,
|
||||
"end": 72,
|
||||
"loc": {
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 48,
|
||||
"end": 49,
|
||||
"loc": {
|
||||
@ -210,7 +210,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 83,
|
||||
"end": 84,
|
||||
"loc": {
|
||||
|
||||
@ -501,7 +501,7 @@
|
||||
},
|
||||
"operator": "-",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 215,
|
||||
"end": 216,
|
||||
"loc": {
|
||||
@ -527,7 +527,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 116,
|
||||
"end": 136,
|
||||
"loc": {
|
||||
@ -584,7 +584,7 @@
|
||||
}
|
||||
},
|
||||
"argument": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 271,
|
||||
"end": 276,
|
||||
"loc": {
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 22,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 4,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
@ -93,7 +93,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 15,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
@ -107,10 +107,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/foo/",
|
||||
"regex": {
|
||||
"pattern": "foo",
|
||||
"flags": ""
|
||||
}
|
||||
"pattern": "foo",
|
||||
"flags": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 6,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 8,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
@ -88,10 +88,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/[a-z]/i",
|
||||
"regex": {
|
||||
"pattern": "[a-z]",
|
||||
"flags": "i"
|
||||
}
|
||||
"pattern": "[a-z]",
|
||||
"flags": "i"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -99,4 +97,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 8,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
@ -88,10 +88,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/[x-z]/i",
|
||||
"regex": {
|
||||
"pattern": "[x-z]",
|
||||
"flags": "i"
|
||||
}
|
||||
"pattern": "[x-z]",
|
||||
"flags": "i"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -99,4 +97,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 8,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
@ -88,10 +88,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/[a-c]/i",
|
||||
"regex": {
|
||||
"pattern": "[a-c]",
|
||||
"flags": "i"
|
||||
}
|
||||
"pattern": "[a-c]",
|
||||
"flags": "i"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -99,4 +97,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 8,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
@ -88,10 +88,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/[P QR]/i",
|
||||
"regex": {
|
||||
"pattern": "[P QR]",
|
||||
"flags": "i"
|
||||
}
|
||||
"pattern": "[P QR]",
|
||||
"flags": "i"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -99,4 +97,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 8,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
@ -88,10 +88,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/foo\\/bar/",
|
||||
"regex": {
|
||||
"pattern": "foo\\/bar",
|
||||
"flags": ""
|
||||
}
|
||||
"pattern": "foo\\/bar",
|
||||
"flags": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -99,4 +97,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 8,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
@ -88,10 +88,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/=([^=\\s])+/g",
|
||||
"regex": {
|
||||
"pattern": "=([^=\\s])+",
|
||||
"flags": "g"
|
||||
}
|
||||
"pattern": "=([^=\\s])+",
|
||||
"flags": "g"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -99,4 +97,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 8,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
@ -88,10 +88,8 @@
|
||||
}
|
||||
},
|
||||
"raw": "/[P QR]/\\u0067",
|
||||
"regex": {
|
||||
"pattern": "[P QR]",
|
||||
"flags": "g"
|
||||
}
|
||||
"pattern": "[P QR]",
|
||||
"flags": "g"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -99,4 +97,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -91,7 +91,7 @@
|
||||
null,
|
||||
null,
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
@ -107,7 +107,7 @@
|
||||
"raw": "1"
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -125,7 +125,7 @@
|
||||
"raw": "2"
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 12,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
"name": "universe"
|
||||
},
|
||||
"property": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
@ -155,7 +155,7 @@
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 22,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
@ -173,7 +173,7 @@
|
||||
"raw": "14"
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 26,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
@ -191,7 +191,7 @@
|
||||
"raw": "3"
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 29,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 40,
|
||||
"end": 44,
|
||||
"loc": {
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
@ -107,7 +107,7 @@
|
||||
"raw": "1"
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -126,7 +126,7 @@
|
||||
},
|
||||
null,
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
"name": "y"
|
||||
},
|
||||
"consequent": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 4,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
@ -91,7 +91,7 @@
|
||||
"raw": "1"
|
||||
},
|
||||
"alternate": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
}
|
||||
},
|
||||
"consequent": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -123,7 +123,7 @@
|
||||
"raw": "1"
|
||||
},
|
||||
"alternate": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 4,
|
||||
"end": 6,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "NullLiteral",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
@ -55,10 +55,7 @@
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"rawValue": null,
|
||||
"raw": "null"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "eval"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 7,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "arguments"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 6,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 6,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 7,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "eval"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 11,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
@ -123,7 +123,7 @@
|
||||
"name": "arguments"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 27,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
"name": "answer"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 14,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -123,7 +123,7 @@
|
||||
"name": "y"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
@ -172,7 +172,7 @@
|
||||
"name": "z"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 23,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
"name": "if"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 10,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 21,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 18,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 18,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
|
||||
@ -187,7 +187,7 @@
|
||||
},
|
||||
"operator": "<",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 28,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"body": []
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 16,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
@ -107,7 +107,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 23,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
},
|
||||
"operator": "<",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 11,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
"name": "true"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 12,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 12,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
@ -137,7 +137,7 @@
|
||||
"name": "y"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 19,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
@ -124,7 +124,7 @@
|
||||
},
|
||||
"operator": "<",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 15,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
@ -124,7 +124,7 @@
|
||||
},
|
||||
"operator": "<",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 15,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
@ -124,7 +124,7 @@
|
||||
},
|
||||
"operator": "<",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 15,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
"name": "false"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 13,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 13,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 13,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 13,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 13,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
"name": "null"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 23,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 6,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
@ -124,7 +124,7 @@
|
||||
"raw": "\"answer\""
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 16,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 23,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 14,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
"name": "message"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 17,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -175,7 +175,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 37,
|
||||
"end": 49,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 10,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
@ -138,7 +138,7 @@
|
||||
"name": "y"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 18,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
@ -172,5 +172,27 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": " Comment",
|
||||
"start": 24,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
24,
|
||||
34
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
@ -172,5 +172,27 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " Multiline\nComment ",
|
||||
"start": 24,
|
||||
"end": 47,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
24,
|
||||
47
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
@ -172,5 +172,27 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": " Comment",
|
||||
"start": 21,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
21,
|
||||
31
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 7,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
@ -172,5 +172,27 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " Multiline\nComment ",
|
||||
"start": 21,
|
||||
"end": 44,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
21,
|
||||
44
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "BooleanLiteral",
|
||||
"start": 9,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 16,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
@ -137,7 +137,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 31,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
}
|
||||
},
|
||||
"object": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
@ -108,7 +108,7 @@
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 14,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"left": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
@ -76,7 +76,7 @@
|
||||
},
|
||||
"operator": "+",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 6,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 5,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
@ -121,7 +121,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 14,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
@ -75,7 +75,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 5,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
@ -89,14 +89,12 @@
|
||||
}
|
||||
},
|
||||
"raw": "/ foo/",
|
||||
"regex": {
|
||||
"pattern": " foo",
|
||||
"flags": ""
|
||||
}
|
||||
"pattern": " foo",
|
||||
"flags": ""
|
||||
}
|
||||
},
|
||||
"alternate": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -59,7 +59,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "RegexLiteral",
|
||||
"start": 2,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
@ -73,12 +73,10 @@
|
||||
}
|
||||
},
|
||||
"raw": "/=/",
|
||||
"regex": {
|
||||
"pattern": "=",
|
||||
"flags": ""
|
||||
}
|
||||
"pattern": "=",
|
||||
"flags": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -122,7 +122,7 @@
|
||||
},
|
||||
"operator": ">",
|
||||
"right": {
|
||||
"type": "Literal",
|
||||
"type": "NumberLiteral",
|
||||
"start": 8,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
@ -165,5 +165,27 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": " nothing",
|
||||
"start": 13,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
13,
|
||||
24
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 0,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Literal",
|
||||
"type": "StringLiteral",
|
||||
"start": 10,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user