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

769 lines
23 KiB
JSON

{
"type": "Script",
"span": {
"start": 61,
"end": 924,
"ctxt": 0
},
"body": [
{
"type": "SwitchStatement",
"span": {
"start": 61,
"end": 105,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 69,
"end": 71,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 79,
"end": 103,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "BreakStatement",
"span": {
"start": 97,
"end": 103,
"ctxt": 0
},
"label": null
}
]
}
]
},
{
"type": "LabeledStatement",
"span": {
"start": 107,
"end": 160,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 107,
"end": 110,
"ctxt": 0
},
"value": "ONE",
"optional": false
},
"body": {
"type": "SwitchStatement",
"span": {
"start": 112,
"end": 160,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 130,
"end": 158,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "BreakStatement",
"span": {
"start": 148,
"end": 158,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"value": "ONE",
"optional": false
}
}
]
}
]
}
},
{
"type": "LabeledStatement",
"span": {
"start": 162,
"end": 224,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 162,
"end": 165,
"ctxt": 0
},
"value": "TWO",
"optional": false
},
"body": {
"type": "LabeledStatement",
"span": {
"start": 167,
"end": 224,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 167,
"end": 172,
"ctxt": 0
},
"value": "THREE",
"optional": false
},
"body": {
"type": "SwitchStatement",
"span": {
"start": 174,
"end": 224,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 182,
"end": 184,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 192,
"end": 222,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "BreakStatement",
"span": {
"start": 210,
"end": 222,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 216,
"end": 221,
"ctxt": 0
},
"value": "THREE",
"optional": false
}
}
]
}
]
}
}
},
{
"type": "LabeledStatement",
"span": {
"start": 226,
"end": 357,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 226,
"end": 230,
"ctxt": 0
},
"value": "FOUR",
"optional": false
},
"body": {
"type": "SwitchStatement",
"span": {
"start": 232,
"end": 357,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 250,
"end": 355,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 255,
"end": 258,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "LabeledStatement",
"span": {
"start": 268,
"end": 355,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 268,
"end": 272,
"ctxt": 0
},
"value": "FIVE",
"optional": false
},
"body": {
"type": "SwitchStatement",
"span": {
"start": 282,
"end": 355,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 290,
"end": 292,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 308,
"end": 345,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 313,
"end": 316,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "BreakStatement",
"span": {
"start": 334,
"end": 345,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 340,
"end": 344,
"ctxt": 0
},
"value": "FOUR",
"optional": false
}
}
]
}
]
}
}
]
}
]
}
},
{
"type": "SwitchStatement",
"span": {
"start": 359,
"end": 482,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 367,
"end": 369,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 377,
"end": 480,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 382,
"end": 385,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "LabeledStatement",
"span": {
"start": 395,
"end": 480,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 395,
"end": 398,
"ctxt": 0
},
"value": "SIX",
"optional": false
},
"body": {
"type": "SwitchStatement",
"span": {
"start": 408,
"end": 480,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 416,
"end": 418,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 434,
"end": 470,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 439,
"end": 442,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "BreakStatement",
"span": {
"start": 460,
"end": 470,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 466,
"end": 469,
"ctxt": 0
},
"value": "SIX",
"optional": false
}
}
]
}
]
}
}
]
}
]
},
{
"type": "LabeledStatement",
"span": {
"start": 484,
"end": 924,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 484,
"end": 489,
"ctxt": 0
},
"value": "SEVEN",
"optional": false
},
"body": {
"type": "SwitchStatement",
"span": {
"start": 491,
"end": 924,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 499,
"end": 501,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 509,
"end": 922,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 514,
"end": 517,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "SwitchStatement",
"span": {
"start": 527,
"end": 922,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 535,
"end": 537,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 553,
"end": 912,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 558,
"end": 561,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "SwitchStatement",
"span": {
"start": 579,
"end": 912,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 587,
"end": 589,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 613,
"end": 894,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 618,
"end": 621,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "BreakStatement",
"span": {
"start": 647,
"end": 659,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 653,
"end": 658,
"ctxt": 0
},
"value": "SEVEN",
"optional": false
}
},
{
"type": "LabeledStatement",
"span": {
"start": 684,
"end": 894,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 684,
"end": 689,
"ctxt": 0
},
"value": "EIGHT",
"optional": false
},
"body": {
"type": "SwitchStatement",
"span": {
"start": 715,
"end": 894,
"ctxt": 0
},
"discriminant": {
"type": "StringLiteral",
"span": {
"start": 723,
"end": 725,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 757,
"end": 868,
"ctxt": 0
},
"test": {
"type": "StringLiteral",
"span": {
"start": 762,
"end": 765,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
},
"consequent": [
{
"type": "VariableDeclaration",
"span": {
"start": 799,
"end": 823,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 803,
"end": 823,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 803,
"end": 805,
"ctxt": 0
},
"value": "fn",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 808,
"end": 823,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 820,
"end": 823,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "BreakStatement",
"span": {
"start": 856,
"end": 868,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 862,
"end": 867,
"ctxt": 0
},
"value": "EIGHT",
"optional": false
}
}
]
}
]
}
}
]
}
]
}
]
}
]
}
]
}
]
}
}
],
"interpreter": null
}