svelte-parse
Version:
An increidbly relaxed svelte-parser
500 lines (499 loc) • 9.21 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 function handleRemove(event) {\n console.log('event :', event);\n }\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 7,
"column": 1,
"offset": 123
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 7,
"column": 10,
"offset": 132
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 7,
"column": 10,
"offset": 132
},
"end": {
"line": 9,
"column": 1,
"offset": 134
}
}
},
{
"type": "svelteElement",
"tagName": "div",
"properties": [
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "text",
"value": "row",
"position": {
"start": {
"line": 9,
"column": 13,
"offset": 146
},
"end": {
"line": 9,
"column": 17,
"offset": 150
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 9,
"column": 6,
"offset": 139
},
"end": {
"line": 9,
"column": 17,
"offset": 150
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 9,
"column": 18,
"offset": 151
},
"end": {
"line": 10,
"column": 3,
"offset": 154
}
}
},
{
"type": "svelteElement",
"tagName": "span",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 10,
"column": 9,
"offset": 160
},
"end": {
"line": 11,
"column": 5,
"offset": 165
}
}
},
{
"type": "svelteComponent",
"tagName": "Chip",
"properties": [
{
"type": "svelteProperty",
"name": "isRemovable",
"value": [],
"modifiers": [],
"shorthand": "boolean",
"position": {
"start": {
"line": 11,
"column": 11,
"offset": 171
},
"end": {
"line": 11,
"column": 22,
"offset": 182
}
}
},
{
"type": "svelteProperty",
"name": "isActive",
"value": [],
"modifiers": [],
"shorthand": "boolean",
"position": {
"start": {
"line": 11,
"column": 23,
"offset": 183
},
"end": {
"line": 11,
"column": 31,
"offset": 191
}
}
},
{
"type": "svelteDirective",
"name": "on",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 11,
"column": 43,
"offset": 203
},
"end": {
"line": 11,
"column": 57,
"offset": 217
}
},
"expression": {
"type": "svelteExpression",
"value": "handleRemove",
"position": {
"start": {
"line": 11,
"column": 44,
"offset": 204
},
"end": {
"line": 11,
"column": 56,
"offset": 216
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 11,
"column": 32,
"offset": 192
},
"end": {
"line": 11,
"column": 58,
"offset": 218
}
},
"specifier": "remove"
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "Removable Chip",
"position": {
"start": {
"line": 11,
"column": 59,
"offset": 219
},
"end": {
"line": 11,
"column": 73,
"offset": 233
}
}
}
],
"position": {
"start": {
"line": 11,
"column": 5,
"offset": 165
},
"end": {
"line": 11,
"column": 80,
"offset": 240
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 11,
"column": 80,
"offset": 240
},
"end": {
"line": 12,
"column": 3,
"offset": 243
}
}
}
],
"position": {
"start": {
"line": 10,
"column": 3,
"offset": 154
},
"end": {
"line": 12,
"column": 10,
"offset": 250
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 12,
"column": 10,
"offset": 250
},
"end": {
"line": 13,
"column": 3,
"offset": 253
}
}
},
{
"type": "svelteElement",
"tagName": "span",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 13,
"column": 9,
"offset": 259
},
"end": {
"line": 14,
"column": 5,
"offset": 264
}
}
},
{
"type": "svelteComponent",
"tagName": "Chip",
"properties": [
{
"type": "svelteProperty",
"name": "isRemovable",
"value": [],
"modifiers": [],
"shorthand": "boolean",
"position": {
"start": {
"line": 14,
"column": 11,
"offset": 270
},
"end": {
"line": 14,
"column": 22,
"offset": 281
}
}
},
{
"type": "svelteProperty",
"name": "isActive",
"value": [],
"modifiers": [],
"shorthand": "boolean",
"position": {
"start": {
"line": 14,
"column": 23,
"offset": 282
},
"end": {
"line": 14,
"column": 31,
"offset": 290
}
}
},
{
"type": "svelteProperty",
"name": "isDisabled",
"value": [],
"modifiers": [],
"shorthand": "boolean",
"position": {
"start": {
"line": 14,
"column": 32,
"offset": 291
},
"end": {
"line": 14,
"column": 42,
"offset": 301
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "Removable Chip",
"position": {
"start": {
"line": 14,
"column": 43,
"offset": 302
},
"end": {
"line": 14,
"column": 57,
"offset": 316
}
}
}
],
"position": {
"start": {
"line": 14,
"column": 5,
"offset": 264
},
"end": {
"line": 14,
"column": 64,
"offset": 323
}
}
},
{
"type": "text",
"value": "\n ",
"position": {
"start": {
"line": 14,
"column": 64,
"offset": 323
},
"end": {
"line": 15,
"column": 3,
"offset": 326
}
}
}
],
"position": {
"start": {
"line": 13,
"column": 3,
"offset": 253
},
"end": {
"line": 15,
"column": 10,
"offset": 333
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 15,
"column": 10,
"offset": 333
},
"end": {
"line": 16,
"column": 1,
"offset": 334
}
}
}
],
"position": {
"start": {
"line": 9,
"column": 1,
"offset": 134
},
"end": {
"line": 16,
"column": 7,
"offset": 340
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 16,
"column": 7,
"offset": 340
}
}
}