swc/crates/swc_css_parser/tests/fixture/rome/calc/output.json
2022-02-14 06:19:02 +00:00

1276 lines
42 KiB
JSON

{
"type": "Stylesheet",
"span": {
"start": 0,
"end": 239,
"ctxt": 0
},
"rules": [
{
"type": "QualifiedRule",
"span": {
"start": 0,
"end": 238,
"ctxt": 0
},
"prelude": {
"type": "SelectorList",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"children": [
{
"type": "ComplexSelector",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"children": [
{
"type": "CompoundSelector",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"nestingSelector": null,
"typeSelector": null,
"subclassSelectors": [
{
"type": "ClassSelector",
"span": {
"start": 0,
"end": 6,
"ctxt": 0
},
"text": {
"type": "Ident",
"span": {
"start": 1,
"end": 6,
"ctxt": 0
},
"value": "style",
"raw": "style"
}
}
]
}
]
}
]
},
"block": {
"type": "SimpleBlock",
"span": {
"start": 7,
"end": 238,
"ctxt": 0
},
"name": "{",
"value": [
{
"type": "Declaration",
"span": {
"start": 10,
"end": 26,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 10,
"end": 15,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 17,
"end": 26,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 17,
"end": 21,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 23,
"end": 25,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
]
}
]
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 29,
"end": 51,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 29,
"end": 34,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 36,
"end": 51,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 36,
"end": 40,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 41,
"end": 50,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 41,
"end": 44,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 41,
"end": 44,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 41,
"end": 42,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 42,
"end": 44,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 45,
"end": 46,
"ctxt": 0
},
"value": "+"
},
{
"type": "CalcProduct",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"type": "Ident",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
]
}
]
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 54,
"end": 75,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 61,
"end": 75,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 61,
"end": 65,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 66,
"end": 74,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 67,
"end": 69,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": "+"
},
{
"type": "CalcProduct",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"expressions": [
{
"type": "Percentage",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
}
]
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 78,
"end": 105,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 78,
"end": 83,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 85,
"end": 105,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 85,
"end": 89,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 90,
"end": 104,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 90,
"end": 104,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 91,
"end": 93,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
},
{
"type": "CalcOperator",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "*"
},
{
"type": "Percentage",
"span": {
"start": 96,
"end": 98,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"type": "CalcOperator",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "*"
},
{
"type": "Length",
"span": {
"start": 101,
"end": 104,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
},
"unit": {
"type": "Ident",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"value": "px",
"raw": "px"
}
}
]
}
]
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 108,
"end": 132,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 108,
"end": 113,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 115,
"end": 132,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 115,
"end": 119,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 120,
"end": 131,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 120,
"end": 131,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 120,
"end": 123,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 121,
"end": 123,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
},
{
"type": "CalcOperator",
"span": {
"start": 124,
"end": 125,
"ctxt": 0
},
"value": "/"
},
{
"type": "Number",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
{
"type": "CalcOperator",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "/"
},
{
"type": "Number",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
]
}
]
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 135,
"end": 171,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 135,
"end": 140,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 142,
"end": 171,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 142,
"end": 146,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 147,
"end": 170,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 147,
"end": 170,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 148,
"end": 150,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
},
{
"type": "CalcOperator",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "/"
},
{
"type": "CalcSum",
"span": {
"start": 153,
"end": 160,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"expressions": [
{
"type": "Number",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "-"
},
{
"type": "CalcProduct",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"expressions": [
{
"type": "Number",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
]
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "/"
},
{
"type": "CalcSum",
"span": {
"start": 163,
"end": 170,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"expressions": [
{
"type": "Number",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "-"
},
{
"type": "CalcProduct",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"expressions": [
{
"type": "Number",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": 6.0,
"raw": "6"
}
]
}
]
}
]
}
]
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 174,
"end": 198,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 174,
"end": 179,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 181,
"end": 198,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 181,
"end": 185,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 186,
"end": 197,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 186,
"end": 193,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 186,
"end": 189,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 187,
"end": 189,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
},
{
"type": "CalcOperator",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"value": "*"
},
{
"type": "Number",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "+"
},
{
"type": "CalcProduct",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"expressions": [
{
"type": "Number",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
]
}
]
}
]
}
],
"important": null
},
{
"type": "Declaration",
"span": {
"start": 201,
"end": 235,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 201,
"end": 206,
"ctxt": 0
},
"value": "width",
"raw": "width"
},
"value": [
{
"type": "Function",
"span": {
"start": 208,
"end": 235,
"ctxt": 0
},
"name": {
"type": "Ident",
"span": {
"start": 208,
"end": 212,
"ctxt": 0
},
"value": "calc",
"raw": "calc"
},
"value": [
{
"type": "CalcSum",
"span": {
"start": 213,
"end": 234,
"ctxt": 0
},
"expressions": [
{
"type": "CalcProduct",
"span": {
"start": 213,
"end": 220,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 213,
"end": 216,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"unit": {
"type": "Ident",
"span": {
"start": 214,
"end": 216,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
},
{
"type": "CalcOperator",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": "*"
},
{
"type": "Number",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "-"
},
{
"type": "CalcProduct",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"expressions": [
{
"type": "Number",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
]
},
{
"type": "CalcOperator",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "+"
},
{
"type": "CalcProduct",
"span": {
"start": 227,
"end": 234,
"ctxt": 0
},
"expressions": [
{
"type": "Length",
"span": {
"start": 227,
"end": 230,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
},
"unit": {
"type": "Ident",
"span": {
"start": 228,
"end": 230,
"ctxt": 0
},
"value": "em",
"raw": "em"
}
},
{
"type": "CalcOperator",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "/"
},
{
"type": "Number",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": 5.0,
"raw": "5"
}
]
}
]
}
]
}
],
"important": null
}
]
}
}
]
}