svelte-parse
Version:
An increidbly relaxed svelte-parser
159 lines (158 loc) • 2.54 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\timport { count } from './stores.js';\n\n\tfunction reset() {\n\t\tcount.set(0);\n\t}\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 7,
"column": 1,
"offset": 87
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 7,
"column": 10,
"offset": 96
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 7,
"column": 10,
"offset": 96
},
"end": {
"line": 9,
"column": 1,
"offset": 98
}
}
},
{
"type": "svelteElement",
"tagName": "button",
"properties": [
{
"type": "svelteDirective",
"name": "on",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 9,
"column": 18,
"offset": 115
},
"end": {
"line": 9,
"column": 25,
"offset": 122
}
},
"expression": {
"type": "svelteExpression",
"value": "reset",
"position": {
"start": {
"line": 9,
"column": 19,
"offset": 116
},
"end": {
"line": 9,
"column": 24,
"offset": 121
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 9,
"column": 9,
"offset": 106
},
"end": {
"line": 9,
"column": 25,
"offset": 122
}
},
"specifier": "click"
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\treset\n",
"position": {
"start": {
"line": 9,
"column": 26,
"offset": 123
},
"end": {
"line": 11,
"column": 1,
"offset": 131
}
}
}
],
"position": {
"start": {
"line": 9,
"column": 1,
"offset": 98
},
"end": {
"line": 11,
"column": 10,
"offset": 140
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 11,
"column": 10,
"offset": 140
}
}
}