swc/crates/swc_ecma_parser/tests/tsc/enumConstantMemberWithString.json
2022-02-04 17:08:38 +09:00

834 lines
19 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 325,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 0,
"end": 103,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 7,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 14,
"end": 21,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 18,
"end": 21,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 27,
"end": 40,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 31,
"end": 40,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 31,
"end": 34,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 46,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 46,
"end": 47,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 50,
"end": 65,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 50,
"end": 59,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 50,
"end": 53,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 62,
"end": 65,
"ctxt": 0
},
"value": "3",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 71,
"end": 84,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 75,
"end": 84,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "StringLiteral",
"span": {
"start": 75,
"end": 78,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 81,
"end": 84,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 90,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 94,
"end": 101,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 94,
"end": 97,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": 1.0
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 105,
"end": 147,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 110,
"end": 112,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 119,
"end": 126,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 123,
"end": 126,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 132,
"end": 145,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 136,
"end": 145,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 142,
"end": 145,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 149,
"end": 217,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 154,
"end": 156,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 163,
"end": 170,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 176,
"end": 189,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 180,
"end": 189,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 180,
"end": 183,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 186,
"end": 189,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 195,
"end": 200,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 199,
"end": 200,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "TsEnumMember",
"span": {
"start": 206,
"end": 215,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 210,
"end": 215,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NumericLiteral",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": 1.0
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": 2.0
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 219,
"end": 242,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 224,
"end": 226,
"ctxt": 0
},
"value": "T4",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 233,
"end": 240,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 237,
"end": 240,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 244,
"end": 273,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 249,
"end": 251,
"ctxt": 0
},
"value": "T5",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 258,
"end": 271,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 258,
"end": 259,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 262,
"end": 271,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 262,
"end": 265,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 268,
"end": 271,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 275,
"end": 325,
"ctxt": 0
},
"declare": true,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 288,
"end": 290,
"ctxt": 0
},
"value": "T6",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 297,
"end": 304,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 301,
"end": 304,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 310,
"end": 323,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 314,
"end": 323,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 314,
"end": 317,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 320,
"end": 323,
"ctxt": 0
},
"value": "2",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
]
}
],
"interpreter": null
}