svelte-parse
Version:
An increidbly relaxed svelte-parser
192 lines (191 loc) • 3.28 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\timport { onMount } from 'svelte';\n\n\tlet constructor;\n\n\tonMount(async () => {\n\t\tconstructor = await $$props.this();\n\t});\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 9,
"column": 1,
"offset": 130
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 9,
"column": 10,
"offset": 139
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 9,
"column": 10,
"offset": 139
},
"end": {
"line": 11,
"column": 1,
"offset": 141
}
}
},
{
"type": "svelteMeta",
"tagName": "component",
"properties": [
{
"type": "svelteProperty",
"name": "this",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 11,
"column": 24,
"offset": 164
},
"end": {
"line": 11,
"column": 37,
"offset": 177
}
},
"expression": {
"type": "svelteExpression",
"value": "constructor",
"position": {
"start": {
"line": 11,
"column": 25,
"offset": 165
},
"end": {
"line": 11,
"column": 36,
"offset": 176
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 11,
"column": 19,
"offset": 159
},
"end": {
"line": 11,
"column": 37,
"offset": 177
}
}
},
{
"type": "svelteProperty",
"name": "...$$props",
"value": [
{
"type": "svelteDynamicContent",
"expression": {
"type": "svelteExpression",
"value": "...$$props",
"position": {
"start": {
"line": 11,
"column": 39,
"offset": 179
},
"end": {
"line": 11,
"column": 49,
"offset": 189
}
}
},
"position": {
"start": {
"line": 11,
"column": 38,
"offset": 178
},
"end": {
"line": 11,
"column": 49,
"offset": 189
}
}
}
],
"modifiers": [],
"shorthand": "expression",
"position": {
"start": {
"line": 11,
"column": 38,
"offset": 178
},
"end": {
"line": 11,
"column": 49,
"offset": 189
}
}
}
],
"selfClosing": true,
"children": [],
"position": {
"start": {
"line": 11,
"column": 1,
"offset": 141
},
"end": {
"line": 11,
"column": 52,
"offset": 192
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 11,
"column": 52,
"offset": 192
}
}
}