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

1254 lines
27 KiB
JSON

{
"type": "Script",
"span": {
"start": 380,
"end": 1070,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 380,
"end": 398,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 385,
"end": 388,
"ctxt": 0
},
"value": "E01",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 395,
"end": 396,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 395,
"end": 396,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 400,
"end": 424,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 405,
"end": 408,
"ctxt": 0
},
"value": "E02",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 415,
"end": 422,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 419,
"end": 422,
"ctxt": 0
},
"value": 123.0,
"raw": "123"
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 426,
"end": 454,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 431,
"end": 434,
"ctxt": 0
},
"value": "E03",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 441,
"end": 452,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 441,
"end": 442,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 445,
"end": 452,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 456,
"end": 488,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 461,
"end": 464,
"ctxt": 0
},
"value": "E04",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 471,
"end": 472,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 471,
"end": 472,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 478,
"end": 479,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 478,
"end": 479,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 485,
"end": 486,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 485,
"end": 486,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 490,
"end": 527,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 495,
"end": 498,
"ctxt": 0
},
"value": "E05",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 505,
"end": 506,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 505,
"end": 506,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 512,
"end": 518,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 512,
"end": 513,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 516,
"end": 518,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 524,
"end": 525,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 524,
"end": 525,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 529,
"end": 587,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 534,
"end": 537,
"ctxt": 0
},
"value": "E06",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 544,
"end": 553,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 544,
"end": 545,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 548,
"end": 553,
"ctxt": 0
},
"value": "one",
"raw": "\"one\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 559,
"end": 568,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 559,
"end": 560,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 563,
"end": 568,
"ctxt": 0
},
"value": "two",
"raw": "\"two\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 574,
"end": 585,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 574,
"end": 575,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 578,
"end": 585,
"ctxt": 0
},
"value": "three",
"raw": "\"three\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 589,
"end": 662,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 594,
"end": 597,
"ctxt": 0
},
"value": "E07",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 604,
"end": 605,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 604,
"end": 605,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 611,
"end": 612,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 611,
"end": 612,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 618,
"end": 626,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 618,
"end": 619,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 622,
"end": 626,
"ctxt": 0
},
"value": "hi",
"raw": "\"hi\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 632,
"end": 638,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 632,
"end": 633,
"ctxt": 0
},
"value": "D",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 636,
"end": 638,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 644,
"end": 645,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 644,
"end": 645,
"ctxt": 0
},
"value": "E",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 651,
"end": 660,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 651,
"end": 652,
"ctxt": 0
},
"value": "F",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 655,
"end": 660,
"ctxt": 0
},
"value": "bye",
"raw": "\"bye\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 664,
"end": 738,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 669,
"end": 672,
"ctxt": 0
},
"value": "E08",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 679,
"end": 685,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 679,
"end": 680,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 683,
"end": 685,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 691,
"end": 702,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 691,
"end": 692,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 695,
"end": 702,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 708,
"end": 713,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 708,
"end": 709,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 712,
"end": 713,
"ctxt": 0
},
"value": "A",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 719,
"end": 724,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 719,
"end": 720,
"ctxt": 0
},
"value": "D",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 723,
"end": 724,
"ctxt": 0
},
"value": "B",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 730,
"end": 735,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 730,
"end": 731,
"ctxt": 0
},
"value": "E",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 734,
"end": 735,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 802,
"end": 813,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 807,
"end": 810,
"ctxt": 0
},
"value": "E10",
"optional": false
},
"members": []
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 815,
"end": 852,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 820,
"end": 823,
"ctxt": 0
},
"value": "E11",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 830,
"end": 836,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 830,
"end": 831,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 834,
"end": 836,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "NumericLiteral",
"span": {
"start": 835,
"end": 836,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 842,
"end": 843,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 842,
"end": 843,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 849,
"end": 850,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 849,
"end": 850,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 854,
"end": 913,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 859,
"end": 862,
"ctxt": 0
},
"value": "E12",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 869,
"end": 879,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 869,
"end": 870,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 873,
"end": 879,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 873,
"end": 874,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 878,
"end": 879,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 885,
"end": 895,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 885,
"end": 886,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 889,
"end": 895,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 889,
"end": 890,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 894,
"end": 895,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 901,
"end": 911,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 901,
"end": 902,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 905,
"end": 911,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 905,
"end": 906,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 910,
"end": 911,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 985,
"end": 1070,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 990,
"end": 993,
"ctxt": 0
},
"value": "E20",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 1000,
"end": 1016,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1000,
"end": 1001,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "MemberExpression",
"span": {
"start": 1004,
"end": 1016,
"ctxt": 0
},
"object": {
"type": "StringLiteral",
"span": {
"start": 1004,
"end": 1009,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
},
"property": {
"type": "Identifier",
"span": {
"start": 1010,
"end": 1016,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 1022,
"end": 1031,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1022,
"end": 1023,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 1026,
"end": 1031,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1026,
"end": 1027,
"ctxt": 0
},
"value": "A",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1030,
"end": 1031,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 1037,
"end": 1047,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1037,
"end": 1038,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 1041,
"end": 1047,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "StringLiteral",
"span": {
"start": 1042,
"end": 1047,
"ctxt": 0
},
"value": "123",
"raw": "\"123\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 1053,
"end": 1068,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1053,
"end": 1054,
"ctxt": 0
},
"value": "D",
"optional": false
},
"init": {
"type": "CallExpression",
"span": {
"start": 1057,
"end": 1068,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1057,
"end": 1065,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1057,
"end": 1061,
"ctxt": 0
},
"value": "Math",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1062,
"end": 1065,
"ctxt": 0
},
"value": "sin",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 1066,
"end": 1067,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
}
}
]
}
],
"interpreter": null
}