svelte-parse
Version:
An increidbly relaxed svelte-parser
252 lines (251 loc) • 4.37 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\texport let animals;\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 3,
"column": 1,
"offset": 30
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 10,
"offset": 39
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 3,
"column": 10,
"offset": 39
},
"end": {
"line": 5,
"column": 1,
"offset": 41
}
}
},
{
"type": "svelteBranchingBlock",
"name": "each",
"branches": [
{
"type": "svelteBranch",
"name": "each",
"expression": {
"type": "svelteExpression",
"value": "animals as [key, value, ...rest]",
"position": {
"start": {
"line": 5,
"column": 8,
"offset": 48
},
"end": {
"line": 5,
"column": 40,
"offset": 80
}
}
},
"children": [
{
"type": "text",
"value": "\n\t",
"position": {
"start": {
"line": 5,
"column": 41,
"offset": 81
},
"end": {
"line": 6,
"column": 2,
"offset": 83
}
}
},
{
"type": "svelteElement",
"tagName": "p",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 6,
"column": 5,
"offset": 86
},
"end": {
"line": 6,
"column": 10,
"offset": 91
}
},
"expression": {
"type": "svelteExpression",
"value": "key",
"position": {
"start": {
"line": 6,
"column": 6,
"offset": 87
},
"end": {
"line": 6,
"column": 9,
"offset": 90
}
}
}
},
{
"type": "text",
"value": ": ",
"position": {
"start": {
"line": 6,
"column": 10,
"offset": 91
},
"end": {
"line": 6,
"column": 12,
"offset": 93
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 6,
"column": 12,
"offset": 93
},
"end": {
"line": 6,
"column": 19,
"offset": 100
}
},
"expression": {
"type": "svelteExpression",
"value": "value",
"position": {
"start": {
"line": 6,
"column": 13,
"offset": 94
},
"end": {
"line": 6,
"column": 18,
"offset": 99
}
}
}
}
],
"position": {
"start": {
"line": 6,
"column": 2,
"offset": 83
},
"end": {
"line": 6,
"column": 23,
"offset": 104
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 6,
"column": 23,
"offset": 104
},
"end": {
"line": 7,
"column": 1,
"offset": 105
}
}
}
],
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 41
},
"end": {
"line": 7,
"column": 1,
"offset": 105
}
}
}
],
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 41
},
"end": {
"line": 7,
"column": 8,
"offset": 112
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 7,
"column": 8,
"offset": 112
}
}
}