svelte-parse
Version:
An increidbly relaxed svelte-parser
137 lines (136 loc) • 2.06 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\texport let answer = 'a mystery';\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 3,
"column": 1,
"offset": 43
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 10,
"offset": 52
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 3,
"column": 10,
"offset": 52
},
"end": {
"line": 5,
"column": 1,
"offset": 54
}
}
},
{
"type": "svelteElement",
"tagName": "p",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "The answer is ",
"position": {
"start": {
"line": 5,
"column": 4,
"offset": 57
},
"end": {
"line": 5,
"column": 18,
"offset": 71
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 5,
"column": 18,
"offset": 71
},
"end": {
"line": 5,
"column": 26,
"offset": 79
}
},
"expression": {
"type": "svelteExpression",
"value": "answer",
"position": {
"start": {
"line": 5,
"column": 19,
"offset": 72
},
"end": {
"line": 5,
"column": 25,
"offset": 78
}
}
}
}
],
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 54
},
"end": {
"line": 5,
"column": 30,
"offset": 83
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 5,
"column": 30,
"offset": 83
}
}
}