swc/ecmascript/parser/tests/jsx/basic/3/input.js.json
David Sherret 0d67d5d855 Fix JSX opening, closing, spread child, and expression container spans (#582)
swc_ecma_parser:
 - fix opening and closing jsx spans.
 - fix JSX expression.
 - fix JSX spread child.
2020-01-14 12:37:29 +09:00

237 lines
5.8 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 40,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 0,
"end": 40,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 0,
"end": 40,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 1,
"end": 2,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 0,
"end": 15,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 3,
"end": 14,
"ctxt": 0
},
"name": {
"type": "JSXNamespacedName",
"namespace": {
"type": "Identifier",
"span": {
"start": 3,
"end": 4,
"ctxt": 0
},
"value": "n",
"typeAnnotation": null,
"optional": false
},
"name": {
"type": "Identifier",
"span": {
"start": 5,
"end": 8,
"ctxt": 0
},
"value": "foo",
"typeAnnotation": null,
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 9,
"end": 14,
"ctxt": 0
},
"value": "bar",
"hasEscape": false
}
}
],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXExpressionContainer",
"span": {
"start": 16,
"end": 23,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 17,
"end": 22,
"ctxt": 0
},
"value": "value",
"typeAnnotation": null,
"optional": false
}
},
{
"type": "JSXText",
"span": {
"start": 23,
"end": 24,
"ctxt": 0
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 24,
"end": 36,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 25,
"end": 26,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 24,
"end": 27,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXElement",
"span": {
"start": 27,
"end": 32,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "c",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 27,
"end": 32,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 32,
"end": 36,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 36,
"end": 40,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
}
}
}
],
"interpreter": null
}