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

585 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 23,
"end": 286,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 23,
"end": 90,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 28,
"end": 30,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 37,
"end": 44,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 41,
"end": 44,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 50,
"end": 63,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 60,
"end": 63,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 69,
"end": 88,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 73,
"end": 88,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 73,
"end": 82,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 85,
"end": 88,
"ctxt": 0
},
"value": "3",
"raw": "\"3\""
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 92,
"end": 134,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 97,
"end": 99,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 106,
"end": 113,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 110,
"end": 113,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 119,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 123,
"end": 132,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 123,
"end": 126,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 129,
"end": 132,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 136,
"end": 178,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 141,
"end": 143,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 150,
"end": 157,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 163,
"end": 176,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 167,
"end": 176,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 173,
"end": 176,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 180,
"end": 203,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 185,
"end": 187,
"ctxt": 0
},
"value": "T4",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 194,
"end": 201,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 198,
"end": 201,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 205,
"end": 234,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 210,
"end": 212,
"ctxt": 0
},
"value": "T5",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 219,
"end": 232,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 223,
"end": 232,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 223,
"end": 226,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 229,
"end": 232,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 236,
"end": 286,
"ctxt": 0
},
"declare": true,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 249,
"end": 251,
"ctxt": 0
},
"value": "T6",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 258,
"end": 265,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 258,
"end": 259,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 262,
"end": 265,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 271,
"end": 284,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 275,
"end": 284,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 275,
"end": 278,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 281,
"end": 284,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
}
]
}
],
"interpreter": null
}