Erik Arvidsson fba5655a44 Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-03-06 22:43:36 +01:00

392 lines
8.8 KiB
JSON

{
"type": "File",
"start": 0,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 14
}
},
"program": {
"type": "Program",
"start": 0,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 14
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 6,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 6
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
},
"identifierName": "a"
},
"name": "a"
},
"init": null
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 9
}
},
"expression": {
"type": "AssignmentExpression",
"start": 7,
"end": 15,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"operator": "=",
"left": {
"type": "ParenthesizedExpression",
"start": 7,
"end": 10,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 3
}
},
"expression": {
"type": "Identifier",
"start": 8,
"end": 9,
"loc": {
"start": {
"line": 2,
"column": 1
},
"end": {
"line": 2,
"column": 2
},
"identifierName": "a"
},
"name": "a"
}
},
"right": {
"type": "ObjectExpression",
"start": 13,
"end": 15,
"loc": {
"start": {
"line": 2,
"column": 6
},
"end": {
"line": 2,
"column": 8
}
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"start": 17,
"end": 28,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 11
}
},
"expression": {
"type": "AssignmentExpression",
"start": 17,
"end": 27,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 10
}
},
"operator": "=",
"left": {
"type": "ParenthesizedExpression",
"start": 17,
"end": 22,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 5
}
},
"expression": {
"type": "MemberExpression",
"start": 18,
"end": 21,
"loc": {
"start": {
"line": 3,
"column": 1
},
"end": {
"line": 3,
"column": 4
}
},
"object": {
"type": "Identifier",
"start": 18,
"end": 19,
"loc": {
"start": {
"line": 3,
"column": 1
},
"end": {
"line": 3,
"column": 2
},
"identifierName": "a"
},
"name": "a"
},
"property": {
"type": "Identifier",
"start": 20,
"end": 21,
"loc": {
"start": {
"line": 3,
"column": 3
},
"end": {
"line": 3,
"column": 4
},
"identifierName": "b"
},
"name": "b"
},
"computed": false
}
},
"right": {
"type": "ObjectExpression",
"start": 25,
"end": 27,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 10
}
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"start": 29,
"end": 43,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 14
}
},
"expression": {
"type": "AssignmentExpression",
"start": 29,
"end": 42,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 13
}
},
"operator": "=",
"left": {
"type": "ParenthesizedExpression",
"start": 29,
"end": 37,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 8
}
},
"expression": {
"type": "MemberExpression",
"start": 30,
"end": 36,
"loc": {
"start": {
"line": 4,
"column": 1
},
"end": {
"line": 4,
"column": 7
}
},
"object": {
"type": "Identifier",
"start": 30,
"end": 31,
"loc": {
"start": {
"line": 4,
"column": 1
},
"end": {
"line": 4,
"column": 2
},
"identifierName": "a"
},
"name": "a"
},
"property": {
"type": "StringLiteral",
"start": 32,
"end": 35,
"loc": {
"start": {
"line": 4,
"column": 3
},
"end": {
"line": 4,
"column": 6
}
},
"extra": {
"rawValue": "c",
"raw": "'c'"
},
"value": "c"
},
"computed": true
}
},
"right": {
"type": "ObjectExpression",
"start": 40,
"end": 42,
"loc": {
"start": {
"line": 4,
"column": 11
},
"end": {
"line": 4,
"column": 13
}
},
"properties": []
}
}
}
],
"directives": []
}
}