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

724 lines
17 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 33,
"end": 274,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 33,
"end": 44,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 37,
"end": 43,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 41,
"end": 43,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 45,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 49,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 53,
"end": 65,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 57,
"end": 62,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 63,
"end": 64,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 68,
"end": 80,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 79,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 76,
"end": 79,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 77,
"end": 78,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 81,
"end": 96,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 85,
"end": 95,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 89,
"end": 95,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 90,
"end": 91,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 93,
"end": 94,
"ctxt": 0
},
"value": 2.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 97,
"end": 125,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 101,
"end": 124,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 101,
"end": 102,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 105,
"end": 124,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 109,
"end": 114,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 114,
"end": 122,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 115,
"end": 121,
"ctxt": 0
},
"kind": "number"
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 127,
"end": 149,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 148,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 133,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 133,
"end": 143,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 135,
"end": 143,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 135,
"end": 141,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 146,
"end": 148,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 150,
"end": 182,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 154,
"end": 181,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 154,
"end": 156,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 156,
"end": 166,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 158,
"end": 166,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 158,
"end": 164,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "NewExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 169,
"end": 181,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 173,
"end": 178,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 179,
"end": 180,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 184,
"end": 207,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 188,
"end": 206,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 188,
"end": 190,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 190,
"end": 200,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 192,
"end": 200,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 192,
"end": 198,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 203,
"end": 206,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 204,
"end": 205,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 208,
"end": 234,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 212,
"end": 233,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 212,
"end": 214,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 214,
"end": 224,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 216,
"end": 224,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 216,
"end": 222,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 227,
"end": 233,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 228,
"end": 229,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 231,
"end": 232,
"ctxt": 0
},
"value": 2.0
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 235,
"end": 274,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 239,
"end": 273,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 239,
"end": 241,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 241,
"end": 251,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 243,
"end": 251,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 243,
"end": 249,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "NewExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 254,
"end": 273,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 258,
"end": 263,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 263,
"end": 271,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 264,
"end": 270,
"ctxt": 0
},
"kind": "number"
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}