swc/crates/swc_ecma_parser/tests/tsc/tsxParseTests1.json
2022-02-04 17:08:38 +09:00

380 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 39,
"end": 185,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 39,
"end": 128,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 58,
"end": 128,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 61,
"end": 82,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 71,
"end": 78,
"ctxt": 0
},
"value": "Element",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 84,
"end": 126,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 111,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 112,
"end": 126,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 114,
"end": 118,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 117,
"ctxt": 0
},
"value": "div",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": null,
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 119,
"end": 124,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 119,
"end": 123,
"ctxt": 0
},
"value": "span",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": null,
"typeParams": null
}
]
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 130,
"end": 185,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 134,
"end": 184,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 138,
"end": 184,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 139,
"end": 142,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 138,
"end": 143,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXElement",
"span": {
"start": 143,
"end": 178,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 144,
"end": 147,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 143,
"end": 148,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXElement",
"span": {
"start": 148,
"end": 172,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 149,
"end": 153,
"ctxt": 0
},
"value": "span",
"optional": false
},
"span": {
"start": 148,
"end": 154,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXElement",
"span": {
"start": 154,
"end": 165,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 155,
"end": 158,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 154,
"end": 159,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 159,
"end": 165,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 161,
"end": 164,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 165,
"end": 172,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 167,
"end": 171,
"ctxt": 0
},
"value": "span",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 172,
"end": 178,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 174,
"end": 177,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 178,
"end": 184,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 180,
"end": 183,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}