You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/parser/samples/if-block-elseif/output.json

161 lines
2.7 KiB

{
"html": {
"start": 0,
"end": 89,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 89,
"type": "IfBlock",
"expression": {
"type": "BinaryExpression",
"start": 5,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 11
}
},
"left": {
"type": "Identifier",
"start": 5,
"end": 6,
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 6
}
},
"name": "x"
},
"operator": ">",
"right": {
"type": "Literal",
"start": 9,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 11
}
},
"value": 10,
"raw": "10"
}
},
"children": [
{
"start": 14,
"end": 41,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 17,
"end": 37,
"type": "Text",
"raw": "x is greater than 10",
"data": "x is greater than 10"
}
]
}
],
"else": {
"start": 58,
"end": 84,
"type": "ElseBlock",
"children": [
{
"start": 58,
"end": 89,
"type": "IfBlock",
"elseif": true,
"expression": {
"type": "BinaryExpression",
"start": 52,
"end": 57,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 15
}
},
"left": {
"type": "Identifier",
"start": 52,
"end": 53,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 11
}
},
"name": "x"
},
"operator": "<",
"right": {
"type": "Literal",
"start": 56,
"end": 57,
"loc": {
"start": {
"line": 3,
"column": 14
},
"end": {
"line": 3,
"column": 15
}
},
"value": 5,
"raw": "5"
}
},
"children": [
{
"start": 60,
"end": 83,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 63,
"end": 79,
"type": "Text",
"raw": "x is less than 5",
"data": "x is less than 5"
}
]
}
]
}
]
}
}
]
}
}