svelte-parse
Version:
An increidbly relaxed svelte-parser
649 lines (648 loc) • 12.3 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n import DatePicker from '@sveltekit/ui/DatePicker';\n\n let date;\n let toDate;\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 6,
"column": 1,
"offset": 89
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 6,
"column": 10,
"offset": 98
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 6,
"column": 10,
"offset": 98
},
"end": {
"line": 8,
"column": 1,
"offset": 100
}
}
},
{
"type": "svelteElement",
"tagName": "div",
"properties": [
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "text",
"value": "gridRow",
"position": {
"start": {
"line": 8,
"column": 13,
"offset": 112
},
"end": {
"line": 8,
"column": 21,
"offset": 120
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 8,
"column": 6,
"offset": 105
},
"end": {
"line": 8,
"column": 21,
"offset": 120
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 8,
"column": 22,
"offset": 121
},
"end": {
"line": 9,
"column": 3,
"offset": 124
}
}
},
{
"type": "svelteElement",
"tagName": "div",
"properties": [
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "text",
"value": "gridCol-4",
"position": {
"start": {
"line": 9,
"column": 15,
"offset": 136
},
"end": {
"line": 9,
"column": 25,
"offset": 146
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 9,
"column": 8,
"offset": 129
},
"end": {
"line": 9,
"column": 25,
"offset": 146
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 9,
"column": 26,
"offset": 147
},
"end": {
"line": 10,
"column": 5,
"offset": 152
}
}
},
{
"type": "svelteComponent",
"tagName": "DatePicker",
"properties": [
{
"type": "svelteProperty",
"name": "placeholder",
"value": [
{
"type": "text",
"value": "Please",
"position": {
"start": {
"line": 10,
"column": 30,
"offset": 177
},
"end": {}
}
},
{
"type": "text",
"value": " ",
"position": {
"start": {
"line": 10,
"column": 36,
"offset": 183
},
"end": {}
}
},
{
"type": "text",
"value": "click",
"position": {
"start": {
"line": 10,
"column": 37,
"offset": 184
},
"end": {}
}
},
{
"type": "text",
"value": " ",
"position": {
"start": {
"line": 10,
"column": 42,
"offset": 189
},
"end": {}
}
},
{
"type": "text",
"value": "to",
"position": {
"start": {
"line": 10,
"column": 43,
"offset": 190
},
"end": {}
}
},
{
"type": "text",
"value": " ",
"position": {
"start": {
"line": 10,
"column": 45,
"offset": 192
},
"end": {}
}
},
{
"type": "text",
"value": "select",
"position": {
"start": {
"line": 10,
"column": 46,
"offset": 193
},
"end": {}
}
},
{
"type": "text",
"value": " ",
"position": {
"start": {
"line": 10,
"column": 52,
"offset": 199
},
"end": {}
}
},
{
"type": "text",
"value": "a",
"position": {
"start": {
"line": 10,
"column": 53,
"offset": 200
},
"end": {}
}
},
{
"type": "text",
"value": " ",
"position": {
"start": {
"line": 10,
"column": 54,
"offset": 201
},
"end": {}
}
},
{
"type": "text",
"value": "date",
"position": {
"start": {
"line": 10,
"column": 55,
"offset": 202
},
"end": {
"line": 10,
"column": 60,
"offset": 207
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 10,
"column": 17,
"offset": 164
},
"end": {
"line": 10,
"column": 60,
"offset": 207
}
}
},
{
"type": "svelteDirective",
"name": "bind",
"value": [],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 10,
"column": 61,
"offset": 208
},
"end": {
"line": 10,
"column": 70,
"offset": 217
}
},
"specifier": "date"
},
{
"type": "svelteDirective",
"name": "bind",
"value": [],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 10,
"column": 71,
"offset": 218
},
"end": {
"line": 10,
"column": 82,
"offset": 229
}
},
"specifier": "toDate"
},
{
"type": "svelteProperty",
"name": "isRange",
"value": [],
"modifiers": [],
"shorthand": "boolean",
"position": {
"start": {
"line": 10,
"column": 83,
"offset": 230
},
"end": {
"line": 10,
"column": 90,
"offset": 237
}
}
}
],
"selfClosing": true,
"children": [],
"position": {
"start": {
"line": 10,
"column": 5,
"offset": 152
},
"end": {
"line": 10,
"column": 93,
"offset": 240
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 10,
"column": 93,
"offset": 240
},
"end": {
"line": 11,
"column": 5,
"offset": 245
}
}
},
{
"type": "svelteElement",
"tagName": "p",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "Date: ",
"position": {
"start": {
"line": 11,
"column": 8,
"offset": 248
},
"end": {
"line": 11,
"column": 14,
"offset": 254
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 11,
"column": 14,
"offset": 254
},
"end": {
"line": 11,
"column": 20,
"offset": 260
}
},
"expression": {
"type": "svelteExpression",
"value": "date",
"position": {
"start": {
"line": 11,
"column": 15,
"offset": 255
},
"end": {
"line": 11,
"column": 19,
"offset": 259
}
}
}
}
],
"position": {
"start": {
"line": 11,
"column": 5,
"offset": 245
},
"end": {
"line": 11,
"column": 24,
"offset": 264
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 11,
"column": 24,
"offset": 264
},
"end": {
"line": 12,
"column": 5,
"offset": 269
}
}
},
{
"type": "svelteElement",
"tagName": "p",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "toDate: ",
"position": {
"start": {
"line": 12,
"column": 8,
"offset": 272
},
"end": {
"line": 12,
"column": 16,
"offset": 280
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 12,
"column": 16,
"offset": 280
},
"end": {
"line": 12,
"column": 24,
"offset": 288
}
},
"expression": {
"type": "svelteExpression",
"value": "toDate",
"position": {
"start": {
"line": 12,
"column": 17,
"offset": 281
},
"end": {
"line": 12,
"column": 23,
"offset": 287
}
}
}
}
],
"position": {
"start": {
"line": 12,
"column": 5,
"offset": 269
},
"end": {
"line": 12,
"column": 28,
"offset": 292
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 12,
"column": 28,
"offset": 292
},
"end": {
"line": 13,
"column": 3,
"offset": 295
}
}
}
],
"position": {
"start": {
"line": 9,
"column": 3,
"offset": 124
},
"end": {
"line": 13,
"column": 9,
"offset": 301
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 13,
"column": 9,
"offset": 301
},
"end": {
"line": 14,
"column": 1,
"offset": 302
}
}
}
],
"position": {
"start": {
"line": 8,
"column": 1,
"offset": 100
},
"end": {
"line": 14,
"column": 7,
"offset": 308
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 14,
"column": 7,
"offset": 308
}
}
}