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

231 lines
5.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 102,
"ctxt": 0
},
"body": [
{
"type": "SwitchStatement",
"span": {
"start": 0,
"end": 102,
"ctxt": 0
},
"discriminant": {
"type": "TemplateLiteral",
"span": {
"start": 8,
"end": 20,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 9,
"end": 12,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 16,
"end": 19,
"ctxt": 0
},
"tail": true,
"cooked": "abc",
"raw": "abc"
}
]
},
"cases": [
{
"type": "SwitchCase",
"span": {
"start": 28,
"end": 39,
"ctxt": 0
},
"test": {
"type": "TemplateLiteral",
"span": {
"start": 33,
"end": 38,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 34,
"end": 37,
"ctxt": 0
},
"tail": true,
"cooked": "abc",
"raw": "abc"
}
]
},
"consequent": []
},
{
"type": "SwitchCase",
"span": {
"start": 44,
"end": 55,
"ctxt": 0
},
"test": {
"type": "TemplateLiteral",
"span": {
"start": 49,
"end": 54,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 50,
"end": 53,
"ctxt": 0
},
"tail": true,
"cooked": "123",
"raw": "123"
}
]
},
"consequent": []
},
{
"type": "SwitchCase",
"span": {
"start": 60,
"end": 100,
"ctxt": 0
},
"test": {
"type": "TemplateLiteral",
"span": {
"start": 65,
"end": 77,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"tail": true,
"cooked": "abc",
"raw": "abc"
}
]
},
"consequent": [
{
"type": "ExpressionStatement",
"span": {
"start": 87,
"end": 100,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 87,
"end": 99,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": 1.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 88,
"end": 91,
"ctxt": 0
},
"tail": false,
"cooked": "def",
"raw": "def"
},
{
"type": "TemplateElement",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
}
]
}
]
}
],
"interpreter": null
}