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

754 lines
17 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 326,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 1,
"end": 104,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 6,
"end": 8,
"ctxt": 0
},
"value": "T1",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 15,
"end": 22,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 19,
"end": 22,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 28,
"end": 41,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 32,
"end": 41,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 32,
"end": 35,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 38,
"end": 41,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 47,
"end": 66,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 51,
"end": 66,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 51,
"end": 60,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 51,
"end": 54,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 57,
"end": 60,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"value": "3",
"raw": "\"3\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 72,
"end": 85,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 76,
"end": 85,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "StringLiteral",
"span": {
"start": 76,
"end": 79,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 82,
"end": 85,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 91,
"end": 102,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 95,
"end": 102,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 106,
"end": 148,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 120,
"end": 127,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 133,
"end": 146,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 137,
"end": 146,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 143,
"end": 146,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 150,
"end": 218,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 155,
"end": 157,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 164,
"end": 171,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 177,
"end": 190,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 181,
"end": 190,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 187,
"end": 190,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 196,
"end": 201,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 207,
"end": 216,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 211,
"end": 216,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NumericLiteral",
"span": {
"start": 211,
"end": 212,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 220,
"end": 243,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 225,
"end": 227,
"ctxt": 0
},
"value": "T4",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 234,
"end": 241,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 234,
"end": 235,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 238,
"end": 241,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 245,
"end": 274,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 250,
"end": 252,
"ctxt": 0
},
"value": "T5",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 259,
"end": 272,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 259,
"end": 260,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 263,
"end": 272,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 263,
"end": 266,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 269,
"end": 272,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 276,
"end": 326,
"ctxt": 0
},
"declare": true,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 289,
"end": 291,
"ctxt": 0
},
"value": "T6",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 298,
"end": 305,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 302,
"end": 305,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 311,
"end": 324,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 311,
"end": 312,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 315,
"end": 324,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 315,
"end": 318,
"ctxt": 0
},
"value": "1",
"raw": "\"1\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 321,
"end": 324,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
}
]
}
],
"interpreter": null
}