svelte-parse
Version:
An increidbly relaxed svelte-parser
173 lines (172 loc) • 3.06 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteBranchingBlock",
"name": "if",
"branches": [
{
"type": "svelteBranch",
"name": "if",
"expression": {
"type": "svelteExpression",
"value": "depth > 1",
"position": {
"start": {
"line": 1,
"column": 6,
"offset": 5
},
"end": {
"line": 1,
"column": 15,
"offset": 14
}
}
},
"children": [
{
"type": "text",
"value": "\n\t",
"position": {
"start": {
"line": 1,
"column": 16,
"offset": 15
},
"end": {
"line": 2,
"column": 2,
"offset": 17
}
}
},
{
"type": "svelteMeta",
"tagName": "self",
"properties": [
{
"type": "svelteProperty",
"name": "depth",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 2,
"column": 22,
"offset": 37
},
"end": {
"line": 2,
"column": 33,
"offset": 48
}
},
"expression": {
"type": "svelteExpression",
"value": "depth - 1",
"position": {
"start": {
"line": 2,
"column": 23,
"offset": 38
},
"end": {
"line": 2,
"column": 32,
"offset": 47
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 2,
"column": 15,
"offset": 30
},
"end": {
"line": 2,
"column": 34,
"offset": 49
}
}
}
],
"selfClosing": true,
"children": [],
"position": {
"start": {
"line": 2,
"column": 2,
"offset": 17
},
"end": {
"line": 2,
"column": 36,
"offset": 51
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 2,
"column": 36,
"offset": 51
},
"end": {
"line": 3,
"column": 1,
"offset": 52
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 1,
"offset": 52
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 6,
"offset": 57
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 6,
"offset": 57
}
}
}