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

177 lines
4.5 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 75,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 75,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 9,
"end": 74,
"ctxt": 0
},
"expressions": [
{
"type": "TemplateLiteral",
"span": {
"start": 16,
"end": 36,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 24,
"end": 29,
"ctxt": 0
},
"value": " | ",
"raw": "\" | \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 17,
"end": 21,
"ctxt": 0
},
"tail": false,
"cooked": "456 ",
"raw": "456 "
},
{
"type": "TemplateElement",
"span": {
"start": 31,
"end": 35,
"ctxt": 0
},
"tail": true,
"cooked": " 654",
"raw": " 654"
}
]
},
{
"type": "TemplateLiteral",
"span": {
"start": 48,
"end": 68,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 56,
"end": 61,
"ctxt": 0
},
"value": " | ",
"raw": "\" | \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 49,
"end": 53,
"ctxt": 0
},
"tail": false,
"cooked": "456 ",
"raw": "456 "
},
{
"type": "TemplateElement",
"span": {
"start": 63,
"end": 67,
"ctxt": 0
},
"tail": true,
"cooked": " 654",
"raw": " 654"
}
]
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 10,
"end": 13,
"ctxt": 0
},
"tail": false,
"cooked": "123",
"raw": "123"
},
{
"type": "TemplateElement",
"span": {
"start": 38,
"end": 45,
"ctxt": 0
},
"tail": false,
"cooked": "321 123",
"raw": "321 123"
},
{
"type": "TemplateElement",
"span": {
"start": 70,
"end": 73,
"ctxt": 0
},
"tail": true,
"cooked": "321",
"raw": "321"
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}