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

231 lines
5.4 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 118,
"ctxt": 0
},
"body": [
{
"type": "SwitchStatement",
"span": {
"start": 16,
"end": 118,
"ctxt": 0
},
"discriminant": {
"type": "TemplateLiteral",
"span": {
"start": 24,
"end": 36,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 25,
"end": 28,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 32,
"end": 35,
"ctxt": 0
},
"tail": true,
"cooked": "abc",
"raw": "abc"
}
]
},
"cases": [
{
"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": "abc",
"raw": "abc"
}
]
},
"consequent": []
},
{
"type": "SwitchCase",
"span": {
"start": 60,
"end": 71,
"ctxt": 0
},
"test": {
"type": "TemplateLiteral",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"tail": true,
"cooked": "123",
"raw": "123"
}
]
},
"consequent": []
},
{
"type": "SwitchCase",
"span": {
"start": 76,
"end": 116,
"ctxt": 0
},
"test": {
"type": "TemplateLiteral",
"span": {
"start": 81,
"end": 93,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 82,
"end": 85,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 89,
"end": 92,
"ctxt": 0
},
"tail": true,
"cooked": "abc",
"raw": "abc"
}
]
},
"consequent": [
{
"type": "ExpressionStatement",
"span": {
"start": 103,
"end": 116,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 103,
"end": 115,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": 1.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 104,
"end": 107,
"ctxt": 0
},
"tail": false,
"cooked": "def",
"raw": "def"
},
{
"type": "TemplateElement",
"span": {
"start": 111,
"end": 114,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
}
]
}
]
}
],
"interpreter": null
}