svelte-parse
Version:
An increidbly relaxed svelte-parser
559 lines (558 loc) • 10.2 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n import Button, { options } from '@sveltekit/ui/Button';\n\n let isWaiting = false;\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 5,
"column": 1,
"offset": 93
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 5,
"column": 10,
"offset": 102
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 5,
"column": 10,
"offset": 102
},
"end": {
"line": 7,
"column": 1,
"offset": 104
}
}
},
{
"type": "svelteElement",
"tagName": "div",
"properties": [
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "text",
"value": "row",
"position": {
"start": {
"line": 7,
"column": 13,
"offset": 116
},
"end": {
"line": 7,
"column": 17,
"offset": 120
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 7,
"column": 6,
"offset": 109
},
"end": {
"line": 7,
"column": 17,
"offset": 120
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 7,
"column": 18,
"offset": 121
},
"end": {
"line": 8,
"column": 3,
"offset": 124
}
}
},
{
"type": "svelteComponent",
"tagName": "Button",
"properties": [
{
"type": "svelteProperty",
"name": "isWaiting",
"value": [
{
"type": "svelteDynamicContent",
"expression": {
"type": "svelteExpression",
"value": "isWaiting",
"position": {
"start": {
"line": 8,
"column": 12,
"offset": 133
},
"end": {
"line": 8,
"column": 21,
"offset": 142
}
}
},
"position": {
"start": {
"line": 8,
"column": 11,
"offset": 132
},
"end": {
"line": 8,
"column": 21,
"offset": 142
}
}
}
],
"modifiers": [],
"shorthand": "expression",
"position": {
"start": {
"line": 8,
"column": 11,
"offset": 132
},
"end": {
"line": 8,
"column": 21,
"offset": 142
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "Button",
"position": {
"start": {
"line": 8,
"column": 23,
"offset": 144
},
"end": {
"line": 8,
"column": 29,
"offset": 150
}
}
}
],
"position": {
"start": {
"line": 8,
"column": 3,
"offset": 124
},
"end": {
"line": 8,
"column": 38,
"offset": 159
}
}
},
{
"type": "text",
"value": "\n\n ",
"position": {
"start": {
"line": 8,
"column": 38,
"offset": 159
},
"end": {
"line": 10,
"column": 3,
"offset": 163
}
}
},
{
"type": "svelteComponent",
"tagName": "Button",
"properties": [
{
"type": "svelteProperty",
"name": "isSelected",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 11,
"column": 16,
"offset": 186
},
"end": {
"line": 11,
"column": 27,
"offset": 197
}
},
"expression": {
"type": "svelteExpression",
"value": "isWaiting",
"position": {
"start": {
"line": 11,
"column": 17,
"offset": 187
},
"end": {
"line": 11,
"column": 26,
"offset": 196
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 11,
"column": 5,
"offset": 175
},
"end": {
"line": 11,
"column": 27,
"offset": 197
}
}
},
{
"type": "svelteDirective",
"name": "on",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 12,
"column": 14,
"offset": 211
},
"end": {
"line": 12,
"column": 40,
"offset": 237
}
},
"expression": {
"type": "svelteExpression",
"value": "() => (isWaiting = true)",
"position": {
"start": {
"line": 12,
"column": 15,
"offset": 212
},
"end": {
"line": 12,
"column": 39,
"offset": 236
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 12,
"column": 5,
"offset": 202
},
"end": {
"line": 12,
"column": 40,
"offset": 237
}
},
"specifier": "click"
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n Start waiting\n ",
"position": {
"start": {
"line": 12,
"column": 41,
"offset": 238
},
"end": {
"line": 14,
"column": 3,
"offset": 259
}
}
}
],
"position": {
"start": {
"line": 10,
"column": 3,
"offset": 163
},
"end": {
"line": 14,
"column": 12,
"offset": 268
}
}
},
{
"type": "text",
"value": "\n\n ",
"position": {
"start": {
"line": 14,
"column": 12,
"offset": 268
},
"end": {
"line": 16,
"column": 3,
"offset": 272
}
}
},
{
"type": "svelteComponent",
"tagName": "Button",
"properties": [
{
"type": "svelteProperty",
"name": "isSelected",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 17,
"column": 16,
"offset": 295
},
"end": {
"line": 17,
"column": 28,
"offset": 307
}
},
"expression": {
"type": "svelteExpression",
"value": "!isWaiting",
"position": {
"start": {
"line": 17,
"column": 17,
"offset": 296
},
"end": {
"line": 17,
"column": 27,
"offset": 306
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 17,
"column": 5,
"offset": 284
},
"end": {
"line": 17,
"column": 28,
"offset": 307
}
}
},
{
"type": "svelteDirective",
"name": "on",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 18,
"column": 14,
"offset": 321
},
"end": {
"line": 18,
"column": 41,
"offset": 348
}
},
"expression": {
"type": "svelteExpression",
"value": "() => (isWaiting = false)",
"position": {
"start": {
"line": 18,
"column": 15,
"offset": 322
},
"end": {
"line": 18,
"column": 40,
"offset": 347
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 18,
"column": 5,
"offset": 312
},
"end": {
"line": 18,
"column": 41,
"offset": 348
}
},
"specifier": "click"
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n Stop waiting\n ",
"position": {
"start": {
"line": 18,
"column": 42,
"offset": 349
},
"end": {
"line": 20,
"column": 3,
"offset": 369
}
}
}
],
"position": {
"start": {
"line": 16,
"column": 3,
"offset": 272
},
"end": {
"line": 20,
"column": 12,
"offset": 378
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 20,
"column": 12,
"offset": 378
},
"end": {
"line": 21,
"column": 1,
"offset": 379
}
}
}
],
"position": {
"start": {
"line": 7,
"column": 1,
"offset": 104
},
"end": {
"line": 21,
"column": 7,
"offset": 385
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 21,
"column": 7,
"offset": 385
}
}
}