svelte-parse
Version:
An increidbly relaxed svelte-parser
247 lines (246 loc) • 4.05 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteStyle",
"tagName": "style",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n .menu {\n background: #fff;\n box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);\n color: #000;\n padding: 20px;\n width: 200px;\n height: 200px;\n }\n",
"position": {
"start": {
"line": 1,
"column": 8,
"offset": 7
},
"end": {
"line": 10,
"column": 1,
"offset": 166
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 10,
"column": 9,
"offset": 174
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 10,
"column": 9,
"offset": 174
},
"end": {
"line": 12,
"column": 1,
"offset": 176
}
}
},
{
"type": "svelteElement",
"tagName": "div",
"properties": [
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "text",
"value": "menu",
"position": {
"start": {
"line": 12,
"column": 13,
"offset": 188
},
"end": {
"line": 12,
"column": 18,
"offset": 193
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 12,
"column": 6,
"offset": 181
},
"end": {
"line": 12,
"column": 18,
"offset": 193
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 12,
"column": 19,
"offset": 194
},
"end": {
"line": 13,
"column": 3,
"offset": 197
}
}
},
{
"type": "svelteElement",
"tagName": "h1",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "This is a menu.",
"position": {
"start": {
"line": 13,
"column": 7,
"offset": 201
},
"end": {
"line": 13,
"column": 22,
"offset": 216
}
}
}
],
"position": {
"start": {
"line": 13,
"column": 3,
"offset": 197
},
"end": {
"line": 13,
"column": 27,
"offset": 221
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 13,
"column": 27,
"offset": 221
},
"end": {
"line": 14,
"column": 3,
"offset": 224
}
}
},
{
"type": "svelteElement",
"tagName": "p",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "I can do anything I want.",
"position": {
"start": {
"line": 14,
"column": 6,
"offset": 227
},
"end": {
"line": 14,
"column": 31,
"offset": 252
}
}
}
],
"position": {
"start": {
"line": 14,
"column": 3,
"offset": 224
},
"end": {
"line": 14,
"column": 35,
"offset": 256
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 14,
"column": 35,
"offset": 256
},
"end": {
"line": 15,
"column": 1,
"offset": 257
}
}
}
],
"position": {
"start": {
"line": 12,
"column": 1,
"offset": 176
},
"end": {
"line": 15,
"column": 7,
"offset": 263
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 15,
"column": 7,
"offset": 263
}
}
}