UNPKG

svelte-parse

Version:

An increidbly relaxed svelte-parser

387 lines (386 loc) 6.68 kB
{ "type": "root", "children": [ { "type": "svelteScript", "tagName": "script", "properties": [], "selfClosing": false, "children": [ { "type": "text", "value": "\n\timport { fade } from 'svelte/transition';\n\tlet visible = true;\n", "position": { "start": { "line": 1, "column": 9, "offset": 8 }, "end": { "line": 4, "column": 1, "offset": 73 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 10, "offset": 82 } } }, { "type": "text", "value": "\n\n", "position": { "start": { "line": 4, "column": 10, "offset": 82 }, "end": { "line": 6, "column": 1, "offset": 84 } } }, { "type": "svelteElement", "tagName": "label", "properties": [], "selfClosing": false, "children": [ { "type": "text", "value": "\n\t", "position": { "start": { "line": 6, "column": 8, "offset": 91 }, "end": { "line": 7, "column": 2, "offset": 93 } } }, { "type": "svelteElement", "tagName": "input", "properties": [ { "type": "svelteProperty", "name": "type", "value": [ { "type": "text", "value": "checkbox", "position": { "start": { "line": 7, "column": 15, "offset": 106 }, "end": { "line": 7, "column": 24, "offset": 115 } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 7, "column": 9, "offset": 100 }, "end": { "line": 7, "column": 24, "offset": 115 } } }, { "type": "svelteDirective", "name": "bind", "value": [ { "type": "svelteDynamicContent", "position": { "start": { "line": 7, "column": 38, "offset": 129 }, "end": { "line": 7, "column": 47, "offset": 138 } }, "expression": { "type": "svelteExpression", "value": "visible", "position": { "start": { "line": 7, "column": 39, "offset": 130 }, "end": { "line": 7, "column": 46, "offset": 137 } } } } ], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 7, "column": 25, "offset": 116 }, "end": { "line": 7, "column": 47, "offset": 138 } }, "specifier": "checked" } ], "selfClosing": true, "children": [], "position": { "start": { "line": 7, "column": 2, "offset": 93 }, "end": { "line": 7, "column": 48, "offset": 139 } } }, { "type": "text", "value": "\n\tvisible\n", "position": { "start": { "line": 7, "column": 48, "offset": 139 }, "end": { "line": 9, "column": 1, "offset": 149 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 84 }, "end": { "line": 9, "column": 9, "offset": 157 } } }, { "type": "text", "value": "\n\n", "position": { "start": { "line": 9, "column": 9, "offset": 157 }, "end": { "line": 11, "column": 1, "offset": 159 } } }, { "type": "svelteBranchingBlock", "name": "if", "branches": [ { "type": "svelteBranch", "name": "if", "expression": { "type": "svelteExpression", "value": "visible", "position": { "start": { "line": 11, "column": 6, "offset": 164 }, "end": { "line": 11, "column": 13, "offset": 171 } } }, "children": [ { "type": "text", "value": "\n\t", "position": { "start": { "line": 11, "column": 14, "offset": 172 }, "end": { "line": 12, "column": 2, "offset": 174 } } }, { "type": "svelteElement", "tagName": "p", "properties": [ { "type": "svelteDirective", "name": "transition", "value": [], "modifiers": [], "shorthand": "none", "position": { "start": { "line": 12, "column": 5, "offset": 177 }, "end": { "line": 12, "column": 20, "offset": 192 } }, "specifier": "fade" } ], "selfClosing": false, "children": [ { "type": "text", "value": "\n\t\tFades in and out\n\t", "position": { "start": { "line": 12, "column": 21, "offset": 193 }, "end": { "line": 14, "column": 2, "offset": 214 } } } ], "position": { "start": { "line": 12, "column": 2, "offset": 174 }, "end": { "line": 14, "column": 6, "offset": 218 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 14, "column": 6, "offset": 218 }, "end": { "line": 15, "column": 1, "offset": 219 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 159 }, "end": { "line": 15, "column": 1, "offset": 219 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 159 }, "end": { "line": 15, "column": 6, "offset": 224 } } } ], "position": { "start": { "column": 1, "line": 1, "offset": 0 }, "end": { "line": 15, "column": 6, "offset": 224 } } }