svelte-parse
Version:
An increidbly relaxed svelte-parser
455 lines (454 loc) • 8.38 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n import Chip from '@sveltekit/ui/Chip';\n\n let avatarWithImage = {\n alt: '',\n src: '/avatar_example.gif'\n };\n\n let avatarNoImage = {\n alt: 'XX'\n };\n\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 13,
"column": 1,
"offset": 171
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 13,
"column": 10,
"offset": 180
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 13,
"column": 10,
"offset": 180
},
"end": {
"line": 15,
"column": 1,
"offset": 182
}
}
},
{
"type": "svelteElement",
"tagName": "div",
"properties": [
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "text",
"value": "row",
"position": {
"start": {
"line": 15,
"column": 13,
"offset": 194
},
"end": {
"line": 15,
"column": 17,
"offset": 198
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 15,
"column": 6,
"offset": 187
},
"end": {
"line": 15,
"column": 17,
"offset": 198
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 15,
"column": 18,
"offset": 199
},
"end": {
"line": 16,
"column": 3,
"offset": 202
}
}
},
{
"type": "svelteElement",
"tagName": "span",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 16,
"column": 9,
"offset": 208
},
"end": {
"line": 17,
"column": 5,
"offset": 213
}
}
},
{
"type": "svelteComponent",
"tagName": "Chip",
"properties": [
{
"type": "svelteProperty",
"name": "avatar",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 17,
"column": 19,
"offset": 227
},
"end": {
"line": 17,
"column": 36,
"offset": 244
}
},
"expression": {
"type": "svelteExpression",
"value": "avatarWithImage",
"position": {
"start": {
"line": 17,
"column": 20,
"offset": 228
},
"end": {
"line": 17,
"column": 35,
"offset": 243
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 17,
"column": 11,
"offset": 219
},
"end": {
"line": 17,
"column": 37,
"offset": 245
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n Chip with Avatar image\n ",
"position": {
"start": {
"line": 17,
"column": 38,
"offset": 246
},
"end": {
"line": 19,
"column": 5,
"offset": 280
}
}
}
],
"position": {
"start": {
"line": 17,
"column": 5,
"offset": 213
},
"end": {
"line": 19,
"column": 12,
"offset": 287
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 19,
"column": 12,
"offset": 287
},
"end": {
"line": 20,
"column": 3,
"offset": 290
}
}
}
],
"position": {
"start": {
"line": 16,
"column": 3,
"offset": 202
},
"end": {
"line": 20,
"column": 10,
"offset": 297
}
}
},
{
"type": "text",
"value": "\n\n ",
"position": {
"start": {
"line": 20,
"column": 10,
"offset": 297
},
"end": {
"line": 22,
"column": 3,
"offset": 301
}
}
},
{
"type": "svelteElement",
"tagName": "span",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 22,
"column": 9,
"offset": 307
},
"end": {
"line": 23,
"column": 5,
"offset": 312
}
}
},
{
"type": "svelteComponent",
"tagName": "Chip",
"properties": [
{
"type": "svelteProperty",
"name": "avatar",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 23,
"column": 19,
"offset": 326
},
"end": {
"line": 23,
"column": 34,
"offset": 341
}
},
"expression": {
"type": "svelteExpression",
"value": "avatarNoImage",
"position": {
"start": {
"line": 23,
"column": 20,
"offset": 327
},
"end": {
"line": 23,
"column": 33,
"offset": 340
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 23,
"column": 11,
"offset": 318
},
"end": {
"line": 23,
"column": 35,
"offset": 342
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n Chip with Avatar text\n ",
"position": {
"start": {
"line": 23,
"column": 36,
"offset": 343
},
"end": {
"line": 25,
"column": 5,
"offset": 376
}
}
}
],
"position": {
"start": {
"line": 23,
"column": 5,
"offset": 312
},
"end": {
"line": 25,
"column": 12,
"offset": 383
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 25,
"column": 12,
"offset": 383
},
"end": {
"line": 26,
"column": 3,
"offset": 386
}
}
}
],
"position": {
"start": {
"line": 22,
"column": 3,
"offset": 301
},
"end": {
"line": 26,
"column": 10,
"offset": 393
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 26,
"column": 10,
"offset": 393
},
"end": {
"line": 27,
"column": 1,
"offset": 394
}
}
}
],
"position": {
"start": {
"line": 15,
"column": 1,
"offset": 182
},
"end": {
"line": 27,
"column": 7,
"offset": 400
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 27,
"column": 7,
"offset": 400
}
}
}