svelte-parse
Version:
An increidbly relaxed svelte-parser
512 lines (511 loc) • 10.6 kB
JSON
{
"type": "root",
"children": [
{
"type": "svelteScript",
"tagName": "script",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\tlet cats = [\n\t\t{ id: 'J---aiyznGQ', name: 'Keyboard Cat' },\n\t\t{ id: 'z_AbfPXTKms', name: 'Maru' },\n\t\t{ id: 'OUtn3pvWmpg', name: 'Henri The Existential Cat' }\n\t];\n",
"position": {
"start": {
"line": 1,
"column": 9,
"offset": 8
},
"end": {
"line": 7,
"column": 1,
"offset": 172
}
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 7,
"column": 10,
"offset": 181
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 7,
"column": 10,
"offset": 181
},
"end": {
"line": 9,
"column": 1,
"offset": 183
}
}
},
{
"type": "svelteElement",
"tagName": "h1",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "The Famous Cats of YouTube",
"position": {
"start": {
"line": 9,
"column": 5,
"offset": 187
},
"end": {
"line": 9,
"column": 31,
"offset": 213
}
}
}
],
"position": {
"start": {
"line": 9,
"column": 1,
"offset": 183
},
"end": {
"line": 9,
"column": 36,
"offset": 218
}
}
},
{
"type": "text",
"value": "\n\n",
"position": {
"start": {
"line": 9,
"column": 36,
"offset": 218
},
"end": {
"line": 11,
"column": 1,
"offset": 220
}
}
},
{
"type": "svelteElement",
"tagName": "ul",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\t",
"position": {
"start": {
"line": 11,
"column": 5,
"offset": 224
},
"end": {
"line": 12,
"column": 2,
"offset": 226
}
}
},
{
"type": "svelteBranchingBlock",
"name": "each",
"branches": [
{
"type": "svelteBranch",
"name": "each",
"expression": {
"type": "svelteExpression",
"value": "cats as { id, name }, i",
"position": {
"start": {
"line": 12,
"column": 9,
"offset": 233
},
"end": {
"line": 12,
"column": 32,
"offset": 256
}
}
},
"children": [
{
"type": "text",
"value": "\n\t\t",
"position": {
"start": {
"line": 12,
"column": 33,
"offset": 257
},
"end": {
"line": 13,
"column": 3,
"offset": 260
}
}
},
{
"type": "svelteElement",
"tagName": "li",
"properties": [],
"selfClosing": false,
"children": [
{
"type": "svelteElement",
"tagName": "a",
"properties": [
{
"type": "svelteProperty",
"name": "target",
"value": [
{
"type": "text",
"value": "_blank",
"position": {
"start": {
"line": 13,
"column": 18,
"offset": 275
},
"end": {
"line": 13,
"column": 25,
"offset": 282
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 13,
"column": 10,
"offset": 267
},
"end": {
"line": 13,
"column": 25,
"offset": 282
}
}
},
{
"type": "svelteProperty",
"name": "href",
"value": [
{
"type": "text",
"value": "https://www.youtube.com/watch?v=",
"position": {
"start": {
"line": 13,
"column": 32,
"offset": 289
},
"end": {
"line": 13,
"column": 64,
"offset": 321
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 13,
"column": 64,
"offset": 321
},
"end": {
"line": 13,
"column": 68,
"offset": 325
}
},
"expression": {
"type": "svelteExpression",
"value": "id",
"position": {
"start": {
"line": 13,
"column": 65,
"offset": 322
},
"end": {
"line": 13,
"column": 67,
"offset": 324
}
}
}
}
],
"modifiers": [],
"shorthand": "none",
"position": {
"start": {
"line": 13,
"column": 26,
"offset": 283
},
"end": {
"line": 13,
"column": 69,
"offset": 326
}
}
}
],
"selfClosing": false,
"children": [
{
"type": "text",
"value": "\n\t\t\t",
"position": {
"start": {
"line": 13,
"column": 70,
"offset": 327
},
"end": {
"line": 14,
"column": 4,
"offset": 331
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 14,
"column": 4,
"offset": 331
},
"end": {
"line": 14,
"column": 11,
"offset": 338
}
},
"expression": {
"type": "svelteExpression",
"value": "i + 1",
"position": {
"start": {
"line": 14,
"column": 5,
"offset": 332
},
"end": {
"line": 14,
"column": 10,
"offset": 337
}
}
}
},
{
"type": "text",
"value": ": ",
"position": {
"start": {
"line": 14,
"column": 11,
"offset": 338
},
"end": {
"line": 14,
"column": 13,
"offset": 340
}
}
},
{
"type": "svelteDynamicContent",
"position": {
"start": {
"line": 14,
"column": 13,
"offset": 340
},
"end": {
"line": 14,
"column": 19,
"offset": 346
}
},
"expression": {
"type": "svelteExpression",
"value": "name",
"position": {
"start": {
"line": 14,
"column": 14,
"offset": 341
},
"end": {
"line": 14,
"column": 18,
"offset": 345
}
}
}
},
{
"type": "text",
"value": "\n\t\t",
"position": {
"start": {
"line": 14,
"column": 19,
"offset": 346
},
"end": {
"line": 15,
"column": 3,
"offset": 349
}
}
}
],
"position": {
"start": {
"line": 13,
"column": 7,
"offset": 264
},
"end": {
"line": 15,
"column": 7,
"offset": 353
}
}
}
],
"position": {
"start": {
"line": 13,
"column": 3,
"offset": 260
},
"end": {
"line": 15,
"column": 12,
"offset": 358
}
}
},
{
"type": "text",
"value": "\n\t",
"position": {
"start": {
"line": 15,
"column": 12,
"offset": 358
},
"end": {
"line": 16,
"column": 2,
"offset": 360
}
}
}
],
"position": {
"start": {
"line": 12,
"column": 2,
"offset": 226
},
"end": {
"line": 16,
"column": 2,
"offset": 360
}
}
}
],
"position": {
"start": {
"line": 12,
"column": 2,
"offset": 226
},
"end": {
"line": 16,
"column": 9,
"offset": 367
}
}
},
{
"type": "text",
"value": "\n",
"position": {
"start": {
"line": 16,
"column": 9,
"offset": 367
},
"end": {
"line": 17,
"column": 1,
"offset": 368
}
}
}
],
"position": {
"start": {
"line": 11,
"column": 1,
"offset": 220
},
"end": {
"line": 17,
"column": 6,
"offset": 373
}
}
}
],
"position": {
"start": {
"column": 1,
"line": 1,
"offset": 0
},
"end": {
"line": 17,
"column": 6,
"offset": 373
}
}
}