svelte-parse
Version:
An increidbly relaxed svelte-parser
142 lines (141 loc) • 2.32 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\timport Inner from './Inner.svelte';\n\n\tfunction handleMessage(event) {\n\t\talert(event.detail.text);\n\t}\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 7,
"column": 1,
"offset": 111
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 7,
"column": 10,
"offset": 120
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 7,
"column": 10,
"offset": 120
},
"end": {
"line": 9,
"column": 1,
"offset": 122
}
}
},
{
"type": "svelteComponent",
"tagName": "Inner",
"properties": [
{
"type": "svelteDirective",
"name": "on",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 9,
"column": 19,
"offset": 140
},
"end": {
"line": 9,
"column": 34,
"offset": 155
}
},
"expression": {
"type": "svelteExpression",
"value": "handleMessage",
"position": {
"start": {
"line": 9,
"column": 20,
"offset": 141
},
"end": {
"line": 9,
"column": 33,
"offset": 154
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 9,
"column": 8,
"offset": 129
},
"end": {
"line": 9,
"column": 34,
"offset": 155
}
},
"specifier": "message"
}
],
"selfClosing": true,
"children": [],
"position": {
"start": {
"line": 9,
"column": 1,
"offset": 122
},
"end": {
"line": 9,
"column": 36,
"offset": 157
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 9,
"column": 36,
"offset": 157
}
}
}