svelte-parse
Version:
An increidbly relaxed svelte-parser
142 lines (141 loc) • 2.2 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\tlet foo;\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 3,
"column": 1,
"offset": 19
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 10,
"offset": 28
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 3,
"column": 10,
"offset": 28
},
"end": {
"line": 5,
"column": 1,
"offset": 30
}
}
},
{
"type": "svelteElement",
"tagName": "canvas",
"properties": [
{
"type": "svelteDirective",
"name": "bind",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 5,
"column": 19,
"offset": 48
},
"end": {
"line": 5,
"column": 24,
"offset": 53
}
},
"expression": {
"type": "svelteExpression",
"value": "foo",
"position": {
"start": {
"line": 5,
"column": 20,
"offset": 49
},
"end": {
"line": 5,
"column": 23,
"offset": 52
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 5,
"column": 9,
"offset": 38
},
"end": {
"line": 5,
"column": 24,
"offset": 53
}
},
"specifier": "this"
}
],
"selfClosing": false,
"children": [],
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 30
},
"end": {
"line": 5,
"column": 34,
"offset": 63
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 5,
"column": 34,
"offset": 63
}
}
}