swc/css/parser/tests/fixture/rome/smoke/output.json
Donny/강동윤 b206404d94
feat(css): Recover from invalid properties (#2312)
swc_css_ast:
 - Add `DeclBlockItem`.
 - Change `DeclBlock.properties` to `DeclBlock.items`.

swc_css_parser:
 - Add a way to recovered errors.
2021-09-28 09:58:56 +00:00

189 lines
4.7 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 22,
"end": 80,
"ctxt": 0
},
"rules": [
{
"type": "StyleRule",
"span": {
"start": 22,
"end": 78,
"ctxt": 0
},
"selectors": [
{
"type": "ComplexSelector",
"span": {
"start": 22,
"end": 26,
"ctxt": 0
},
"selectors": [
{
"type": "CompoundSelector",
"span": {
"start": 22,
"end": 26,
"ctxt": 0
},
"hasNestPrefix": false,
"combinator": null,
"typeSelector": {
"type": "NamespacedName",
"span": {
"start": 22,
"end": 26,
"ctxt": 0
},
"prefix": null,
"name": {
"type": "Text",
"span": {
"start": 22,
"end": 26,
"ctxt": 0
},
"value": "body"
}
},
"subclassSelectors": []
}
]
}
],
"block": {
"type": "DeclBlock",
"span": {
"start": 27,
"end": 78,
"ctxt": 0
},
"items": [
{
"type": "Property",
"span": {
"start": 33,
"end": 48,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 33,
"end": 43,
"ctxt": 0
},
"value": "background"
},
"values": [
{
"type": "Text",
"span": {
"start": 45,
"end": 48,
"ctxt": 0
},
"value": "red"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 54,
"end": 75,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "width"
},
"values": [
{
"type": "FnValue",
"span": {
"start": 61,
"end": 75,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 61,
"end": 65,
"ctxt": 0
},
"value": "calc"
},
"args": [
{
"type": "BinValue",
"span": {
"start": 66,
"end": 74,
"ctxt": 0
},
"op": "+",
"left": {
"type": "UnitValue",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"value": 1.0
},
"unit": {
"span": {
"start": 67,
"end": 69,
"ctxt": 0
},
"kind": null
}
},
"right": {
"type": "PercentValue",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": 2.0
}
}
}
]
}
],
"important": null
}
]
}
}
]
}