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/event-handler/output.json

164 lines
2.8 KiB

{
"html": {
"start": 0,
"end": 97,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 61,
"type": "Element",
"name": "button",
"attributes": [
{
8 years ago
"start": 8,
"end": 45,
"type": "EventHandler",
"name": "click",
"modifiers": [],
"expression": {
"type": "ArrowFunctionExpression",
"start": 19,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 43
}
},
"id": null,
"expression": true,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "AssignmentExpression",
"start": 25,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 43
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 25,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 32
}
},
"name": "visible"
},
"right": {
"type": "UnaryExpression",
"start": 35,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 35
},
"end": {
"line": 1,
"column": 43
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 36,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 36
},
"end": {
"line": 1,
"column": 43
}
},
"name": "visible"
}
}
}
}
}
],
"children": [
{
"start": 46,
"end": 52,
"type": "Text",
"raw": "toggle",
"data": "toggle"
}
]
},
{
"start": 61,
"end": 63,
"type": "Text",
"raw": "\n\n",
"data": "\n\n"
},
{
"start": 63,
"end": 97,
"type": "IfBlock",
"expression": {
"type": "Identifier",
"start": 68,
"end": 75,
"loc": {
"start": {
"line": 3,
"column": 5
},
"end": {
"line": 3,
"column": 12
}
},
"name": "visible"
},
"children": [
{
"start": 78,
"end": 91,
"type": "Element",
"name": "p",
"attributes": [],
"children": [
{
"start": 81,
"end": 87,
"type": "Text",
"raw": "hello!",
"data": "hello!"
}
]
}
]
}
]
}
}