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

239 lines
6.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 61,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"value": "g",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 0,
"end": 61,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 13,
"end": 61,
"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": 59,
"ctxt": 0
},
"test": {
"type": "CallExpression",
"span": {
"start": 40,
"end": 54,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "a",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "BinaryExpression",
"span": {
"start": 48,
"end": 53,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"value": "c",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": 1.0
}
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 41,
"end": 47,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"value": "b",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 45,
"end": 46,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 45,
"end": 46,
"ctxt": 0
},
"value": "b",
"optional": false
},
"typeParams": null
}
]
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"stmts": []
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}