UNPKG

svelte-parse

Version:

An increidbly relaxed svelte-parser

419 lines (418 loc) 7.43 kB
{ "type": "root", "children": [ { "type": "svelteScript", "tagName": "script", "properties": [], "selfClosing": false, "children": [ { "type": "text", "value": "\n\timport { fly } from 'svelte/transition';\n\tlet visible = true;\n", "position": { "start": { "line": 1, "column": 9, "offset": 8 }, "end": { "line": 4, "column": 1, "offset": 72 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 10, "offset": 81 } } }, { "type": "text", "value": "\n\n", "position": { "start": { "line": 4, "column": 10, "offset": 81 }, "end": { "line": 6, "column": 1, "offset": 83 } } }, { "type": "svelteElement", "tagName": "label", "properties": [], "selfClosing": false, "children": [ { "type": "text", "value": "\n\t", "position": { "start": { "line": 6, "column": 8, "offset": 90 }, "end": { "line": 7, "column": 2, "offset": 92 } } }, { "type": "svelteElement", "tagName": "input", "properties": [ { "type": "svelteProperty", "name": "type", "value": [ { "type": "text", "value": "checkbox", "position": { "start": { "line": 7, "column": 15, "offset": 105 }, "end": { "line": 7, "column": 24, "offset": 114 } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 7, "column": 9, "offset": 99 }, "end": { "line": 7, "column": 24, "offset": 114 } } }, { "type": "svelteDirective", "name": "bind", "value": [ { "type": "svelteDynamicContent", "position": { "start": { "line": 7, "column": 38, "offset": 128 }, "end": { "line": 7, "column": 47, "offset": 137 } }, "expression": { "type": "svelteExpression", "value": "visible", "position": { "start": { "line": 7, "column": 39, "offset": 129 }, "end": { "line": 7, "column": 46, "offset": 136 } } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 7, "column": 25, "offset": 115 }, "end": { "line": 7, "column": 47, "offset": 137 } }, "specifier": "checked" } ], "selfClosing": true, "children": [], "position": { "start": { "line": 7, "column": 2, "offset": 92 }, "end": { "line": 7, "column": 48, "offset": 138 } } }, { "type": "text", "value": "\n\tvisible\n", "position": { "start": { "line": 7, "column": 48, "offset": 138 }, "end": { "line": 9, "column": 1, "offset": 148 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 83 }, "end": { "line": 9, "column": 9, "offset": 156 } } }, { "type": "text", "value": "\n\n", "position": { "start": { "line": 9, "column": 9, "offset": 156 }, "end": { "line": 11, "column": 1, "offset": 158 } } }, { "type": "svelteBranchingBlock", "name": "if", "branches": [ { "type": "svelteBranch", "name": "if", "expression": { "type": "svelteExpression", "value": "visible", "position": { "start": { "line": 11, "column": 6, "offset": 163 }, "end": { "line": 11, "column": 13, "offset": 170 } } }, "children": [ { "type": "text", "value": "\n\t", "position": { "start": { "line": 11, "column": 14, "offset": 171 }, "end": { "line": 12, "column": 2, "offset": 173 } } }, { "type": "svelteElement", "tagName": "p", "properties": [ { "type": "svelteDirective", "name": "transition", "value": [ { "type": "svelteDynamicContent", "position": { "start": { "line": 12, "column": 21, "offset": 192 }, "end": { "line": 12, "column": 49, "offset": 220 } }, "expression": { "type": "svelteExpression", "value": "{ y: 200, duration: 2000 }", "position": { "start": { "line": 12, "column": 22, "offset": 193 }, "end": { "line": 12, "column": 48, "offset": 219 } } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 12, "column": 5, "offset": 176 }, "end": { "line": 12, "column": 50, "offset": 221 } }, "specifier": "fly" } ], "selfClosing": false, "children": [ { "type": "text", "value": "\n\t\tFlies in and out\n\t", "position": { "start": { "line": 12, "column": 51, "offset": 222 }, "end": { "line": 14, "column": 2, "offset": 243 } } } ], "position": { "start": { "line": 12, "column": 2, "offset": 173 }, "end": { "line": 14, "column": 6, "offset": 247 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 14, "column": 6, "offset": 247 }, "end": { "line": 15, "column": 1, "offset": 248 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 158 }, "end": { "line": 15, "column": 1, "offset": 248 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 158 }, "end": { "line": 15, "column": 6, "offset": 253 } } } ], "position": { "start": { "column": 1, "line": 1, "offset": 0 }, "end": { "line": 15, "column": 6, "offset": 253 } } }