swc/crates/swc_ecma_parser/tests/tsc/enumClassification.json
2022-03-22 07:54:08 +00:00

1241 lines
27 KiB
JSON

{
"type": "Script",
"span": {
"start": 379,
"end": 1069,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 379,
"end": 397,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 384,
"end": 387,
"ctxt": 0
},
"value": "E01",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 399,
"end": 423,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 404,
"end": 407,
"ctxt": 0
},
"value": "E02",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 414,
"end": 421,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 414,
"end": 415,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 418,
"end": 421,
"ctxt": 0
},
"value": 123.0
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 425,
"end": 453,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 430,
"end": 433,
"ctxt": 0
},
"value": "E03",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 440,
"end": 451,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 440,
"end": 441,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 444,
"end": 451,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 455,
"end": 487,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 463,
"ctxt": 0
},
"value": "E04",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 477,
"end": 478,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 477,
"end": 478,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 484,
"end": 485,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 484,
"end": 485,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 489,
"end": 526,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 494,
"end": 497,
"ctxt": 0
},
"value": "E05",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 504,
"end": 505,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 504,
"end": 505,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 511,
"end": 517,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 511,
"end": 512,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 515,
"end": 517,
"ctxt": 0
},
"value": 10.0
}
},
{
"type": "TsEnumMember",
"span": {
"start": 523,
"end": 524,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 523,
"end": 524,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 528,
"end": 586,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 533,
"end": 536,
"ctxt": 0
},
"value": "E06",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 543,
"end": 552,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 547,
"end": 552,
"ctxt": 0
},
"value": "one",
"raw": "\"one\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 558,
"end": 567,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 558,
"end": 559,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 562,
"end": 567,
"ctxt": 0
},
"value": "two",
"raw": "\"two\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 573,
"end": 584,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 573,
"end": 574,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 577,
"end": 584,
"ctxt": 0
},
"value": "three",
"raw": "\"three\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 588,
"end": 661,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 593,
"end": 596,
"ctxt": 0
},
"value": "E07",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 603,
"end": 604,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 603,
"end": 604,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 610,
"end": 611,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 610,
"end": 611,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 617,
"end": 625,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 617,
"end": 618,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 621,
"end": 625,
"ctxt": 0
},
"value": "hi",
"raw": "\"hi\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 631,
"end": 637,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 631,
"end": 632,
"ctxt": 0
},
"value": "D",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 635,
"end": 637,
"ctxt": 0
},
"value": 10.0
}
},
{
"type": "TsEnumMember",
"span": {
"start": 643,
"end": 644,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 643,
"end": 644,
"ctxt": 0
},
"value": "E",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 650,
"end": 659,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 650,
"end": 651,
"ctxt": 0
},
"value": "F",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 654,
"end": 659,
"ctxt": 0
},
"value": "bye",
"raw": "\"bye\""
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 663,
"end": 737,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 668,
"end": 671,
"ctxt": 0
},
"value": "E08",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 678,
"end": 684,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 678,
"end": 679,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 682,
"end": 684,
"ctxt": 0
},
"value": 10.0
}
},
{
"type": "TsEnumMember",
"span": {
"start": 690,
"end": 701,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 690,
"end": 691,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 694,
"end": 701,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 707,
"end": 712,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 707,
"end": 708,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 711,
"end": 712,
"ctxt": 0
},
"value": "A",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 718,
"end": 723,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 718,
"end": 719,
"ctxt": 0
},
"value": "D",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 722,
"end": 723,
"ctxt": 0
},
"value": "B",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 729,
"end": 734,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 729,
"end": 730,
"ctxt": 0
},
"value": "E",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 733,
"end": 734,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 801,
"end": 812,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 806,
"end": 809,
"ctxt": 0
},
"value": "E10",
"optional": false
},
"members": []
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 814,
"end": 851,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 819,
"end": 822,
"ctxt": 0
},
"value": "E11",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 829,
"end": 835,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 829,
"end": 830,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 833,
"end": 835,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "NumericLiteral",
"span": {
"start": 834,
"end": 835,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 841,
"end": 842,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 841,
"end": 842,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 848,
"end": 849,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 848,
"end": 849,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 853,
"end": 912,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 858,
"end": 861,
"ctxt": 0
},
"value": "E12",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 868,
"end": 878,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 868,
"end": 869,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 872,
"end": 878,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 872,
"end": 873,
"ctxt": 0
},
"value": 1.0
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 877,
"end": 878,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 884,
"end": 894,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 884,
"end": 885,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 888,
"end": 894,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 888,
"end": 889,
"ctxt": 0
},
"value": 1.0
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 893,
"end": 894,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 900,
"end": 910,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 900,
"end": 901,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 904,
"end": 910,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 904,
"end": 905,
"ctxt": 0
},
"value": 1.0
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 909,
"end": 910,
"ctxt": 0
},
"value": 2.0
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 984,
"end": 1069,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 989,
"end": 992,
"ctxt": 0
},
"value": "E20",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 999,
"end": 1015,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 999,
"end": 1000,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "MemberExpression",
"span": {
"start": 1003,
"end": 1015,
"ctxt": 0
},
"object": {
"type": "StringLiteral",
"span": {
"start": 1003,
"end": 1008,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
},
"property": {
"type": "Identifier",
"span": {
"start": 1009,
"end": 1015,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 1021,
"end": 1030,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1021,
"end": 1022,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 1025,
"end": 1030,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1025,
"end": 1026,
"ctxt": 0
},
"value": "A",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1029,
"end": 1030,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 1036,
"end": 1046,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1036,
"end": 1037,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 1040,
"end": 1046,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "StringLiteral",
"span": {
"start": 1041,
"end": 1046,
"ctxt": 0
},
"value": "123",
"raw": "\"123\""
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 1052,
"end": 1067,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1052,
"end": 1053,
"ctxt": 0
},
"value": "D",
"optional": false
},
"init": {
"type": "CallExpression",
"span": {
"start": 1056,
"end": 1067,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1056,
"end": 1064,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1056,
"end": 1060,
"ctxt": 0
},
"value": "Math",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1061,
"end": 1064,
"ctxt": 0
},
"value": "sin",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 1065,
"end": 1066,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
}
}
]
}
],
"interpreter": null
}