svelte-parse
Version:
An increidbly relaxed svelte-parser
353 lines (352 loc) • 6.37 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteElement",
"tagName": "i",
"properties": [
{
"type": "svelteDirective",
"name": "use",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 2,
"column": 17,
"offset": 19
},
"end": {
"line": 2,
"column": 22,
"offset": 24
}
},
"expression": {
"type": "svelteExpression",
"value": "use",
"position": {
"start": {
"line": 2,
"column": 18,
"offset": 20
},
"end": {
"line": 2,
"column": 21,
"offset": 23
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 2,
"column": 5,
"offset": 7
},
"end": {
"line": 2,
"column": 22,
"offset": 24
}
},
"specifier": "actions"
},
{
"type": "svelteDirective",
"name": "use",
"value": [],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 3,
"column": 5,
"offset": 29
},
"end": {
"line": 3,
"column": 15,
"offset": 39
}
},
"specifier": "events"
},
{
"type": "svelteProperty",
"name": "class",
"value": [
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 4,
"column": 12,
"offset": 51
},
"end": {
"line": 10,
"column": 7,
"offset": 142
}
},
"expression": {
"type": "svelteExpression",
"value": "clsxd(\n code,\n name,\n alias,\n className,\n 'flag'\n )",
"position": {
"start": {
"line": 4,
"column": 13,
"offset": 52
},
"end": {
"line": 10,
"column": 6,
"offset": 141
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 4,
"column": 5,
"offset": 44
},
"end": {
"line": 10,
"column": 8,
"offset": 143
}
}
},
{
"type": "svelteProperty",
"name": "...exclude($$props, ['use', 'class', 'code', 'name', 'alias'])",
"value": [
{
"type": "svelteDynamicContent",
"expression": {
"type": "svelteExpression",
"value": "...exclude($$props, ['use', 'class', 'code', 'name', 'alias'])",
"position": {
"start": {
"line": 11,
"column": 6,
"offset": 149
},
"end": {
"line": 11,
"column": 68,
"offset": 211
}
}
},
"position": {
"start": {
"line": 11,
"column": 5,
"offset": 148
},
"end": {
"line": 11,
"column": 68,
"offset": 211
}
}
}
],
"modifiers": [],
"shorthand": "expression",
"position": {
"start": {
"line": 11,
"column": 5,
"offset": 148
},
"end": {
"line": 11,
"column": 68,
"offset": 211
}
}
}
],
"selfClosing": false,
"children": [],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 12,
"column": 6,
"offset": 218
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 12,
"column": 6,
"offset": 218
},
"end": {
"line": 14,
"column": 1,
"offset": 220
}
}
},
{
"type": "svelteScript",
"tagName": "script",
"properties": [
{
"type": "svelteProperty",
"name": "context",
"value": [
{
"type": "text",
"value": "module",
"position": {
"start": {
"line": 14,
"column": 18,
"offset": 237
},
"end": {
"line": 14,
"column": 25,
"offset": 244
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 14,
"column": 9,
"offset": 228
},
"end": {
"line": 14,
"column": 25,
"offset": 244
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n import { exclude, eventsBuilder, actions, clsxd } from '../../lib'\n import { current_component } from 'svelte/internal'\n",
"position": {
"start": {
"line": 14,
"column": 26,
"offset": 245
},
"end": {
"line": 17,
"column": 1,
"offset": 373
}
}
}
],
"position": {
"start": {
"line": 14,
"column": 1,
"offset": 220
},
"end": {
"line": 17,
"column": 10,
"offset": 382
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 17,
"column": 10,
"offset": 382
},
"end": {
"line": 19,
"column": 1,
"offset": 384
}
}
},
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n const events = eventsBuilder(current_component)\n\n export let use = [];\n let className = '';\n export { className as class };\n\n export let code = '';\n export let name = '';\n export let alias = '';\n",
"position": {
"start": {
"line": 19,
"column": 9,
"offset": 392
},
"end": {
"line": 29,
"column": 1,
"offset": 610
}
}
}
],
"position": {
"start": {
"line": 19,
"column": 1,
"offset": 384
},
"end": {
"line": 29,
"column": 10,
"offset": 619
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 29,
"column": 10,
"offset": 619
}
}
}