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

1189 lines
28 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 23,
"end": 428,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 23,
"end": 46,
"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": "TemplateLiteral",
"span": {
"start": 41,
"end": 44,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 48,
"end": 95,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 53,
"end": 55,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 62,
"end": 69,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 62,
"end": 63,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 75,
"end": 82,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 88,
"end": 93,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 88,
"end": 89,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 92,
"end": 93,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 97,
"end": 126,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 111,
"end": 124,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 115,
"end": 124,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 121,
"end": 124,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 128,
"end": 233,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 135,
"ctxt": 0
},
"value": "T4",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 142,
"end": 149,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 146,
"end": 149,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 155,
"end": 168,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 159,
"end": 168,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 159,
"end": 162,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 165,
"end": 168,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 174,
"end": 187,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 178,
"end": 187,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 178,
"end": 181,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "StringLiteral",
"span": {
"start": 184,
"end": 187,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 193,
"end": 206,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 197,
"end": 206,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 203,
"end": 206,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 212,
"end": 231,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 216,
"end": 231,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 216,
"end": 225,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 216,
"end": 219,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 222,
"end": 225,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 228,
"end": 231,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 235,
"end": 313,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "T5",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 249,
"end": 256,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 253,
"end": 256,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 262,
"end": 275,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 262,
"end": 263,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 266,
"end": 275,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 266,
"end": 269,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 267,
"end": 268,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 272,
"end": 275,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"tail": true,
"cooked": "2",
"raw": "2"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 281,
"end": 300,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 285,
"end": 300,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 285,
"end": 294,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 285,
"end": 288,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 291,
"end": 294,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"tail": true,
"cooked": "2",
"raw": "2"
}
]
}
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 297,
"end": 300,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"tail": true,
"cooked": "3",
"raw": "3"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 306,
"end": 311,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 315,
"end": 357,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 320,
"end": 322,
"ctxt": 0
},
"value": "T6",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 329,
"end": 334,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 333,
"end": 334,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 340,
"end": 355,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "MemberExpression",
"span": {
"start": 344,
"end": 355,
"ctxt": 0
},
"object": {
"type": "TemplateLiteral",
"span": {
"start": 344,
"end": 348,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 345,
"end": 347,
"ctxt": 0
},
"tail": true,
"cooked": "12",
"raw": "12"
}
]
},
"property": {
"type": "Identifier",
"span": {
"start": 349,
"end": 355,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 359,
"end": 428,
"ctxt": 0
},
"declare": true,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 372,
"end": 374,
"ctxt": 0
},
"value": "T7",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 381,
"end": 388,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 385,
"end": 388,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 394,
"end": 407,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 398,
"end": 407,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 398,
"end": 401,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 399,
"end": 400,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 404,
"end": 407,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 405,
"end": 406,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 413,
"end": 426,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 413,
"end": 414,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 417,
"end": 426,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 423,
"end": 426,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
}
]
}
],
"interpreter": null
}