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

1439 lines
34 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 482,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 1,
"end": 24,
"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": "TemplateLiteral",
"span": {
"start": 19,
"end": 22,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 26,
"end": 73,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 31,
"end": 33,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 40,
"end": 47,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 44,
"end": 47,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 45,
"end": 46,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 53,
"end": 60,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 57,
"end": 60,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 66,
"end": 71,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 75,
"end": 104,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 82,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 89,
"end": 102,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 93,
"end": 102,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 93,
"end": 96,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 99,
"end": 102,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 106,
"end": 211,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"value": "T4",
"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": "TemplateLiteral",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 125,
"end": 126,
"ctxt": 0
},
"tail": true,
"cooked": "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": "TemplateLiteral",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 143,
"end": 146,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 152,
"end": 165,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 152,
"end": 153,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 156,
"end": 165,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 156,
"end": 159,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "StringLiteral",
"span": {
"start": 162,
"end": 165,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 171,
"end": 184,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 175,
"end": 184,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 175,
"end": 178,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 190,
"end": 209,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 194,
"end": 209,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 194,
"end": 203,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 194,
"end": 197,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 200,
"end": 203,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 206,
"end": 209,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 213,
"end": 367,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 218,
"end": 220,
"ctxt": 0
},
"value": "T5",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 227,
"end": 234,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 231,
"end": 234,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 240,
"end": 253,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 244,
"end": 253,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 244,
"end": 247,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 245,
"end": 246,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 250,
"end": 253,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"tail": true,
"cooked": "2",
"raw": "2"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 259,
"end": 278,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 259,
"end": 260,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 263,
"end": 278,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 263,
"end": 272,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 263,
"end": 266,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 269,
"end": 272,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 270,
"end": 271,
"ctxt": 0
},
"tail": true,
"cooked": "2",
"raw": "2"
}
]
}
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 275,
"end": 278,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"tail": true,
"cooked": "3",
"raw": "3"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 284,
"end": 289,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 284,
"end": 285,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 288,
"end": 289,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 295,
"end": 308,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 299,
"end": 308,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 299,
"end": 302,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 305,
"end": 308,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 314,
"end": 325,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 314,
"end": 315,
"ctxt": 0
},
"value": "f",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 318,
"end": 325,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 318,
"end": 321,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 319,
"end": 320,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 324,
"end": 325,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 331,
"end": 345,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "g",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 335,
"end": 345,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 339,
"end": 342,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"tail": false,
"cooked": "1",
"raw": "1"
},
{
"type": "TemplateElement",
"span": {
"start": 343,
"end": 344,
"ctxt": 0
},
"tail": true,
"cooked": "3",
"raw": "3"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 351,
"end": 365,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 351,
"end": 352,
"ctxt": 0
},
"value": "h",
"optional": false
},
"init": {
"type": "MemberExpression",
"span": {
"start": 355,
"end": 365,
"ctxt": 0
},
"object": {
"type": "TemplateLiteral",
"span": {
"start": 355,
"end": 358,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 356,
"end": 357,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"property": {
"type": "Identifier",
"span": {
"start": 359,
"end": 365,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 369,
"end": 411,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 374,
"end": 376,
"ctxt": 0
},
"value": "T6",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 383,
"end": 388,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 383,
"end": 384,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 387,
"end": 388,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 394,
"end": 409,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "MemberExpression",
"span": {
"start": 398,
"end": 409,
"ctxt": 0
},
"object": {
"type": "TemplateLiteral",
"span": {
"start": 398,
"end": 402,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 399,
"end": 401,
"ctxt": 0
},
"tail": true,
"cooked": "12",
"raw": "12"
}
]
},
"property": {
"type": "Identifier",
"span": {
"start": 403,
"end": 409,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 413,
"end": 482,
"ctxt": 0
},
"declare": true,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 426,
"end": 428,
"ctxt": 0
},
"value": "T7",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 435,
"end": 442,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 435,
"end": 436,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 439,
"end": 442,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 440,
"end": 441,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
},
{
"type": "TsEnumMember",
"span": {
"start": 448,
"end": 461,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 448,
"end": 449,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 452,
"end": 461,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 452,
"end": 455,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 453,
"end": 454,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 458,
"end": 461,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 459,
"end": 460,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 467,
"end": 480,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 471,
"end": 480,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 471,
"end": 474,
"ctxt": 0
},
"value": "2",
"raw": "\"2\""
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 477,
"end": 480,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 478,
"end": 479,
"ctxt": 0
},
"tail": true,
"cooked": "1",
"raw": "1"
}
]
}
}
}
]
}
],
"interpreter": null
}