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

949 lines
21 KiB
JSON

{
"type": "Script",
"span": {
"start": 86,
"end": 559,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 86,
"end": 114,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 91,
"end": 93,
"ctxt": 0
},
"value": "E1",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 100,
"end": 105,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 115,
"end": 145,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"value": "E2",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 129,
"end": 136,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 133,
"end": 136,
"ctxt": 0
},
"operator": "-",
"argument": {
"type": "NumericLiteral",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 146,
"end": 215,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 151,
"end": 153,
"ctxt": 0
},
"value": "E3",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 160,
"end": 167,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 164,
"end": 167,
"ctxt": 0
},
"value": 0.1,
"raw": "0.1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 217,
"end": 289,
"ctxt": 0
},
"declare": true,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 230,
"end": 232,
"ctxt": 0
},
"value": "E4",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 239,
"end": 244,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 243,
"end": 244,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 250,
"end": 256,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 254,
"end": 256,
"ctxt": 0
},
"operator": "-",
"argument": {
"type": "NumericLiteral",
"span": {
"start": 255,
"end": 256,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 262,
"end": 269,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 262,
"end": 263,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 266,
"end": 269,
"ctxt": 0
},
"value": 0.1,
"raw": "0.1"
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 291,
"end": 421,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 296,
"end": 298,
"ctxt": 0
},
"value": "E5",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 305,
"end": 314,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 305,
"end": 306,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 309,
"end": 314,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 309,
"end": 310,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 320,
"end": 331,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 320,
"end": 321,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 324,
"end": 331,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 324,
"end": 325,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 328,
"end": 331,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 337,
"end": 350,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 341,
"end": 350,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 341,
"end": 344,
"ctxt": 0
},
"value": 1.0,
"raw": "1.0"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 347,
"end": 350,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 356,
"end": 369,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 356,
"end": 357,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 360,
"end": 369,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 360,
"end": 363,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 366,
"end": 369,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 375,
"end": 382,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 375,
"end": 376,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 379,
"end": 382,
"ctxt": 0
},
"value": "NaN",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 388,
"end": 400,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 388,
"end": 389,
"ctxt": 0
},
"value": "f",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 392,
"end": 400,
"ctxt": 0
},
"value": "Infinity",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 406,
"end": 419,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"value": "g",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 410,
"end": 419,
"ctxt": 0
},
"operator": "-",
"argument": {
"type": "Identifier",
"span": {
"start": 411,
"end": 419,
"ctxt": 0
},
"value": "Infinity",
"optional": false
}
}
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 423,
"end": 559,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 434,
"end": 436,
"ctxt": 0
},
"value": "E6",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 443,
"end": 452,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 443,
"end": 444,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 447,
"end": 452,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 451,
"end": 452,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 458,
"end": 469,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 458,
"end": 459,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 462,
"end": 469,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 462,
"end": 463,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 466,
"end": 469,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 475,
"end": 488,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 479,
"end": 488,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 479,
"end": 482,
"ctxt": 0
},
"value": 1.0,
"raw": "1.0"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 485,
"end": 488,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 494,
"end": 507,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 498,
"end": 507,
"ctxt": 0
},
"operator": "/",
"left": {
"type": "NumericLiteral",
"span": {
"start": 498,
"end": 501,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 504,
"end": 507,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 513,
"end": 520,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 513,
"end": 514,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 517,
"end": 520,
"ctxt": 0
},
"value": "NaN",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 526,
"end": 538,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 526,
"end": 527,
"ctxt": 0
},
"value": "f",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 530,
"end": 538,
"ctxt": 0
},
"value": "Infinity",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 544,
"end": 557,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 544,
"end": 545,
"ctxt": 0
},
"value": "g",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 548,
"end": 557,
"ctxt": 0
},
"operator": "-",
"argument": {
"type": "Identifier",
"span": {
"start": 549,
"end": 557,
"ctxt": 0
},
"value": "Infinity",
"optional": false
}
}
}
]
}
],
"interpreter": null
}