mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 20:22:26 +03:00
76ce98b685
swc_common: - implement Serialize / Deserialize for span swc_ecma_parser: - use json instead of {:#?} while testing - update test references
142 lines
3.5 KiB
JSON
142 lines
3.5 KiB
JSON
{
|
|
"type": "Module",
|
|
"span": {
|
|
"start": 0,
|
|
"end": 27,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 0,
|
|
"end": 27,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"span": {
|
|
"start": 1,
|
|
"end": 2,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"typeAnnotation": null,
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 1,
|
|
"end": 27,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [
|
|
{
|
|
"type": "JSXAttribute",
|
|
"span": {
|
|
"start": 3,
|
|
"end": 24,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"span": {
|
|
"start": 3,
|
|
"end": 4,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"typeAnnotation": null,
|
|
"optional": false
|
|
},
|
|
"value": {
|
|
"type": "ConditionalExpression",
|
|
"span": {
|
|
"start": 6,
|
|
"end": 23,
|
|
"ctxt": 0
|
|
},
|
|
"test": {
|
|
"span": {
|
|
"start": 6,
|
|
"end": 7,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"typeAnnotation": null,
|
|
"optional": false
|
|
},
|
|
"consequent": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 10,
|
|
"end": 15,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"span": {
|
|
"start": 11,
|
|
"end": 12,
|
|
"ctxt": 0
|
|
},
|
|
"value": "c",
|
|
"typeAnnotation": null,
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 11,
|
|
"end": 15,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [],
|
|
"selfClosing": true,
|
|
"typeArguments": null
|
|
},
|
|
"children": [],
|
|
"closing": null
|
|
},
|
|
"alternate": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 18,
|
|
"end": 23,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"span": {
|
|
"start": 19,
|
|
"end": 20,
|
|
"ctxt": 0
|
|
},
|
|
"value": "d",
|
|
"typeAnnotation": null,
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 19,
|
|
"end": 23,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [],
|
|
"selfClosing": true,
|
|
"typeArguments": null
|
|
},
|
|
"children": [],
|
|
"closing": null
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"selfClosing": true,
|
|
"typeArguments": null
|
|
},
|
|
"children": [],
|
|
"closing": null
|
|
}
|
|
],
|
|
"shebang": null
|
|
}
|