swc/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator2.json

233 lines
6.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 67,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 0,
"end": 67,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 13,
"end": 67,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 19,
"end": 31,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 23,
"end": 24,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 23,
"end": 24,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 36,
"end": 65,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 40,
"end": 60,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "BinaryExpression",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"operator": "<",
"left": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 44,
"end": 45,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 49,
"end": 60,
"ctxt": 0
},
"operator": ">",
"left": {
"type": "Identifier",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "ParenthesisExpression",
"span": {
"start": 53,
"end": 60,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "c",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": 1.0
}
}
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 62,
"end": 65,
"ctxt": 0
},
"stmts": []
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}