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

380 lines
8.7 KiB
JSON

{
"type": "Script",
"span": {
"start": 310,
"end": 440,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 310,
"end": 440,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 321,
"end": 322,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 329,
"end": 335,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 333,
"end": 335,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
{
"type": "TsEnumMember",
"span": {
"start": 341,
"end": 346,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"type": "TsEnumMember",
"span": {
"start": 352,
"end": 361,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 356,
"end": 361,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 357,
"end": 360,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 357,
"end": 358,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": "e",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 374,
"end": 380,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 374,
"end": 375,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": {
"type": "UnaryExpression",
"span": {
"start": 378,
"end": 380,
"ctxt": 0
},
"operator": "~",
"argument": {
"type": "Identifier",
"span": {
"start": 379,
"end": 380,
"ctxt": 0
},
"value": "e",
"optional": false
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 386,
"end": 401,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"value": "f",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 390,
"end": 401,
"ctxt": 0
},
"operator": ">>",
"left": {
"type": "BinaryExpression",
"span": {
"start": 390,
"end": 396,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "Identifier",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 395,
"end": 396,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 400,
"end": 401,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 407,
"end": 423,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "g",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 411,
"end": 423,
"ctxt": 0
},
"operator": ">>>",
"left": {
"type": "BinaryExpression",
"span": {
"start": 411,
"end": 417,
"ctxt": 0
},
"operator": "<<",
"left": {
"type": "Identifier",
"span": {
"start": 411,
"end": 412,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 416,
"end": 417,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 422,
"end": 423,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "TsEnumMember",
"span": {
"start": 429,
"end": 438,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"value": "h",
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 433,
"end": 438,
"ctxt": 0
},
"operator": "|",
"left": {
"type": "Identifier",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 437,
"end": 438,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
}
]
}
],
"interpreter": null
}