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

1262 lines
29 KiB
JSON

{
"type": "Module",
"span": {
"start": 280,
"end": 862,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 280,
"end": 296,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 287,
"end": 296,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "A",
"optional": false
},
"members": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 298,
"end": 326,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 305,
"end": 326,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"value": "B",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 318,
"end": 324,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 318,
"end": 324,
"ctxt": 0
},
"value": "Member",
"optional": false
},
"init": null
}
]
}
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 328,
"end": 337,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 333,
"end": 334,
"ctxt": 0
},
"value": "C",
"optional": false
},
"members": []
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 339,
"end": 352,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 354,
"end": 364,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 359,
"end": 361,
"ctxt": 0
},
"value": "DD",
"optional": false
},
"members": []
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 366,
"end": 385,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 375,
"end": 382,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 375,
"end": 377,
"ctxt": 0
},
"value": "DD",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "D",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 387,
"end": 403,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 394,
"end": 403,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 399,
"end": 400,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": []
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 404,
"end": 423,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 413,
"end": 420,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 413,
"end": 414,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 418,
"end": 420,
"ctxt": 0
},
"value": "EE",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 425,
"end": 444,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 434,
"end": 441,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"value": "F",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 439,
"end": 441,
"ctxt": 0
},
"value": "FF",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 445,
"end": 461,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 452,
"end": 461,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 457,
"end": 458,
"ctxt": 0
},
"value": "F",
"optional": false
},
"members": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 463,
"end": 504,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 470,
"end": 504,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"value": "G",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 483,
"end": 488,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 483,
"end": 484,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 487,
"end": 488,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 501,
"end": 502,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 501,
"end": 502,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 506,
"end": 548,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 513,
"end": 548,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 518,
"end": 519,
"ctxt": 0
},
"value": "H",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 526,
"end": 533,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 526,
"end": 527,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 530,
"end": 533,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 539,
"end": 546,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 539,
"end": 540,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 543,
"end": 546,
"ctxt": 0
},
"value": "b",
"raw": "\"b\""
}
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 550,
"end": 597,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 557,
"end": 597,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 562,
"end": 563,
"ctxt": 0
},
"value": "I",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 570,
"end": 577,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 570,
"end": 571,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "StringLiteral",
"span": {
"start": 574,
"end": 577,
"ctxt": 0
},
"value": "a",
"raw": "\"a\""
}
},
{
"type": "TsEnumMember",
"span": {
"start": 583,
"end": 588,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 583,
"end": 584,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 587,
"end": 588,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 594,
"end": 595,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 594,
"end": 595,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 599,
"end": 646,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 606,
"end": 646,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 617,
"end": 618,
"ctxt": 0
},
"value": "J",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 625,
"end": 630,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 625,
"end": 626,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 629,
"end": 630,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 636,
"end": 637,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 636,
"end": 637,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 643,
"end": 644,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 643,
"end": 644,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 648,
"end": 751,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 655,
"end": 751,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 660,
"end": 661,
"ctxt": 0
},
"value": "K",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 668,
"end": 678,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 668,
"end": 672,
"ctxt": 0
},
"value": "None",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 677,
"end": 678,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 684,
"end": 694,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 684,
"end": 685,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 688,
"end": 694,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 688,
"end": 689,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 693,
"end": 694,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 700,
"end": 710,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 700,
"end": 701,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 704,
"end": 710,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 704,
"end": 705,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 709,
"end": 710,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 716,
"end": 726,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 716,
"end": 717,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 720,
"end": 726,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 720,
"end": 721,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 725,
"end": 726,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 732,
"end": 748,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 732,
"end": 736,
"ctxt": 0
},
"value": "Mask",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 739,
"end": 748,
"ctxt": 0
},
"operator": "|",
"left": {
"type": "BinaryExpression",
"span": {
"start": 739,
"end": 744,
"ctxt": 0
},
"operator": "|",
"left": {
"type": "Identifier",
"span": {
"start": 739,
"end": 740,
"ctxt": 0
},
"value": "A",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 743,
"end": 744,
"ctxt": 0
},
"value": "B",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 747,
"end": 748,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 753,
"end": 862,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 760,
"end": 862,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 771,
"end": 772,
"ctxt": 0
},
"value": "L",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 779,
"end": 789,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 779,
"end": 783,
"ctxt": 0
},
"value": "None",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 788,
"end": 789,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 795,
"end": 805,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 795,
"end": 796,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 799,
"end": 805,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 799,
"end": 800,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 804,
"end": 805,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 811,
"end": 821,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 811,
"end": 812,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 815,
"end": 821,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 815,
"end": 816,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 820,
"end": 821,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 827,
"end": 837,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 827,
"end": 828,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 831,
"end": 837,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "NumericLiteral",
"span": {
"start": 831,
"end": 832,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 836,
"end": 837,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 843,
"end": 859,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 843,
"end": 847,
"ctxt": 0
},
"value": "Mask",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 850,
"end": 859,
"ctxt": 0
},
"operator": "|",
"left": {
"type": "BinaryExpression",
"span": {
"start": 850,
"end": 855,
"ctxt": 0
},
"operator": "|",
"left": {
"type": "Identifier",
"span": {
"start": 850,
"end": 851,
"ctxt": 0
},
"value": "A",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 854,
"end": 855,
"ctxt": 0
},
"value": "B",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 858,
"end": 859,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
}
]
}
}
],
"interpreter": null
}