svelte-parse
Version:
An increidbly relaxed svelte-parser
210 lines (209 loc) • 3.27 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\timport Box from './Box.svelte';\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 3,
"column": 1,
"offset": 42
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 3,
"column": 10,
"offset": 51
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 3,
"column": 10,
"offset": 51
},
"end": {
"line": 5,
"column": 1,
"offset": 53
}
}
},
{
"type": "svelteComponent",
"tagName": "Box",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\t",
"position": {
"start": {
"line": 5,
"column": 6,
"offset": 58
},
"end": {
"line": 6,
"column": 2,
"offset": 60
}
}
},
{
"type": "svelteElement",
"tagName": "h2",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "Hello!",
"position": {
"start": {
"line": 6,
"column": 6,
"offset": 64
},
"end": {
"line": 6,
"column": 12,
"offset": 70
}
}
}
],
"position": {
"start": {
"line": 6,
"column": 2,
"offset": 60
},
"end": {
"line": 6,
"column": 17,
"offset": 75
}
}
},
{
"type": "text",
"value": "\n\t",
"position": {
"start": {
"line": 6,
"column": 17,
"offset": 75
},
"end": {
"line": 7,
"column": 2,
"offset": 77
}
}
},
{
"type": "svelteElement",
"tagName": "p",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "This is a box. It can contain anything.",
"position": {
"start": {
"line": 7,
"column": 5,
"offset": 80
},
"end": {
"line": 7,
"column": 44,
"offset": 119
}
}
}
],
"position": {
"start": {
"line": 7,
"column": 2,
"offset": 77
},
"end": {
"line": 7,
"column": 48,
"offset": 123
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 7,
"column": 48,
"offset": 123
},
"end": {
"line": 8,
"column": 1,
"offset": 124
}
}
}
],
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 53
},
"end": {
"line": 8,
"column": 7,
"offset": 130
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 8,
"column": 7,
"offset": 130
}
}
}