swc/ecmascript/parser/tests/jsx/basic/3/input.js.json
강동윤 76ce98b685
Implement serialize for ast nodes (#244)
swc_common:
 - implement Serialize / Deserialize for span

swc_ecma_parser:
 - use json instead of {:#?} while testing
 - update test references
2019-02-20 11:35:41 +09:00

216 lines
4.8 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 40,
"ctxt": 0
},
"body": [
{
"type": "JSXElement",
"span": {
"start": 0,
"end": 40,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"span": {
"start": 1,
"end": 2,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 1,
"end": 15,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 3,
"end": 14,
"ctxt": 0
},
"name": {
"type": "JSXNamespacedName",
"namespace": {
"span": {
"start": 3,
"end": 4,
"ctxt": 0
},
"value": "n",
"typeAnnotation": null,
"optional": false
},
"name": {
"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",
"expression": {
"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": {
"span": {
"start": 25,
"end": 26,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 25,
"end": 27,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXElement",
"span": {
"start": 27,
"end": 32,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "c",
"typeAnnotation": null,
"optional": false
},
"span": {
"start": 28,
"end": 32,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 34,
"end": 36,
"ctxt": 0
},
"name": {
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 38,
"end": 40,
"ctxt": 0
},
"name": {
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
}
}
],
"shebang": null
}