diff --git a/docs/AST.md b/docs/AST.md index 9437463c..ace3390d 100644 --- a/docs/AST.md +++ b/docs/AST.md @@ -210,7 +210,19 @@ interface SvelteAttribute extends Node { type: "SvelteAttribute"; key: SvelteName; boolean: boolean; - value: (SvelteLiteral | SvelteMustacheTagText)[]; + value: SvelteLiteral | SvelteMustacheTagText | SvelteAttributeTemplateValue | null; +} +``` + +### SvelteAttributeTemplateValue + +If the value of the attribute becomes a template, this node is set to the `value`. + +```ts +interface SvelteAttributeTemplateValue extends Node { + type: "SvelteAttributeTemplateValue"; + values: (SvelteLiteral | SvelteMustacheTagText)[]; + parent: SvelteAttribute | SvelteStyleDirective; } ``` @@ -321,7 +333,7 @@ interface SvelteStyleDirective extends Node { type: "SvelteStyleDirective"; key: SvelteDirectiveKey; shorthand: boolean; - value: (SvelteLiteral | SvelteMustacheTagText)[]; + value: SvelteLiteral | SvelteMustacheTagText | SvelteAttributeTemplateValue | null; } ``` diff --git a/src/ast/html.ts b/src/ast/html.ts index 106a1e83..65071812 100644 --- a/src/ast/html.ts +++ b/src/ast/html.ts @@ -25,6 +25,7 @@ export type SvelteHTMLNode = | SvelteAwaitCatchBlock | SvelteKeyBlock | SvelteAttribute + | SvelteAttributeTemplateValue | SvelteShorthandAttribute | SvelteSpreadAttribute | SvelteDirective @@ -200,7 +201,7 @@ export interface SvelteText extends BaseNode { export interface SvelteLiteral extends BaseNode { type: "SvelteLiteral"; value: string; - parent: SvelteAttribute | SvelteStyleDirective; + parent: SvelteAttribute | SvelteStyleDirective | SvelteAttributeTemplateValue; } /** Node of mustache tag. e.g. `{...}`, `{@html ...}`. Like JSXExpressionContainer */ @@ -220,6 +221,7 @@ interface BaseSvelteMustacheTag extends BaseNode { | SvelteAwaitCatchBlock | SvelteKeyBlock | SvelteAttribute + | SvelteAttributeTemplateValue | SvelteStyleDirective; } /** Node of mustache tag. e.g. `{...}``. Like JSXExpressionContainer */ @@ -460,13 +462,31 @@ export interface SvelteHTMLComment extends BaseNode { | SvelteKeyBlock; } /** Node of HTML attribute. */ -export interface SvelteAttribute extends BaseNode { +export type SvelteAttribute = SvelteAttributeBoolean | SvelteAttributeWithValue; +interface BaseSvelteAttribute extends BaseNode { type: "SvelteAttribute"; key: SvelteName; boolean: boolean; - value: (SvelteLiteral | SvelteMustacheTagText)[]; + value: + | SvelteLiteral + | SvelteMustacheTagText + | SvelteAttributeTemplateValue + | null; parent: SvelteStartTag; } +export interface SvelteAttributeBoolean extends BaseSvelteAttribute { + boolean: true; + value: null; +} +export interface SvelteAttributeWithValue extends BaseSvelteAttribute { + boolean: false; + value: SvelteLiteral | SvelteMustacheTagText | SvelteAttributeTemplateValue; +} +export interface SvelteAttributeTemplateValue extends BaseNode { + type: "SvelteAttributeTemplateValue"; + values: (SvelteLiteral | SvelteMustacheTagText)[]; + parent: SvelteAttributeWithValue | SvelteStyleDirectiveLongform; +} /** Node of shorthand attribute. e.g. `` */ export interface SvelteShorthandAttribute extends BaseNode { type: "SvelteShorthandAttribute"; @@ -574,19 +594,23 @@ export type SvelteStyleDirective = interface BaseSvelteStyleDirective extends BaseNode { type: "SvelteStyleDirective"; key: SvelteDirectiveKeyTextName | SvelteDirectiveKeyForStyleShorthand; - value: (SvelteLiteral | SvelteMustacheTagText)[]; + value: + | SvelteLiteral + | SvelteMustacheTagText + | SvelteAttributeTemplateValue + | null; parent: SvelteStartTag; } export interface SvelteStyleDirectiveShorthand extends BaseSvelteStyleDirective { key: SvelteDirectiveKeyForStyleShorthand; shorthand: true; - value: []; + value: null; } export interface SvelteStyleDirectiveLongform extends BaseSvelteStyleDirective { key: SvelteDirectiveKeyTextName; shorthand: false; - value: (SvelteLiteral | SvelteMustacheTagText)[]; + value: SvelteLiteral | SvelteMustacheTagText | SvelteAttributeTemplateValue; } export interface SvelteSpecialDirectiveKey extends BaseNode { type: "SvelteSpecialDirectiveKey"; diff --git a/src/parser/converts/attr.ts b/src/parser/converts/attr.ts index 19d16af1..f54615ad 100644 --- a/src/parser/converts/attr.ts +++ b/src/parser/converts/attr.ts @@ -20,6 +20,9 @@ import type { SvelteStyleElement, SvelteElseBlock, SvelteAwaitBlock, + SvelteLiteral, + SvelteMustacheTagText, + SvelteAttributeWithValue, } from "../../ast"; import type ESTree from "estree"; import type { Context } from "../../context"; @@ -114,9 +117,9 @@ export function* convertAttributeTokens( for (const attr of attributes) { const attribute: SvelteAttribute = { type: "SvelteAttribute", - boolean: false, + boolean: false as boolean, key: null as any, - value: [], + value: null as any, parent, ...ctx.getConvertLocation({ start: attr.key.start, @@ -133,8 +136,10 @@ export function* convertAttributeTokens( if (attr.value == null) { attribute.boolean = true; } else { - attribute.value.push( - convertAttributeValueTokenToLiteral(attr.value, attribute, ctx), + attribute.value = convertAttributeValueTokenToLiteral( + attr.value, + attribute, + ctx, ); } yield attribute; @@ -149,9 +154,9 @@ function convertAttribute( ): SvelteAttribute | SvelteShorthandAttribute { const attribute: SvelteAttribute = { type: "SvelteAttribute", - boolean: false, + boolean: false as boolean, key: null as any, - value: [], + value: null as any, parent, ...ctx.getConvertLocation(node), }; @@ -215,6 +220,7 @@ function processAttributeValue( attribute: SvelteAttribute | SvelteStyleDirectiveLongform, ctx: Context, ) { + const values: (SvelteLiteral | SvelteMustacheTagText)[] = []; for (let index = 0; index < nodeValue.length; index++) { const v = nodeValue[index]; if (v.type === "Text") { @@ -229,12 +235,12 @@ function processAttributeValue( // console.log(ctx.getText(v), v.data) v.end = next.start; } - attribute.value.push(convertTextToLiteral(v, attribute, ctx)); + values.push(convertTextToLiteral(v, attribute, ctx)); continue; } if (v.type === "MustacheTag") { const mustache = convertMustacheTag(v, attribute, ctx); - attribute.value.push(mustache); + values.push(mustache); continue; } const u: any = v; @@ -244,6 +250,29 @@ function processAttributeValue( ctx, ); } + if (values.length === 1) { + attribute.value = values[0]; + } else if (values.length === 0) { + attribute.value = null; + } else { + const first = values[0]; + const last = values[values.length - 1]; + attribute.value = { + type: "SvelteAttributeTemplateValue", + values, + parent: attribute as + | SvelteAttributeWithValue + | SvelteStyleDirectiveLongform, + loc: { + start: { ...first.loc.start }, + end: { ...last.loc.end }, + }, + range: [first.range[0], last.range[1]], + }; + for (const value of values) { + value.parent = attribute.value; + } + } } /** Convert for Spread */ @@ -458,7 +487,7 @@ function convertStyleDirective( type: "SvelteStyleDirective", key: null as any, shorthand: false, - value: [], + value: null as any, parent, ...ctx.getConvertLocation(node), }; diff --git a/src/parser/converts/element.ts b/src/parser/converts/element.ts index 2c44cbef..eb4a5227 100644 --- a/src/parser/converts/element.ts +++ b/src/parser/converts/element.ts @@ -476,7 +476,7 @@ function processThisAttribute( type: "SvelteAttribute", key: null as any, boolean: false, - value: [], + value: null as any, parent: element.startTag, ...ctx.getConvertLocation({ start: startIndex, end: endIndex }), }; @@ -486,7 +486,7 @@ function processThisAttribute( parent: thisAttr, ...ctx.getConvertLocation({ start: startIndex, end: eqIndex }), }; - thisAttr.value.push({ + thisAttr.value = { type: "SvelteLiteral", value: thisValue, parent: thisAttr, @@ -494,7 +494,7 @@ function processThisAttribute( start: literalStartIndex, end: literalEndIndex, }), - }); + }; // this ctx.addToken("HTMLIdentifier", { start: startIndex, diff --git a/src/parser/index.ts b/src/parser/index.ts index 8fc7df35..2135a4c7 100644 --- a/src/parser/index.ts +++ b/src/parser/index.ts @@ -166,9 +166,9 @@ function parseAsSvelte( (attr) => attr.type === "SvelteAttribute" && attr.key.name === "context" && - attr.value.length === 1 && - attr.value[0].type === "SvelteLiteral" && - attr.value[0].value === "module", + attr.value && + attr.value.type === "SvelteLiteral" && + attr.value.value === "module", ) ) { analyzePropsScope(body, resultScript.scopeManager!); diff --git a/src/parser/style-context.ts b/src/parser/style-context.ts index 3d5daa91..ae9d94cb 100644 --- a/src/parser/style-context.ts +++ b/src/parser/style-context.ts @@ -47,10 +47,10 @@ export function parseStyleContext( if ( attribute.type === "SvelteAttribute" && attribute.key.name === "lang" && - attribute.value.length > 0 && - attribute.value[0].type === "SvelteLiteral" + attribute.value && + attribute.value.type === "SvelteLiteral" ) { - sourceLang = attribute.value[0].value; + sourceLang = attribute.value.value; } } let parseFn: Parser, sourceAst: Root; diff --git a/src/parser/typescript/analyze/index.ts b/src/parser/typescript/analyze/index.ts index d46d0575..b12bd63e 100644 --- a/src/parser/typescript/analyze/index.ts +++ b/src/parser/typescript/analyze/index.ts @@ -204,33 +204,7 @@ function analyzeDollarDollarVariables( case "$$slots": { const nameTypes = new Set(); for (const slot of slots) { - const nameAttr = slot.startTag.attributes.find( - (attr): attr is SvelteAttribute => - attr.type === "SvelteAttribute" && attr.key.name === "name", - ); - if (!nameAttr || nameAttr.value.length === 0) { - nameTypes.add('"default"'); - continue; - } - - if (nameAttr.value.length === 1) { - const value = nameAttr.value[0]; - if (value.type === "SvelteLiteral") { - nameTypes.add(JSON.stringify(value.value)); - } else { - nameTypes.add("string"); - } - continue; - } - nameTypes.add( - `\`${nameAttr.value - .map((value) => - value.type === "SvelteLiteral" - ? value.value.replace(/([$`])/gu, "\\$1") - : "${string}", - ) - .join("")}\``, - ); + nameTypes.add(extractSlotTypes(slot)); } appendDeclareVirtualScript( @@ -254,6 +228,34 @@ function analyzeDollarDollarVariables( } } + /** Extract slot name type from given the slot element */ + function extractSlotTypes(slot: SvelteHTMLElement) { + const nameAttr = slot.startTag.attributes.find( + (attr): attr is SvelteAttribute => + attr.type === "SvelteAttribute" && attr.key.name === "name", + ); + if (!nameAttr || nameAttr.boolean || nameAttr.value == null) { + return '"default"'; + } + + if (nameAttr.value.type === "SvelteLiteral") { + return JSON.stringify(nameAttr.value.value); + } + if (nameAttr.value.type === "SvelteMustacheTag") { + return "string"; + } + if (nameAttr.value.type === "SvelteAttributeTemplateValue") { + return `\`${nameAttr.value.values + .map((value) => + value.type === "SvelteLiteral" + ? value.value.replace(/([$`])/gu, "\\$1") + : "${string}", + ) + .join("")}\``; + } + throw Error(`Unknown attr value type: ${(nameAttr.value as any).type}`); + } + /** Append declare virtual script */ function appendDeclareVirtualScript(name: string, type: string) { ctx.appendVirtualScript(`declare let ${name}: ${type};`); diff --git a/src/visitor-keys.ts b/src/visitor-keys.ts index d9a02cef..0ed97f13 100644 --- a/src/visitor-keys.ts +++ b/src/visitor-keys.ts @@ -38,6 +38,7 @@ const svelteKeys: SvelteKeysType = { SvelteAwaitCatchBlock: ["error", "children"], SvelteKeyBlock: ["expression", "children"], SvelteAttribute: ["key", "value"], + SvelteAttributeTemplateValue: ["values"], SvelteShorthandAttribute: ["key", "value"], SvelteSpreadAttribute: ["argument"], SvelteDirective: ["key", "expression"], diff --git a/tests/fixtures/parser/ast/attr01-output.json b/tests/fixtures/parser/ast/attr01-output.json index 163b8cc3..07048fa4 100644 --- a/tests/fixtures/parser/ast/attr01-output.json +++ b/tests/fixtures/parser/ast/attr01-output.json @@ -359,152 +359,169 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "a", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "a", + "range": [ + 77, + 78 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 15 + } + } + }, "range": [ - 77, - 78 + 76, + 79 ], "loc": { "start": { "line": 7, - "column": 14 + "column": 13 }, "end": { "line": 7, - "column": 15 + "column": 16 } } }, - "range": [ - 76, - 79 - ], - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 16 - } - } - }, - { - "type": "SvelteLiteral", - "value": " ", - "range": [ - 79, - 80 - ], - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 17 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "b", + { + "type": "SvelteLiteral", + "value": " ", "range": [ - 81, - 82 + 79, + 80 ], "loc": { "start": { "line": 7, - "column": 18 + "column": 16 }, "end": { "line": 7, - "column": 19 + "column": 17 } } }, - "range": [ - 80, - 83 - ], - "loc": { - "start": { - "line": 7, - "column": 17 - }, - "end": { - "line": 7, - "column": 20 - } - } - }, - { - "type": "SvelteLiteral", - "value": " ", - "range": [ - 83, - 84 - ], - "loc": { - "start": { - "line": 7, - "column": 20 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "b", + "range": [ + 81, + 82 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 19 + } + } }, - "end": { - "line": 7, - "column": 21 + "range": [ + 80, + 83 + ], + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 20 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "c", + }, + { + "type": "SvelteLiteral", + "value": " ", "range": [ - 85, - 86 + 83, + 84 ], "loc": { "start": { "line": 7, - "column": 22 + "column": 20 }, "end": { "line": 7, - "column": 23 + "column": 21 } } }, - "range": [ - 84, - 87 - ], - "loc": { - "start": { - "line": 7, - "column": 21 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "c", + "range": [ + 85, + 86 + ], + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 23 + } + } }, - "end": { - "line": 7, - "column": 24 + "range": [ + 84, + 87 + ], + "loc": { + "start": { + "line": 7, + "column": 21 + }, + "end": { + "line": 7, + "column": 24 + } } } + ], + "range": [ + 76, + 87 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 24 + } } - ], + }, "range": [ 65, 88 diff --git a/tests/fixtures/parser/ast/await04-output.json b/tests/fixtures/parser/ast/await04-output.json index 35c3ec69..5459e148 100644 --- a/tests/fixtures/parser/ast/await04-output.json +++ b/tests/fixtures/parser/ast/await04-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/blog/write-less-code01-output.json b/tests/fixtures/parser/ast/blog/write-less-code01-output.json index 572b80f0..d13ea71e 100644 --- a/tests/fixtures/parser/ast/blog/write-less-code01-output.json +++ b/tests/fixtures/parser/ast/blog/write-less-code01-output.json @@ -285,26 +285,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 57, - 63 - ], - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 57, + 63 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 19 } } - ], + }, "range": [ 51, 64 @@ -490,26 +488,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 94, - 100 - ], - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 94, + 100 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 19 } } - ], + }, "range": [ 88, 101 diff --git a/tests/fixtures/parser/ast/comments01-output.json b/tests/fixtures/parser/ast/comments01-output.json index 0314cf87..2fc3172b 100644 --- a/tests/fixtures/parser/ast/comments01-output.json +++ b/tests/fixtures/parser/ast/comments01-output.json @@ -46,118 +46,135 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "'comment'", - "value": "comment", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "'comment'", + "value": "comment", + "range": [ + 33, + 42 + ], + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 37 + } + } + }, "range": [ - 33, - 42 + 18, + 43 ], "loc": { "start": { "line": 2, - "column": 28 + "column": 13 }, "end": { "line": 2, - "column": 37 + "column": 38 } } }, - "range": [ - 18, - 43 - ], - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 38 + { + "type": "SvelteLiteral", + "value": " ", + "range": [ + 43, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + } } - } - }, - { - "type": "SvelteLiteral", - "value": " ", - "range": [ - 43, - 44 - ], - "loc": { - "start": { - "line": 2, - "column": 38 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "'comment'", + "value": "comment", + "range": [ + 58, + 67 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + } }, - "end": { - "line": 2, - "column": 39 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "'comment'", - "value": "comment", "range": [ - 58, - 67 + 44, + 68 ], "loc": { "start": { - "line": 3, - "column": 2 + "line": 2, + "column": 39 }, "end": { "line": 3, - "column": 11 + "column": 12 } } }, - "range": [ - 44, - 68 - ], - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 3, - "column": 12 + { + "type": "SvelteLiteral", + "value": " ", + "range": [ + 68, + 69 + ], + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } } } - }, - { - "type": "SvelteLiteral", - "value": " ", - "range": [ - 68, - 69 - ], - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } + ], + "range": [ + 18, + 69 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 3, + "column": 13 } } - ], + }, "range": [ 7, 70 diff --git a/tests/fixtures/parser/ast/docs/component-format/02-script-context-module/01-output.json b/tests/fixtures/parser/ast/docs/component-format/02-script-context-module/01-output.json index 9e6bcaf9..e627d55b 100644 --- a/tests/fixtures/parser/ast/docs/component-format/02-script-context-module/01-output.json +++ b/tests/fixtures/parser/ast/docs/component-format/02-script-context-module/01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "module", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "module", + "range": [ + 17, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 } } - ], + }, "range": [ 8, 24 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/01-output.json index aa1b05a2..46e8e0fb 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/01-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 12, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 12, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 } } - ], + }, "range": [ 5, 16 @@ -162,7 +160,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 27, 35 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/02-output.json index 20311728..a675e512 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/02-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 12, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 12, + 20 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 } } - ], + }, "range": [ 7, 20 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/03-output.json index 5416010c..bf0617b7 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/03-output.json @@ -46,62 +46,79 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "page/", - "range": [ - 9, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "p", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "page/", "range": [ - 15, - 16 + 9, + 14 ], "loc": { "start": { "line": 1, - "column": 15 + "column": 9 }, "end": { "line": 1, - "column": 16 + "column": 14 } } }, - "range": [ - 14, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 14 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "p", + "range": [ + 15, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + } }, - "end": { - "line": 1, - "column": 17 + "range": [ + 14, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } } } + ], + "range": [ + 9, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } } - ], + }, "range": [ 3, 18 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/04-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/04-output.json index 1c9f8a2a..34e608d9 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/04-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/04-output.json @@ -46,40 +46,22 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Identifier", - "name": "clickable", - "range": [ - 19, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "operator": "!", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Identifier", + "name": "clickable", "range": [ - 18, + 19, 28 ], "loc": { "start": { "line": 1, - "column": 18 + "column": 19 }, "end": { "line": 1, @@ -87,22 +69,38 @@ } } }, + "operator": "!", + "prefix": true, "range": [ - 17, - 29 + 18, + 28 ], "loc": { "start": { "line": 1, - "column": 17 + "column": 18 }, "end": { "line": 1, - "column": 29 + "column": 28 } } + }, + "range": [ + 17, + 29 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } } - ], + }, "range": [ 8, 29 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/05-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/05-output.json index 12a18abe..210c3ca3 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/05-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/05-output.json @@ -46,45 +46,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "false", - "value": false, - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "false", + "value": false, "range": [ - 16, - 23 + 17, + 22 ], "loc": { "start": { "line": 1, - "column": 16 + "column": 17 }, "end": { "line": 1, - "column": 23 + "column": 22 } } + }, + "range": [ + 16, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } } - ], + }, "range": [ 7, 23 @@ -121,26 +119,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "This input field is not required", - "range": [ - 37, - 69 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 69 - } + "value": { + "type": "SvelteLiteral", + "value": "This input field is not required", + "range": [ + 37, + 69 + ], + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 69 } } - ], + }, "range": [ 24, 70 @@ -253,45 +249,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "null", - "value": null, - "range": [ - 84, - 88 - ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "null", + "value": null, "range": [ - 83, - 89 + 84, + 88 ], "loc": { "start": { "line": 2, - "column": 11 + "column": 12 }, "end": { "line": 2, - "column": 17 + "column": 16 } } + }, + "range": [ + 83, + 89 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 17 + } } - ], + }, "range": [ 77, 89 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/06-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/06-output.json index b1314bea..5bfc4df8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/06-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/06-output.json @@ -46,59 +46,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "number", - "range": [ - 19, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "operator": "!==", - "right": { - "type": "Literal", - "raw": "42", - "value": 42, - "range": [ - 30, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "BinaryExpression", + "left": { + "type": "Identifier", + "name": "number", "range": [ 19, - 32 + 25 ], "loc": { "start": { "line": 1, "column": 19 }, + "end": { + "line": 1, + "column": 25 + } + } + }, + "operator": "!==", + "right": { + "type": "Literal", + "raw": "42", + "value": 42, + "range": [ + 30, + 32 + ], + "loc": { + "start": { + "line": 1, + "column": 30 + }, "end": { "line": 1, "column": 32 @@ -106,21 +90,35 @@ } }, "range": [ - 18, - 33 + 19, + 32 ], "loc": { "start": { "line": 1, - "column": 18 + "column": 19 }, "end": { "line": 1, - "column": 33 + "column": 32 } } + }, + "range": [ + 18, + 33 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 33 + } } - ], + }, "range": [ 8, 34 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/07-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/07-output.json index 9d0ac86b..272667f1 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/07-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/07-output.json @@ -82,44 +82,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "disabled", - "range": [ - 48, - 56 - ], - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 26 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "disabled", "range": [ - 47, - 57 + 48, + 56 ], "loc": { "start": { "line": 2, - "column": 17 + "column": 18 }, "end": { "line": 2, - "column": 27 + "column": 26 } } + }, + "range": [ + 47, + 57 + ], + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 27 + } } - ], + }, "range": [ 38, 57 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/08-output.json b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/08-output.json index 4b73d60a..752069dc 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/08-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/02-attributes-and-props/08-output.json @@ -46,44 +46,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "bar", - "range": [ - 13, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "bar", "range": [ - 12, - 17 + 13, + 16 ], "loc": { "start": { "line": 1, - "column": 12 + "column": 13 }, "end": { "line": 1, - "column": 17 + "column": 16 } } + }, + "range": [ + 12, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } } - ], + }, "range": [ 8, 17 @@ -120,45 +118,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "42", - "value": 42, - "range": [ - 26, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "42", + "value": 42, "range": [ - 25, - 29 + 26, + 28 ], "loc": { "start": { "line": 1, - "column": 25 + "column": 26 }, "end": { "line": 1, - "column": 29 + "column": 28 } } + }, + "range": [ + 25, + 29 + ], + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } } - ], + }, "range": [ 18, 29 @@ -195,26 +191,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "hello", - "range": [ - 36, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 41 - } + "value": { + "type": "SvelteLiteral", + "value": "hello", + "range": [ + 36, + 41 + ], + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 41 } } - ], + }, "range": [ 30, 42 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/04-comments/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/04-comments/02-output.json index 4b6655d2..41ea51a8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/04-comments/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/04-comments/02-output.json @@ -155,7 +155,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 63, 72 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-output.json b/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-output.json index 16e88ee9..8f40a2bd 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-output.json @@ -1275,44 +1275,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "rest", - "range": [ - 256, - 260 - ], - "loc": { - "start": { - "line": 10, - "column": 43 - }, - "end": { - "line": 10, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "rest", "range": [ - 255, - 261 + 256, + 260 ], "loc": { "start": { "line": 10, - "column": 42 + "column": 43 }, "end": { "line": 10, - "column": 48 + "column": 47 } } + }, + "range": [ + 255, + 261 + ], + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 48 + } } - ], + }, "range": [ 248, 261 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-scope-output.json index fc368aa3..7038e629 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-scope-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/06-hash-each/05-scope-output.json @@ -4199,44 +4199,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "rest", - "range": [ - 256, - 260 - ], - "loc": { - "start": { - "line": 10, - "column": 43 - }, - "end": { - "line": 10, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "rest", "range": [ - 255, - 261 + 256, + 260 ], "loc": { "start": { "line": 10, - "column": 42 + "column": 43 }, "end": { "line": 10, - "column": 48 + "column": 47 } } + }, + "range": [ + 255, + 261 + ], + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 48 + } } - ], + }, "range": [ 248, 261 @@ -4715,44 +4713,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "rest", - "range": [ - 256, - 260 - ], - "loc": { - "start": { - "line": 10, - "column": 43 - }, - "end": { - "line": 10, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "rest", "range": [ - 255, - 261 + 256, + 260 ], "loc": { "start": { "line": 10, - "column": 42 + "column": 43 }, "end": { "line": 10, - "column": 48 + "column": 47 } } + }, + "range": [ + 255, + 261 + ], + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 48 + } } - ], + }, "range": [ 248, 261 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/09-at-html/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/09-at-html/02-output.json index 6e9d8b5e..36566f89 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/09-at-html/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/09-at-html/02-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "blog-post", - "range": [ - 12, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "blog-post", + "range": [ + 12, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 } } - ], + }, "range": [ 5, 22 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/02-output.json index 6c536387..f77569e8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/02-output.json @@ -360,26 +360,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 80, - 88 - ], - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 80, + 88 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 } } - ], + }, "range": [ 74, 89 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/04-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/04-output.json index 6eb4475b..fc231600 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/04-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/04-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 13, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 13, + 19 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 } } - ], + }, "range": [ 7, 20 @@ -251,26 +249,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 52, - 57 - ], - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 52, + 57 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 } } - ], + }, "range": [ 46, 58 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/05-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/05-output.json index 7deddfdd..229065a8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/05-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/05-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "avatar", - "range": [ - 12, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "avatar", + "range": [ + 12, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 } } - ], + }, "range": [ 7, 19 @@ -213,26 +211,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "image/png, image/jpeg", - "range": [ - 62, - 83 - ], - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "image/png, image/jpeg", + "range": [ + 62, + 83 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 30 } } - ], + }, "range": [ 54, 84 @@ -342,26 +338,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "avatar", - "range": [ - 102, - 108 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 11 - } + "value": { + "type": "SvelteLiteral", + "value": "avatar", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 11 } } - ], + }, "range": [ 98, 109 @@ -398,26 +392,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "avatar", - "range": [ - 117, - 123 - ], - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 13 - } + "value": { + "type": "SvelteLiteral", + "value": "avatar", + "range": [ + 117, + 123 + ], + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 13 } } - ], + }, "range": [ 111, 124 @@ -454,26 +446,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "file", - "range": [ - 132, - 136 - ], - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 11 - } + "value": { + "type": "SvelteLiteral", + "value": "file", + "range": [ + 132, + 136 + ], + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 7, + "column": 11 } } - ], + }, "range": [ 126, 137 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/06-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/06-output.json index 908a96f3..7f4fcec1 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/06-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/06-output.json @@ -179,44 +179,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "a", - "range": [ - 47, - 48 - ], - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "a", "range": [ - 46, - 49 + 47, + 48 ], "loc": { "start": { "line": 2, - "column": 15 + "column": 16 }, "end": { "line": 2, - "column": 18 + "column": 17 } } + }, + "range": [ + 46, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + } } - ], + }, "range": [ 40, 49 @@ -364,44 +362,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "b", - "range": [ - 77, - 78 - ], - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "b", "range": [ - 76, - 79 + 77, + 78 ], "loc": { "start": { "line": 3, - "column": 15 + "column": 16 }, "end": { "line": 3, - "column": 18 + "column": 17 } } + }, + "range": [ + 76, + 79 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 18 + } } - ], + }, "range": [ 70, 79 @@ -549,44 +545,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "c", - "range": [ - 107, - 108 - ], - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 17 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "c", "range": [ - 106, - 109 + 107, + 108 ], "loc": { "start": { "line": 4, - "column": 15 + "column": 16 }, "end": { "line": 4, - "column": 18 + "column": 17 } } + }, + "range": [ + 106, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 18 + } } - ], + }, "range": [ 100, 109 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/07-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/07-output.json index c0cf9376..a5086c9c 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/07-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/07-output.json @@ -46,7 +46,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 8, 16 @@ -216,26 +216,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Rice", - "range": [ - 56, - 60 - ], - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - } + "value": { + "type": "SvelteLiteral", + "value": "Rice", + "range": [ + 56, + 60 + ], + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 20 } } - ], + }, "range": [ 49, 61 @@ -383,26 +381,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Beans", - "range": [ - 92, - 97 - ], - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "Beans", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 21 } } - ], + }, "range": [ 85, 98 @@ -550,26 +546,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Cheese", - "range": [ - 130, - 136 - ], - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "Cheese", + "range": [ + 130, + 136 + ], + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 22 } } - ], + }, "range": [ 123, 137 @@ -717,26 +711,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Guac (extra)", - "range": [ - 170, - 182 - ], - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 28 - } + "value": { + "type": "SvelteLiteral", + "value": "Guac (extra)", + "range": [ + 170, + 182 + ], + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 28 } } - ], + }, "range": [ 163, 183 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/08-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/08-output.json index d00eec4f..8c70ca29 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/08-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/08-output.json @@ -46,7 +46,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 8, 16 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/09-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/09-output.json index 027ebe41..dcdc29f7 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/09-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/09-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "true", - "range": [ - 22, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "true", + "range": [ + 22, + 26 + ], + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 } } - ], + }, "range": [ 5, 27 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/10-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/10-output.json index 7a226ba0..ee6fbc51 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/10-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/10-output.json @@ -46,44 +46,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "clip", - "range": [ - 13, - 17 - ], - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "clip", "range": [ - 12, - 18 + 13, + 17 ], "loc": { "start": { "line": 2, - "column": 5 + "column": 6 }, "end": { "line": 2, - "column": 11 + "column": 10 } } + }, + "range": [ + 12, + 18 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 11 + } } - ], + }, "range": [ 8, 18 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/02-output.json index 87423107..1af2af53 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/02-output.json @@ -320,26 +320,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 131, - 136 - ], - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 131, + 136 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 18 } } - ], + }, "range": [ 125, 137 @@ -449,26 +447,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Plain", - "range": [ - 167, - 172 - ], - "loc": { - "start": { - "line": 7, - "column": 49 - }, - "end": { - "line": 7, - "column": 54 - } + "value": { + "type": "SvelteLiteral", + "value": "Plain", + "range": [ + 167, + 172 + ], + "loc": { + "start": { + "line": 7, + "column": 49 + }, + "end": { + "line": 7, + "column": 54 } } - ], + }, "range": [ 160, 173 @@ -581,26 +577,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 188, - 193 - ], - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 188, + 193 + ], + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 18 } } - ], + }, "range": [ 182, 194 @@ -710,26 +704,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Whole wheat", - "range": [ - 224, - 235 - ], - "loc": { - "start": { - "line": 8, - "column": 49 - }, - "end": { - "line": 8, - "column": 60 - } + "value": { + "type": "SvelteLiteral", + "value": "Whole wheat", + "range": [ + 224, + 235 + ], + "loc": { + "start": { + "line": 8, + "column": 49 + }, + "end": { + "line": 8, + "column": 60 } } - ], + }, "range": [ 217, 236 @@ -842,26 +834,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 251, - 256 - ], - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 251, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 18 } } - ], + }, "range": [ 245, 257 @@ -971,26 +961,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Spinach", - "range": [ - 287, - 294 - ], - "loc": { - "start": { - "line": 9, - "column": 49 - }, - "end": { - "line": 9, - "column": 56 - } + "value": { + "type": "SvelteLiteral", + "value": "Spinach", + "range": [ + 287, + 294 + ], + "loc": { + "start": { + "line": 9, + "column": 49 + }, + "end": { + "line": 9, + "column": 56 } } - ], + }, "range": [ 280, 295 @@ -1139,26 +1127,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 362, - 370 - ], - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 362, + 370 + ], + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 21 } } - ], + }, "range": [ 356, 371 @@ -1268,26 +1254,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Rice", - "range": [ - 401, - 405 - ], - "loc": { - "start": { - "line": 12, - "column": 52 - }, - "end": { - "line": 12, - "column": 56 - } + "value": { + "type": "SvelteLiteral", + "value": "Rice", + "range": [ + 401, + 405 + ], + "loc": { + "start": { + "line": 12, + "column": 52 + }, + "end": { + "line": 12, + "column": 56 } } - ], + }, "range": [ 394, 406 @@ -1400,26 +1384,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 421, - 429 - ], - "loc": { - "start": { - "line": 13, - "column": 13 - }, - "end": { - "line": 13, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 421, + 429 + ], + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 21 } } - ], + }, "range": [ 415, 430 @@ -1529,26 +1511,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Beans", - "range": [ - 460, - 465 - ], - "loc": { - "start": { - "line": 13, - "column": 52 - }, - "end": { - "line": 13, - "column": 57 - } + "value": { + "type": "SvelteLiteral", + "value": "Beans", + "range": [ + 460, + 465 + ], + "loc": { + "start": { + "line": 13, + "column": 52 + }, + "end": { + "line": 13, + "column": 57 } } - ], + }, "range": [ 453, 466 @@ -1661,26 +1641,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 481, - 489 - ], - "loc": { - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 14, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 481, + 489 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 21 } } - ], + }, "range": [ 475, 490 @@ -1790,26 +1768,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Cheese", - "range": [ - 520, - 526 - ], - "loc": { - "start": { - "line": 14, - "column": 52 - }, - "end": { - "line": 14, - "column": 58 - } + "value": { + "type": "SvelteLiteral", + "value": "Cheese", + "range": [ + 520, + 526 + ], + "loc": { + "start": { + "line": 14, + "column": 52 + }, + "end": { + "line": 14, + "column": 58 } } - ], + }, "range": [ 513, 527 @@ -1922,26 +1898,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 542, - 550 - ], - "loc": { - "start": { - "line": 15, - "column": 13 - }, - "end": { - "line": 15, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 542, + 550 + ], + "loc": { + "start": { + "line": 15, + "column": 13 + }, + "end": { + "line": 15, + "column": 21 } } - ], + }, "range": [ 536, 551 @@ -2051,26 +2025,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Guac (extra)", - "range": [ - 581, - 593 - ], - "loc": { - "start": { - "line": 15, - "column": 52 - }, - "end": { - "line": 15, - "column": 64 - } + "value": { + "type": "SvelteLiteral", + "value": "Guac (extra)", + "range": [ + 581, + 593 + ], + "loc": { + "start": { + "line": 15, + "column": 52 + }, + "end": { + "line": 15, + "column": 64 } } - ], + }, "range": [ 574, 594 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/02-output.json index 1055b0b2..6abceaf9 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/02-output.json @@ -82,71 +82,55 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "ConditionalExpression", - "alternate": { - "type": "Literal", - "raw": "''", - "value": "", - "range": [ - 63, - 65 - ], - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 35 - } - } - }, - "consequent": { - "type": "Literal", - "raw": "'active'", - "value": "active", - "range": [ - 52, - 60 - ], - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 30 - } + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "ConditionalExpression", + "alternate": { + "type": "Literal", + "raw": "''", + "value": "", + "range": [ + 63, + 65 + ], + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 35 } - }, - "test": { - "type": "Identifier", - "name": "active", - "range": [ - 43, - 49 - ], - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - } + } + }, + "consequent": { + "type": "Literal", + "raw": "'active'", + "value": "active", + "range": [ + 52, + 60 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 } - }, + } + }, + "test": { + "type": "Identifier", + "name": "active", "range": [ 43, - 65 + 49 ], "loc": { "start": { @@ -155,26 +139,40 @@ }, "end": { "line": 2, - "column": 35 + "column": 19 } } }, "range": [ - 42, - 66 + 43, + 65 ], "loc": { "start": { "line": 2, - "column": 12 + "column": 13 }, "end": { "line": 2, - "column": 36 + "column": 35 } } + }, + "range": [ + 42, + 66 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 36 + } } - ], + }, "range": [ 35, 67 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/01-output.json index 81ff6434..7b793b58 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/01-output.json @@ -64,44 +64,42 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "value", - "range": [ - 21, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "value", "range": [ - 20, - 27 + 21, + 26 ], "loc": { "start": { "line": 1, - "column": 20 + "column": 21 }, "end": { "line": 1, - "column": 27 + "column": 26 } } + }, + "range": [ + 20, + 27 + ], + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } } - ], + }, "range": [ 5, 27 @@ -232,26 +230,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "value", - "range": [ - 52, - 57 - ], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "value", + "range": [ + 52, + 57 + ], + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 26 } } - ], + }, "range": [ 36, 58 @@ -382,7 +378,7 @@ } }, "shorthand": true, - "value": [], + "value": null, "range": [ 67, 81 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02-output.json index 06976eb0..f7d583fd 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02-output.json @@ -100,26 +100,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "red", - "range": [ - 48, - 51 - ], - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "red", + "range": [ + 48, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 21 } } - ], + }, "range": [ 35, 52 @@ -267,26 +265,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red;", - "range": [ - 75, - 86 - ], - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red;", + "range": [ + 75, + 86 + ], + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 23 } } - ], + }, "range": [ 68, 87 @@ -488,44 +484,42 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "myColor", - "range": [ - 148, - 155 - ], - "loc": { - "start": { - "line": 6, - "column": 18 - }, - "end": { - "line": 6, - "column": 25 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "myColor", "range": [ - 147, - 156 + 148, + 155 ], "loc": { "start": { "line": 6, - "column": 17 + "column": 18 }, "end": { "line": 6, - "column": 26 + "column": 25 } } + }, + "range": [ + 147, + 156 + ], + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 26 + } } - ], + }, "range": [ 135, 156 @@ -727,7 +721,7 @@ } }, "shorthand": true, - "value": [], + "value": null, "range": [ 235, 246 @@ -929,7 +923,7 @@ } }, "shorthand": true, - "value": [], + "value": null, "range": [ 304, 315 @@ -984,26 +978,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "12rem", - "range": [ - 329, - 334 - ], - "loc": { - "start": { - "line": 12, - "column": 30 - }, - "end": { - "line": 12, - "column": 35 - } + "value": { + "type": "SvelteLiteral", + "value": "12rem", + "range": [ + 329, + 334 + ], + "loc": { + "start": { + "line": 12, + "column": 30 + }, + "end": { + "line": 12, + "column": 35 } } - ], + }, "range": [ 316, 335 @@ -1058,71 +1050,55 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "ConditionalExpression", - "alternate": { - "type": "Literal", - "raw": "\"white\"", - "value": "white", - "range": [ - 381, - 388 - ], - "loc": { - "start": { - "line": 12, - "column": 82 - }, - "end": { - "line": 12, - "column": 89 - } - } - }, - "consequent": { - "type": "Literal", - "raw": "\"black\"", - "value": "black", - "range": [ - 371, - 378 - ], - "loc": { - "start": { - "line": 12, - "column": 72 - }, - "end": { - "line": 12, - "column": 79 - } + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "ConditionalExpression", + "alternate": { + "type": "Literal", + "raw": "\"white\"", + "value": "white", + "range": [ + 381, + 388 + ], + "loc": { + "start": { + "line": 12, + "column": 82 + }, + "end": { + "line": 12, + "column": 89 } - }, - "test": { - "type": "Identifier", - "name": "darkMode", - "range": [ - 360, - 368 - ], - "loc": { - "start": { - "line": 12, - "column": 61 - }, - "end": { - "line": 12, - "column": 69 - } + } + }, + "consequent": { + "type": "Literal", + "raw": "\"black\"", + "value": "black", + "range": [ + 371, + 378 + ], + "loc": { + "start": { + "line": 12, + "column": 72 + }, + "end": { + "line": 12, + "column": 79 } - }, + } + }, + "test": { + "type": "Identifier", + "name": "darkMode", "range": [ 360, - 388 + 368 ], "loc": { "start": { @@ -1131,26 +1107,40 @@ }, "end": { "line": 12, - "column": 89 + "column": 69 } } }, "range": [ - 359, - 389 + 360, + 388 ], "loc": { "start": { "line": 12, - "column": 60 + "column": 61 }, "end": { "line": 12, - "column": 90 + "column": 89 } } + }, + "range": [ + 359, + 389 + ], + "loc": { + "start": { + "line": 12, + "column": 60 + }, + "end": { + "line": 12, + "column": 90 + } } - ], + }, "range": [ 336, 389 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-output.json index e09986ee..e506dcab 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/02.1-output.json @@ -102,26 +102,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "red", - "range": [ - 71, - 74 - ], - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 31 - } + "value": { + "type": "SvelteLiteral", + "value": "red", + "range": [ + 71, + 74 + ], + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 31 } } - ], + }, "range": [ 48, 75 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json index 34d295a4..84ebfc04 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05.1-style-property/03-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: blue;", - "range": [ - 12, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "color: blue;", + "range": [ + 12, + 24 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 } } - ], + }, "range": [ 5, 25 @@ -120,26 +118,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "red", - "range": [ - 39, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - } + "value": { + "type": "SvelteLiteral", + "value": "red", + "range": [ + 39, + 42 + ], + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 42 } } - ], + }, "range": [ 26, 43 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-ts-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-ts-output.json index 4d782217..fe16ba3c 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-ts-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-ts-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/01-output.json index 14f981f0..34e5266f 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/01-output.json @@ -119,45 +119,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "0", - "value": 0, - "range": [ - 28, - 29 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "0", + "value": 0, "range": [ - 27, - 30 + 28, + 29 ], "loc": { "start": { "line": 3, - "column": 6 + "column": 7 }, "end": { "line": 3, - "column": 9 + "column": 8 } } + }, + "range": [ + 27, + 30 + ], + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + } } - ], + }, "range": [ 23, 30 @@ -194,26 +192,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "black", - "range": [ - 47, - 52 - ], - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "black", + "range": [ + 47, + 52 + ], + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 21 } } - ], + }, "range": [ 33, 53 @@ -250,26 +246,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "rgb(0, 0, 255)", - "range": [ - 71, - 85 - ], - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 31 - } + "value": { + "type": "SvelteLiteral", + "value": "rgb(0, 0, 255)", + "range": [ + 71, + 85 + ], + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 31 } } - ], + }, "range": [ 56, 86 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/02-output.json index 7e586ab8..a4303e89 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/02-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "display: contents; --rail-color: black; --track-color: rgb(0, 0, 255)", - "range": [ - 12, - 81 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 81 - } + "value": { + "type": "SvelteLiteral", + "value": "display: contents; --rail-color: black; --track-color: rgb(0, 0, 255)", + "range": [ + 12, + 81 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 81 } } - ], + }, "range": [ 5, 82 @@ -235,45 +233,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "0", - "value": 0, - "range": [ - 112, - 113 - ], - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 7 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "0", + "value": 0, "range": [ - 111, - 114 + 112, + 113 ], "loc": { "start": { "line": 4, - "column": 5 + "column": 6 }, "end": { "line": 4, - "column": 8 + "column": 7 } } + }, + "range": [ + 111, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 8 + } } - ], + }, "range": [ 107, 114 @@ -310,45 +306,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "100", - "value": 100, - "range": [ - 121, - 124 - ], - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 9 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "100", + "value": 100, "range": [ - 120, - 125 + 121, + 124 ], "loc": { "start": { "line": 5, - "column": 5 + "column": 6 }, "end": { "line": 5, - "column": 10 + "column": 9 } } + }, + "range": [ + 120, + 125 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 10 + } } - ], + }, "range": [ 116, 125 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/03-output.json index 0b3214b3..7fb82625 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-style-props/03-output.json @@ -191,26 +191,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "goldenrod", - "range": [ - 158, - 167 - ], - "loc": { - "start": { - "line": 7, - "column": 22 - }, - "end": { - "line": 7, - "column": 31 - } + "value": { + "type": "SvelteLiteral", + "value": "goldenrod", + "range": [ + 158, + 167 + ], + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 31 } } - ], + }, "range": [ 144, 168 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/00/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/00/01-output.json index 587e48d6..78f8c5b9 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/00/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/00/01-output.json @@ -156,26 +156,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "x", - "range": [ - 52, - 53 - ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } + "value": { + "type": "SvelteLiteral", + "value": "x", + "range": [ + 52, + 53 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 } } - ], + }, "range": [ 46, 54 @@ -323,44 +321,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "value", - "range": [ - 101, - 106 - ], - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 17 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "value", "range": [ - 100, - 107 + 101, + 106 ], "loc": { "start": { "line": 3, - "column": 11 + "column": 12 }, "end": { "line": 3, - "column": 18 + "column": 17 } } + }, + "range": [ + 100, + 107 + ], + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 18 + } } - ], + }, "range": [ 95, 107 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/01-output.json index 0eaed242..bd3e2ba4 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/01-output.json @@ -141,26 +141,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "header", - "range": [ - 42, - 48 - ], - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "header", + "range": [ + 42, + 48 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 19 } } - ], + }, "range": [ 36, 49 @@ -418,26 +416,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 140, - 146 - ], - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 140, + 146 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 19 } } - ], + }, "range": [ 134, 147 @@ -712,26 +708,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "header", - "range": [ - 204, - 210 - ], - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "header", + "range": [ + 204, + 210 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 17 } } - ], + }, "range": [ 198, 211 @@ -879,26 +873,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 233, - 239 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 233, + 239 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 16 } } - ], + }, "range": [ 227, 240 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/02-output.json index c939cc6c..3eed16fc 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/01-slot-name-name/02-output.json @@ -141,26 +141,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "header", - "range": [ - 42, - 48 - ], - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "header", + "range": [ + 42, + 48 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 19 } } - ], + }, "range": [ 36, 49 @@ -418,26 +416,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 140, - 146 - ], - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 140, + 146 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 19 } } - ], + }, "range": [ 134, 147 @@ -712,26 +708,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "header", - "range": [ - 217, - 223 - ], - "loc": { - "start": { - "line": 10, - "column": 24 - }, - "end": { - "line": 10, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "header", + "range": [ + 217, + 223 + ], + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 30 } } - ], + }, "range": [ 211, 224 @@ -844,26 +838,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 252, - 258 - ], - "loc": { - "start": { - "line": 11, - "column": 24 - }, - "end": { - "line": 11, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 252, + 258 + ], + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 30 } } - ], + }, "range": [ 246, 259 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-output.json index 5c141781..b63c88f0 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/02-$$slots/01-output.json @@ -141,26 +141,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "title", - "range": [ - 40, - 45 - ], - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "title", + "range": [ + 40, + 45 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 18 } } - ], + }, "range": [ 34, 46 @@ -459,26 +457,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "description", - "range": [ - 193, - 204 - ], - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 25 - } + "value": { + "type": "SvelteLiteral", + "value": "description", + "range": [ + 193, + 204 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 25 } } - ], + }, "range": [ 187, 205 @@ -770,26 +766,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "title", - "range": [ - 267, - 272 - ], - "loc": { - "start": { - "line": 13, - "column": 11 - }, - "end": { - "line": 13, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "title", + "range": [ + 267, + 272 + ], + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 16 } } - ], + }, "range": [ 261, 273 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-output.json index d8111359..586e8168 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-output.json @@ -182,26 +182,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "fancy", - "range": [ - 67, - 72 - ], - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "fancy", + "range": [ + 67, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 } } - ], + }, "range": [ 60, 73 @@ -298,44 +296,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "item", - "range": [ - 90, - 94 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 19 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "item", "range": [ - 89, - 95 + 90, + 94 ], "loc": { "start": { "line": 5, - "column": 14 + "column": 15 }, "end": { "line": 5, - "column": 20 + "column": 19 } } + }, + "range": [ + 89, + 95 + ], + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 20 + } } - ], + }, "range": [ 84, 95 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-scope-output.json index edb0ab26..65323a3e 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-scope-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/01-scope-output.json @@ -206,26 +206,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "fancy", - "range": [ - 67, - 72 - ], - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "fancy", + "range": [ + 67, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 } } - ], + }, "range": [ 60, 73 @@ -322,44 +320,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "item", - "range": [ - 90, - 94 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 19 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "item", "range": [ - 89, - 95 + 90, + 94 ], "loc": { "start": { "line": 5, - "column": 14 + "column": 15 }, "end": { "line": 5, - "column": 20 + "column": 19 } } + }, + "range": [ + 89, + 95 + ], + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 20 + } } - ], + }, "range": [ 84, 95 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-output.json index 64be75ab..c3061d6c 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-output.json @@ -182,26 +182,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "fancy", - "range": [ - 67, - 72 - ], - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "fancy", + "range": [ + 67, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 } } - ], + }, "range": [ 60, 73 @@ -298,26 +296,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 90, - 94 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 90, + 94 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 19 } } - ], + }, "range": [ 84, 95 @@ -618,26 +614,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 147, - 153 - ], - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 147, + 153 + ], + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 18 } } - ], + }, "range": [ 141, 154 @@ -915,26 +909,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 216, - 220 - ], - "loc": { - "start": { - "line": 14, - "column": 12 - }, - "end": { - "line": 14, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 216, + 220 + ], + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 16 } } - ], + }, "range": [ 210, 221 @@ -1209,26 +1201,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 259, - 265 - ], - "loc": { - "start": { - "line": 15, - "column": 10 - }, - "end": { - "line": 15, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 259, + 265 + ], + "loc": { + "start": { + "line": 15, + "column": 10 + }, + "end": { + "line": 15, + "column": 16 } } - ], + }, "range": [ 253, 266 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-scope-output.json index 437f8639..546ceeef 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-scope-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/13-slot/03-slot-let-name-value/02-scope-output.json @@ -229,26 +229,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "fancy", - "range": [ - 67, - 72 - ], - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "fancy", + "range": [ + 67, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 } } - ], + }, "range": [ 60, 73 @@ -345,26 +343,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 90, - 94 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 90, + 94 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 19 } } - ], + }, "range": [ 84, 95 @@ -733,26 +729,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 216, - 220 - ], - "loc": { - "start": { - "line": 14, - "column": 12 - }, - "end": { - "line": 14, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 216, + 220 + ], + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 16 } } - ], + }, "range": [ 210, 221 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/14-svelte-self/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/14-svelte-self/01-output.json index 7b3d3982..4ede41db 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/14-svelte-self/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/14-svelte-self/01-output.json @@ -417,59 +417,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "count", - "range": [ - 110, - 115 - ], - "loc": { - "start": { - "line": 7, - "column": 22 - }, - "end": { - "line": 7, - "column": 27 - } - } - }, - "operator": "-", - "right": { - "type": "Literal", - "raw": "1", - "value": 1, - "range": [ - 118, - 119 - ], - "loc": { - "start": { - "line": 7, - "column": 30 - }, - "end": { - "line": 7, - "column": 31 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "BinaryExpression", + "left": { + "type": "Identifier", + "name": "count", "range": [ 110, - 119 + 115 ], "loc": { "start": { "line": 7, "column": 22 }, + "end": { + "line": 7, + "column": 27 + } + } + }, + "operator": "-", + "right": { + "type": "Literal", + "raw": "1", + "value": 1, + "range": [ + 118, + 119 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, "end": { "line": 7, "column": 31 @@ -477,21 +461,35 @@ } }, "range": [ - 109, - 120 + 110, + 119 ], "loc": { "start": { "line": 7, - "column": 21 + "column": 22 }, "end": { "line": 7, - "column": 32 + "column": 31 } } + }, + "range": [ + 109, + 120 + ], + "loc": { + "start": { + "line": 7, + "column": 21 + }, + "end": { + "line": 7, + "column": 32 + } } - ], + }, "range": [ 102, 121 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/15_1-svelte-component/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/15_1-svelte-component/02-output.json index 0f2f71da..835da98e 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/15_1-svelte-component/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/15_1-svelte-component/02-output.json @@ -136,44 +136,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "bar", - "range": [ - 57, - 60 - ], - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 60 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "bar", "range": [ - 56, - 61 + 57, + 60 ], "loc": { "start": { "line": 1, - "column": 56 + "column": 57 }, "end": { "line": 1, - "column": 61 + "column": 60 } } + }, + "range": [ + 56, + 61 + ], + "loc": { + "start": { + "line": 1, + "column": 56 + }, + "end": { + "line": 1, + "column": 61 + } } - ], + }, "range": [ 52, 61 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/18-svelte-head/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/18-svelte-head/02-output.json index 2bc12b3f..54706519 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/18-svelte-head/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/18-svelte-head/02-output.json @@ -105,26 +105,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "stylesheet", - "range": [ - 26, - 36 - ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "stylesheet", + "range": [ + 26, + 36 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 22 } } - ], + }, "range": [ 21, 37 @@ -161,26 +159,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "tutorial/dark-theme.css", - "range": [ - 44, - 67 - ], - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 53 - } + "value": { + "type": "SvelteLiteral", + "value": "tutorial/dark-theme.css", + "range": [ + 44, + 67 + ], + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 53 } } - ], + }, "range": [ 38, 68 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/01-output.json index d7b6a188..4714f75d 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/01-output.json @@ -46,44 +46,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "value", - "range": [ - 24, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "value", "range": [ - 23, - 30 + 24, + 29 ], "loc": { "start": { "line": 1, - "column": 23 + "column": 24 }, "end": { "line": 1, - "column": 30 + "column": 29 } } + }, + "range": [ + 23, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 30 + } } - ], + }, "range": [ 16, 30 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-old-output.json b/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-old-output.json index cc395321..7051168b 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-old-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-old-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "my-custom-element", - "range": [ - 21, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 38 - } + "value": { + "type": "SvelteLiteral", + "value": "my-custom-element", + "range": [ + 21, + 38 + ], + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 38 } } - ], + }, "range": [ 16, 39 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-output.json index 914a2fb7..d537e67d 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/19-svelte-options/02-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "my-custom-element", - "range": [ - 31, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 48 - } + "value": { + "type": "SvelteLiteral", + "value": "my-custom-element", + "range": [ + 31, + 48 + ], + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 48 } } - ], + }, "range": [ 16, 49 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/20-svelte-fragment/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/20-svelte-fragment/01-output.json index d7aea4f3..107a88f8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/20-svelte-fragment/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/20-svelte-fragment/01-output.json @@ -141,26 +141,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "header", - "range": [ - 42, - 48 - ], - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "header", + "range": [ + 42, + 48 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 19 } } - ], + }, "range": [ 36, 49 @@ -418,26 +416,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 140, - 146 - ], - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 140, + 146 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 19 } } - ], + }, "range": [ 134, 147 @@ -712,26 +708,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "header", - "range": [ - 204, - 210 - ], - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "header", + "range": [ + 204, + 210 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 17 } } - ], + }, "range": [ 198, 211 @@ -879,26 +873,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 247, - 253 - ], - "loc": { - "start": { - "line": 11, - "column": 24 - }, - "end": { - "line": 11, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 247, + 253 + ], + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 30 } } - ], + }, "range": [ 241, 254 diff --git a/tests/fixtures/parser/ast/empty-elements01-output.json b/tests/fixtures/parser/ast/empty-elements01-output.json index 03e8e3cc..7538542b 100644 --- a/tests/fixtures/parser/ast/empty-elements01-output.json +++ b/tests/fixtures/parser/ast/empty-elements01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "./style.scss", - "range": [ - 12, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "./style.scss", + "range": [ + 12, + 24 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 } } - ], + }, "range": [ 7, 25 diff --git a/tests/fixtures/parser/ast/hello/hello-world05-output.json b/tests/fixtures/parser/ast/hello/hello-world05-output.json index ba5ad973..147e021a 100644 --- a/tests/fixtures/parser/ast/hello/hello-world05-output.json +++ b/tests/fixtures/parser/ast/hello/hello-world05-output.json @@ -865,26 +865,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "http://www.w3.org/2000/svg", - "range": [ - 675, - 701 - ], - "loc": { - "start": { - "line": 45, - "column": 13 - }, - "end": { - "line": 45, - "column": 39 - } + "value": { + "type": "SvelteLiteral", + "value": "http://www.w3.org/2000/svg", + "range": [ + 675, + 701 + ], + "loc": { + "start": { + "line": 45, + "column": 13 + }, + "end": { + "line": 45, + "column": 39 } } - ], + }, "range": [ 668, 702 @@ -921,26 +919,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0 0 103 124", - "range": [ - 712, - 723 - ], - "loc": { - "start": { - "line": 45, - "column": 50 - }, - "end": { - "line": 45, - "column": 61 - } + "value": { + "type": "SvelteLiteral", + "value": "0 0 103 124", + "range": [ + 712, + 723 + ], + "loc": { + "start": { + "line": 45, + "column": 50 + }, + "end": { + "line": 45, + "column": 61 } } - ], + }, "range": [ 703, 724 @@ -1170,26 +1166,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0.2", - "range": [ - 768, - 771 - ], - "loc": { - "start": { - "line": 46, - "column": 42 - }, - "end": { - "line": 46, - "column": 45 - } + "value": { + "type": "SvelteLiteral", + "value": "0.2", + "range": [ + 768, + 771 + ], + "loc": { + "start": { + "line": 46, + "column": 42 + }, + "end": { + "line": 46, + "column": 45 } } - ], + }, "range": [ 760, 771 @@ -1534,26 +1528,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "stroke: #ff3e00; fill: #ff3e00; stroke-width: 50;", - "range": [ - 858, - 907 - ], - "loc": { - "start": { - "line": 49, - "column": 11 - }, - "end": { - "line": 49, - "column": 60 - } + "value": { + "type": "SvelteLiteral", + "value": "stroke: #ff3e00; fill: #ff3e00; stroke-width: 50;", + "range": [ + 858, + 907 + ], + "loc": { + "start": { + "line": 49, + "column": 11 + }, + "end": { + "line": 49, + "column": 60 } } - ], + }, "range": [ 851, 908 @@ -1590,44 +1582,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "outer", - "range": [ - 916, - 921 - ], - "loc": { - "start": { - "line": 50, - "column": 7 - }, - "end": { - "line": 50, - "column": 12 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "outer", "range": [ - 915, - 922 + 916, + 921 ], "loc": { "start": { "line": 50, - "column": 6 + "column": 7 }, "end": { "line": 50, - "column": 13 + "column": 12 } } + }, + "range": [ + 915, + 922 + ], + "loc": { + "start": { + "line": 50, + "column": 6 + }, + "end": { + "line": 50, + "column": 13 + } } - ], + }, "range": [ 913, 922 @@ -1873,26 +1863,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "stroke:#ff3e00; stroke-width: 1.5", - "range": [ - 982, - 1015 - ], - "loc": { - "start": { - "line": 54, - "column": 11 - }, - "end": { - "line": 54, - "column": 44 - } + "value": { + "type": "SvelteLiteral", + "value": "stroke:#ff3e00; stroke-width: 1.5", + "range": [ + 982, + 1015 + ], + "loc": { + "start": { + "line": 54, + "column": 11 + }, + "end": { + "line": 54, + "column": 44 } } - ], + }, "range": [ 975, 1016 @@ -1929,44 +1917,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "inner", - "range": [ - 1024, - 1029 - ], - "loc": { - "start": { - "line": 55, - "column": 7 - }, - "end": { - "line": 55, - "column": 12 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "inner", "range": [ - 1023, - 1030 + 1024, + 1029 ], "loc": { "start": { "line": 55, - "column": 6 + "column": 7 }, "end": { "line": 55, - "column": 13 + "column": 12 } } + }, + "range": [ + 1023, + 1030 + ], + "loc": { + "start": { + "line": 55, + "column": 6 + }, + "end": { + "line": 55, + "column": 13 + } } - ], + }, "range": [ 1021, 1030 @@ -2181,26 +2167,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "centered", - "range": [ - 1066, - 1074 - ], - "loc": { - "start": { - "line": 60, - "column": 13 - }, - "end": { - "line": 60, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "centered", + "range": [ + 1066, + 1074 + ], + "loc": { + "start": { + "line": 60, + "column": 13 + }, + "end": { + "line": 60, + "column": 21 } } - ], + }, "range": [ 1059, 1075 @@ -3103,26 +3087,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1272, - 1280 - ], - "loc": { - "start": { - "line": 70, - "column": 14 - }, - "end": { - "line": 70, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1272, + 1280 + ], + "loc": { + "start": { + "line": 70, + "column": 14 + }, + "end": { + "line": 70, + "column": 22 } } - ], + }, "range": [ 1266, 1281 @@ -3359,26 +3341,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://fonts.googleapis.com/css?family=Overpass:100,400", - "range": [ - 1339, - 1395 - ], - "loc": { - "start": { - "line": 74, - "column": 12 - }, - "end": { - "line": 74, - "column": 68 - } + "value": { + "type": "SvelteLiteral", + "value": "https://fonts.googleapis.com/css?family=Overpass:100,400", + "range": [ + 1339, + 1395 + ], + "loc": { + "start": { + "line": 74, + "column": 12 + }, + "end": { + "line": 74, + "column": 68 } } - ], + }, "range": [ 1333, 1396 @@ -3415,26 +3395,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "stylesheet", - "range": [ - 1402, - 1412 - ], - "loc": { - "start": { - "line": 74, - "column": 75 - }, - "end": { - "line": 74, - "column": 85 - } + "value": { + "type": "SvelteLiteral", + "value": "stylesheet", + "range": [ + 1402, + 1412 + ], + "loc": { + "start": { + "line": 74, + "column": 75 + }, + "end": { + "line": 74, + "column": 85 } } - ], + }, "range": [ 1397, 1413 diff --git a/tests/fixtures/parser/ast/html-comments01-output.json b/tests/fixtures/parser/ast/html-comments01-output.json index fad427e1..5addaa17 100644 --- a/tests/fixtures/parser/ast/html-comments01-output.json +++ b/tests/fixtures/parser/ast/html-comments01-output.json @@ -247,26 +247,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 66, - 72 - ], - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 66, + 72 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 19 } } - ], + }, "range": [ 60, 73 diff --git a/tests/fixtures/parser/ast/i18n-test-output.json b/tests/fixtures/parser/ast/i18n-test-output.json index 95245a12..dc9854c3 100644 --- a/tests/fixtures/parser/ast/i18n-test-output.json +++ b/tests/fixtures/parser/ast/i18n-test-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -346,55 +344,38 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "CallExpression", - "arguments": [ - { - "type": "Literal", - "raw": "'test'", - "value": "test", - "range": [ - 106, - 112 - ], - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 6, - "column": 26 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "$_", + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'test'", + "value": "test", "range": [ - 103, - 105 + 106, + 112 ], "loc": { "start": { "line": 6, - "column": 17 + "column": 20 }, "end": { "line": 6, - "column": 19 + "column": 26 } } - }, - "optional": false, + } + ], + "callee": { + "type": "Identifier", + "name": "$_", "range": [ 103, - 113 + 105 ], "loc": { "start": { @@ -403,26 +384,41 @@ }, "end": { "line": 6, - "column": 27 + "column": 19 } } }, + "optional": false, "range": [ - 102, - 114 + 103, + 113 ], "loc": { "start": { "line": 6, - "column": 16 + "column": 17 }, "end": { "line": 6, - "column": 28 + "column": 27 } } + }, + "range": [ + 102, + 114 + ], + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 28 + } } - ], + }, "range": [ 97, 114 diff --git a/tests/fixtures/parser/ast/issue325-eslint-plugin-svelte-output.json b/tests/fixtures/parser/ast/issue325-eslint-plugin-svelte-output.json index 7cda1a69..120e622a 100644 --- a/tests/fixtures/parser/ast/issue325-eslint-plugin-svelte-output.json +++ b/tests/fixtures/parser/ast/issue325-eslint-plugin-svelte-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/issue338-eslint-plugin-svelte-output.json b/tests/fixtures/parser/ast/issue338-eslint-plugin-svelte-output.json index 0caf4928..bdeb8cac 100644 --- a/tests/fixtures/parser/ast/issue338-eslint-plugin-svelte-output.json +++ b/tests/fixtures/parser/ast/issue338-eslint-plugin-svelte-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/kit-demo-home-output.json b/tests/fixtures/parser/ast/kit-demo-home-output.json index 8e46fb69..bfe0e080 100644 --- a/tests/fixtures/parser/ast/kit-demo-home-output.json +++ b/tests/fixtures/parser/ast/kit-demo-home-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "module", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "module", + "range": [ + 17, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 } } - ], + }, "range": [ 8, 24 @@ -789,26 +787,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "welcome", - "range": [ - 220, - 227 - ], - "loc": { - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 15, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "welcome", + "range": [ + 220, + 227 + ], + "loc": { + "start": { + "line": 15, + "column": 14 + }, + "end": { + "line": 15, + "column": 21 } } - ], + }, "range": [ 213, 228 @@ -964,26 +960,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "svelte-welcome.webp", - "range": [ - 263, - 282 - ], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 39 - } + "value": { + "type": "SvelteLiteral", + "value": "svelte-welcome.webp", + "range": [ + 263, + 282 + ], + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 17, + "column": 39 } } - ], + }, "range": [ 255, 283 @@ -1020,26 +1014,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "image/webp", - "range": [ - 290, - 300 - ], - "loc": { - "start": { - "line": 17, - "column": 47 - }, - "end": { - "line": 17, - "column": 57 - } + "value": { + "type": "SvelteLiteral", + "value": "image/webp", + "range": [ + 290, + 300 + ], + "loc": { + "start": { + "line": 17, + "column": 47 + }, + "end": { + "line": 17, + "column": 57 } } - ], + }, "range": [ 284, 301 @@ -1152,26 +1144,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "svelte-welcome.png", - "range": [ - 319, - 337 - ], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 32 - } + "value": { + "type": "SvelteLiteral", + "value": "svelte-welcome.png", + "range": [ + 319, + 337 + ], + "loc": { + "start": { + "line": 18, + "column": 14 + }, + "end": { + "line": 18, + "column": 32 } } - ], + }, "range": [ 314, 338 @@ -1208,26 +1198,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Welcome", - "range": [ - 344, - 351 - ], - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 46 - } + "value": { + "type": "SvelteLiteral", + "value": "Welcome", + "range": [ + 344, + 351 + ], + "loc": { + "start": { + "line": 18, + "column": 39 + }, + "end": { + "line": 18, + "column": 46 } } - ], + }, "range": [ 339, 352 diff --git a/tests/fixtures/parser/ast/let-directive01-output.json b/tests/fixtures/parser/ast/let-directive01-output.json index e5c165fe..b5d3017a 100644 --- a/tests/fixtures/parser/ast/let-directive01-output.json +++ b/tests/fixtures/parser/ast/let-directive01-output.json @@ -396,26 +396,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 diff --git a/tests/fixtures/parser/ast/let-directive01-scope-output.json b/tests/fixtures/parser/ast/let-directive01-scope-output.json index d5b190b7..a94dc94e 100644 --- a/tests/fixtures/parser/ast/let-directive01-scope-output.json +++ b/tests/fixtures/parser/ast/let-directive01-scope-output.json @@ -492,26 +492,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 @@ -1211,26 +1209,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 @@ -1755,26 +1751,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 @@ -2258,26 +2252,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 diff --git a/tests/fixtures/parser/ast/let-directive03-output.json b/tests/fixtures/parser/ast/let-directive03-output.json index fd5e4fec..e435c57d 100644 --- a/tests/fixtures/parser/ast/let-directive03-output.json +++ b/tests/fixtures/parser/ast/let-directive03-output.json @@ -396,26 +396,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 @@ -596,59 +594,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "item2", - "range": [ - 127, - 132 - ], - "loc": { - "start": { - "line": 6, - "column": 44 - }, - "end": { - "line": 6, - "column": 49 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "class", - "range": [ - 133, - 138 - ], - "loc": { - "start": { - "line": 6, - "column": 50 - }, - "end": { - "line": 6, - "column": 55 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item2", "range": [ 127, - 138 + 132 ], "loc": { "start": { "line": 6, "column": 44 }, + "end": { + "line": 6, + "column": 49 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "class", + "range": [ + 133, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 50 + }, "end": { "line": 6, "column": 55 @@ -656,21 +638,35 @@ } }, "range": [ - 126, - 139 + 127, + 138 ], "loc": { "start": { "line": 6, - "column": 43 + "column": 44 }, "end": { "line": 6, - "column": 56 + "column": 55 } } + }, + "range": [ + 126, + 139 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 56 + } } - ], + }, "range": [ 120, 139 diff --git a/tests/fixtures/parser/ast/let-directive03-scope-output.json b/tests/fixtures/parser/ast/let-directive03-scope-output.json index 8715fb62..6fd26d34 100644 --- a/tests/fixtures/parser/ast/let-directive03-scope-output.json +++ b/tests/fixtures/parser/ast/let-directive03-scope-output.json @@ -469,26 +469,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 @@ -669,59 +667,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "item2", - "range": [ - 127, - 132 - ], - "loc": { - "start": { - "line": 6, - "column": 44 - }, - "end": { - "line": 6, - "column": 49 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "class", - "range": [ - 133, - 138 - ], - "loc": { - "start": { - "line": 6, - "column": 50 - }, - "end": { - "line": 6, - "column": 55 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item2", "range": [ 127, - 138 + 132 ], "loc": { "start": { "line": 6, "column": 44 }, + "end": { + "line": 6, + "column": 49 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "class", + "range": [ + 133, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 50 + }, "end": { "line": 6, "column": 55 @@ -729,21 +711,35 @@ } }, "range": [ - 126, - 139 + 127, + 138 ], "loc": { "start": { "line": 6, - "column": 43 + "column": 44 }, "end": { "line": 6, - "column": 56 + "column": 55 } } + }, + "range": [ + 126, + 139 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 56 + } } - ], + }, "range": [ 120, 139 @@ -1150,26 +1146,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 @@ -1350,59 +1344,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "item2", - "range": [ - 127, - 132 - ], - "loc": { - "start": { - "line": 6, - "column": 44 - }, - "end": { - "line": 6, - "column": 49 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "class", - "range": [ - 133, - 138 - ], - "loc": { - "start": { - "line": 6, - "column": 50 - }, - "end": { - "line": 6, - "column": 55 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item2", "range": [ 127, - 138 + 132 ], "loc": { "start": { "line": 6, "column": 44 }, + "end": { + "line": 6, + "column": 49 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "class", + "range": [ + 133, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 50 + }, "end": { "line": 6, "column": 55 @@ -1410,21 +1388,35 @@ } }, "range": [ - 126, - 139 + 127, + 138 ], "loc": { "start": { "line": 6, - "column": 43 + "column": 44 }, "end": { "line": 6, - "column": 56 + "column": 55 } } + }, + "range": [ + 126, + 139 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 56 + } } - ], + }, "range": [ 120, 139 @@ -1733,26 +1725,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "item", - "range": [ - 95, - 99 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "item", + "range": [ + 95, + 99 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 89, 100 @@ -1933,59 +1923,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "item2", - "range": [ - 127, - 132 - ], - "loc": { - "start": { - "line": 6, - "column": 44 - }, - "end": { - "line": 6, - "column": 49 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "class", - "range": [ - 133, - 138 - ], - "loc": { - "start": { - "line": 6, - "column": 50 - }, - "end": { - "line": 6, - "column": 55 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item2", "range": [ 127, - 138 + 132 ], "loc": { "start": { "line": 6, "column": 44 }, + "end": { + "line": 6, + "column": 49 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "class", + "range": [ + 133, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 50 + }, "end": { "line": 6, "column": 55 @@ -1993,21 +1967,35 @@ } }, "range": [ - 126, - 139 + 127, + 138 ], "loc": { "start": { "line": 6, - "column": 43 + "column": 44 }, "end": { "line": 6, - "column": 56 + "column": 55 } } + }, + "range": [ + 126, + 139 + ], + "loc": { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 56 + } } - ], + }, "range": [ 120, 139 diff --git a/tests/fixtures/parser/ast/let-directive04-output.json b/tests/fixtures/parser/ast/let-directive04-output.json index 952c0104..3a97b401 100644 --- a/tests/fixtures/parser/ast/let-directive04-output.json +++ b/tests/fixtures/parser/ast/let-directive04-output.json @@ -81,26 +81,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 94, - 96 - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 94, + 96 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 } } - ], + }, "range": [ 88, 97 @@ -424,7 +422,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 188, 197 diff --git a/tests/fixtures/parser/ast/let-directive04-scope-output.json b/tests/fixtures/parser/ast/let-directive04-scope-output.json index c275de6d..7b7af752 100644 --- a/tests/fixtures/parser/ast/let-directive04-scope-output.json +++ b/tests/fixtures/parser/ast/let-directive04-scope-output.json @@ -427,7 +427,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 188, 197 diff --git a/tests/fixtures/parser/ast/pug/each/each01-output.json b/tests/fixtures/parser/ast/pug/each/each01-output.json index 97878e95..b1e7dfb0 100644 --- a/tests/fixtures/parser/ast/pug/each/each01-output.json +++ b/tests/fixtures/parser/ast/pug/each/each01-output.json @@ -481,26 +481,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "pug", - "range": [ - 76, - 79 - ], - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "pug", + "range": [ + 76, + 79 + ], + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 19 } } - ], + }, "range": [ 70, 80 diff --git a/tests/fixtures/parser/ast/pug/each/self-closing-template-output.json b/tests/fixtures/parser/ast/pug/each/self-closing-template-output.json index a41c5103..824ffaf9 100644 --- a/tests/fixtures/parser/ast/pug/each/self-closing-template-output.json +++ b/tests/fixtures/parser/ast/pug/each/self-closing-template-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "./fixtures/template.pug", - "range": [ - 15, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 38 - } + "value": { + "type": "SvelteLiteral", + "value": "./fixtures/template.pug", + "range": [ + 15, + 38 + ], + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 38 } } - ], + }, "range": [ 10, 39 diff --git a/tests/fixtures/parser/ast/reactive-with-var04-ts-output.json b/tests/fixtures/parser/ast/reactive-with-var04-ts-output.json index d23dfd54..5d3e1a4a 100644 --- a/tests/fixtures/parser/ast/reactive-with-var04-ts-output.json +++ b/tests/fixtures/parser/ast/reactive-with-var04-ts-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/sass-output.json b/tests/fixtures/parser/ast/sass-output.json index 21f7e67c..6f5c4b78 100644 --- a/tests/fixtures/parser/ast/sass-output.json +++ b/tests/fixtures/parser/ast/sass-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "sass", - "range": [ - 13, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "sass", + "range": [ + 13, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 } } - ], + }, "range": [ 7, 18 diff --git a/tests/fixtures/parser/ast/script-tag-output.json b/tests/fixtures/parser/ast/script-tag-output.json index 8e67b525..3c1a8721 100644 --- a/tests/fixtures/parser/ast/script-tag-output.json +++ b/tests/fixtures/parser/ast/script-tag-output.json @@ -105,26 +105,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "text/javascript", - "range": [ - 25, - 40 - ], - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 33 - } + "value": { + "type": "SvelteLiteral", + "value": "text/javascript", + "range": [ + 25, + 40 + ], + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 33 } } - ], + }, "range": [ 19, 41 @@ -161,7 +159,7 @@ } }, "boolean": false, - "value": [], + "value": null, "range": [ 42, 47 @@ -198,26 +196,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "/some-script.js", - "range": [ - 53, - 68 - ], - "loc": { - "start": { - "line": 2, - "column": 46 - }, - "end": { - "line": 2, - "column": 61 - } + "value": { + "type": "SvelteLiteral", + "value": "/some-script.js", + "range": [ + 53, + 68 + ], + "loc": { + "start": { + "line": 2, + "column": 46 + }, + "end": { + "line": 2, + "column": 61 } } - ], + }, "range": [ 48, 69 @@ -346,26 +342,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "/style.css", - "range": [ - 96, - 106 - ], - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "/style.css", + "range": [ + 96, + 106 + ], + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 26 } } - ], + }, "range": [ 90, 107 @@ -402,26 +396,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "stylesheet", - "range": [ - 113, - 123 - ], - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 43 - } + "value": { + "type": "SvelteLiteral", + "value": "stylesheet", + "range": [ + 113, + 123 + ], + "loc": { + "start": { + "line": 3, + "column": 33 + }, + "end": { + "line": 3, + "column": 43 } } - ], + }, "range": [ 108, 124 diff --git a/tests/fixtures/parser/ast/self-closing-style01-output.json b/tests/fixtures/parser/ast/self-closing-style01-output.json index 348094db..b98b2846 100644 --- a/tests/fixtures/parser/ast/self-closing-style01-output.json +++ b/tests/fixtures/parser/ast/self-closing-style01-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "./fixtures/style.css", - "range": [ - 12, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 32 - } + "value": { + "type": "SvelteLiteral", + "value": "./fixtures/style.css", + "range": [ + 12, + 32 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 32 } } - ], + }, "range": [ 7, 33 diff --git a/tests/fixtures/parser/ast/style-directive01-output.json b/tests/fixtures/parser/ast/style-directive01-output.json index e86699c9..b9129cf1 100644 --- a/tests/fixtures/parser/ast/style-directive01-output.json +++ b/tests/fixtures/parser/ast/style-directive01-output.json @@ -64,26 +64,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "value", - "range": [ - 21, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "value", + "range": [ + 21, + 26 + ], + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 } } - ], + }, "range": [ 5, 27 @@ -214,26 +212,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "value", - "range": [ - 52, - 57 - ], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "value", + "range": [ + 52, + 57 + ], + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 26 } } - ], + }, "range": [ 36, 58 @@ -364,26 +360,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "value", - "range": [ - 82, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 25 - } + "value": { + "type": "SvelteLiteral", + "value": "value", + "range": [ + 82, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 } } - ], + }, "range": [ 67, 87 @@ -514,26 +508,24 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "red", - "range": [ - 109, - 127 - ], - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 36 - } + "value": { + "type": "SvelteLiteral", + "value": "red", + "range": [ + 109, + 127 + ], + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 36 } } - ], + }, "range": [ 96, 128 diff --git a/tests/fixtures/parser/ast/style-directive02-output.json b/tests/fixtures/parser/ast/style-directive02-output.json index 6f154776..2745cede 100644 --- a/tests/fixtures/parser/ast/style-directive02-output.json +++ b/tests/fixtures/parser/ast/style-directive02-output.json @@ -64,62 +64,79 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "red", - "range": [ - 18, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "variable", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "red", "range": [ - 22, - 30 + 18, + 21 ], "loc": { "start": { "line": 1, - "column": 22 + "column": 18 }, "end": { "line": 1, - "column": 30 + "column": 21 } } }, - "range": [ - 21, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 21 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "variable", + "range": [ + 22, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + } }, - "end": { - "line": 1, - "column": 31 + "range": [ + 21, + 31 + ], + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } } } + ], + "range": [ + 18, + 31 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } } - ], + }, "range": [ 5, 32 @@ -266,62 +283,79 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "red", - "range": [ - 58, - 61 - ], - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 21 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "variable", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "red", "range": [ - 62, - 70 + 58, + 61 ], "loc": { "start": { "line": 2, - "column": 22 + "column": 18 }, "end": { "line": 2, - "column": 30 + "column": 21 } } }, - "range": [ - 61, - 71 - ], - "loc": { - "start": { - "line": 2, - "column": 21 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "variable", + "range": [ + 62, + 70 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + } }, - "end": { - "line": 2, - "column": 31 + "range": [ + 61, + 71 + ], + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 31 + } } } + ], + "range": [ + 58, + 71 + ], + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 31 + } } - ], + }, "range": [ 45, 72 @@ -468,62 +502,79 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "red", - "range": [ - 97, - 100 - ], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 20 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "variable", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "red", "range": [ - 101, - 109 + 97, + 100 ], "loc": { "start": { "line": 3, - "column": 21 + "column": 17 }, "end": { "line": 3, - "column": 29 + "column": 20 } } }, - "range": [ - 100, - 110 - ], - "loc": { - "start": { - "line": 3, - "column": 20 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "variable", + "range": [ + 101, + 109 + ], + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 29 + } + } }, - "end": { - "line": 3, - "column": 30 + "range": [ + 100, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 30 + } } } + ], + "range": [ + 97, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 30 + } } - ], + }, "range": [ 85, 110 @@ -670,109 +721,107 @@ } }, "shorthand": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "Identifier", - "name": "literal", - "range": [ - 147, - 154 - ], - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 36 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "tail": false, - "value": { - "cooked": "template", - "raw": "template" + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "TemplateLiteral", + "expressions": [ + { + "type": "Identifier", + "name": "literal", + "range": [ + 147, + 154 + ], + "loc": { + "start": { + "line": 4, + "column": 29 }, - "range": [ - 136, - 147 - ], - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 29 - } + "end": { + "line": 4, + "column": 36 } + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "tail": false, + "value": { + "cooked": "template", + "raw": "template" }, - { - "type": "TemplateElement", - "tail": true, - "value": { - "cooked": "", - "raw": "" + "range": [ + 136, + 147 + ], + "loc": { + "start": { + "line": 4, + "column": 18 }, - "range": [ - 154, - 156 - ], - "loc": { - "start": { - "line": 4, - "column": 36 - }, - "end": { - "line": 4, - "column": 38 - } + "end": { + "line": 4, + "column": 29 } } - ], - "range": [ - 136, - 156 - ], - "loc": { - "start": { - "line": 4, - "column": 18 + }, + { + "type": "TemplateElement", + "tail": true, + "value": { + "cooked": "", + "raw": "" }, - "end": { - "line": 4, - "column": 38 + "range": [ + 154, + 156 + ], + "loc": { + "start": { + "line": 4, + "column": 36 + }, + "end": { + "line": 4, + "column": 38 + } } } - }, + ], "range": [ - 135, - 157 + 136, + 156 ], "loc": { "start": { "line": 4, - "column": 17 + "column": 18 }, "end": { "line": 4, - "column": 39 + "column": 38 } } + }, + "range": [ + 135, + 157 + ], + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 39 + } } - ], + }, "range": [ 123, 157 diff --git a/tests/fixtures/parser/ast/style-directive03-output.json b/tests/fixtures/parser/ast/style-directive03-output.json index c6c16285..62167d85 100644 --- a/tests/fixtures/parser/ast/style-directive03-output.json +++ b/tests/fixtures/parser/ast/style-directive03-output.json @@ -231,7 +231,7 @@ } }, "shorthand": true, - "value": [], + "value": null, "range": [ 48, 69 diff --git a/tests/fixtures/parser/ast/style-global01-output.json b/tests/fixtures/parser/ast/style-global01-output.json index 904c35f8..97afdfb8 100644 --- a/tests/fixtures/parser/ast/style-global01-output.json +++ b/tests/fixtures/parser/ast/style-global01-output.json @@ -156,7 +156,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 83, 89 diff --git a/tests/fixtures/parser/ast/style-global02-output.json b/tests/fixtures/parser/ast/style-global02-output.json index d8bec93a..4de4819e 100644 --- a/tests/fixtures/parser/ast/style-global02-output.json +++ b/tests/fixtures/parser/ast/style-global02-output.json @@ -230,26 +230,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "scss", - "range": [ - 101, - 105 - ], - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "scss", + "range": [ + 101, + 105 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 17 } } - ], + }, "range": [ 95, 106 @@ -286,7 +284,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 107, 113 diff --git a/tests/fixtures/parser/ast/style02-output.json b/tests/fixtures/parser/ast/style02-output.json index 4aa25712..e7328c65 100644 --- a/tests/fixtures/parser/ast/style02-output.json +++ b/tests/fixtures/parser/ast/style02-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "stylus", - "range": [ - 13, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "stylus", + "range": [ + 13, + 19 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 } } - ], + }, "range": [ 7, 20 diff --git a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-output.json b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-output.json index ca05f181..27acfe4d 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/old-vs-new/05-advanced-component-props-output.json @@ -322,44 +322,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "classname", - "range": [ - 81, - 90 - ], - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "classname", "range": [ - 80, - 91 + 81, + 90 ], "loc": { "start": { "line": 5, - "column": 11 + "column": 12 }, "end": { "line": 5, - "column": 22 + "column": 21 } } + }, + "range": [ + 80, + 91 + ], + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 22 + } } - ], + }, "range": [ 74, 91 diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-output.json index 9ce52f34..5bc2784f 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/08-$props-ts-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-output.json b/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-output.json index 739d2d05..7e21d524 100644 --- a/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-output.json +++ b/tests/fixtures/parser/ast/svelte5/docs/runes/09-how-to-opt-in-output.json @@ -82,45 +82,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "true", - "value": true, - "range": [ - 62, - 66 - ], - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 27 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "true", + "value": true, "range": [ - 61, - 67 + 62, + 66 ], "loc": { "start": { "line": 2, - "column": 22 + "column": 23 }, "end": { "line": 2, - "column": 28 + "column": 27 } } + }, + "range": [ + 61, + 67 + ], + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } } - ], + }, "range": [ 55, 67 diff --git a/tests/fixtures/parser/ast/svelte5/ts-$derived01-output.json b/tests/fixtures/parser/ast/svelte5/ts-$derived01-output.json index 3ae6df96..b5596515 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$derived01-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$derived01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/svelte5/ts-$effect01-output.json b/tests/fixtures/parser/ast/svelte5/ts-$effect01-output.json index 1dc5c511..1a87dd77 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$effect01-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$effect01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-output.json b/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-output.json index 10db2b28..29eb1fe6 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$effectpre01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/svelte5/ts-$props01-output.json b/tests/fixtures/parser/ast/svelte5/ts-$props01-output.json index 286c113b..21c27042 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$props01-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$props01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/svelte5/ts-$state01-output.json b/tests/fixtures/parser/ast/svelte5/ts-$state01-output.json index 82240390..90cdea57 100644 --- a/tests/fixtures/parser/ast/svelte5/ts-$state01-output.json +++ b/tests/fixtures/parser/ast/svelte5/ts-$state01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/template-curly-spacing-test-output.json b/tests/fixtures/parser/ast/template-curly-spacing-test-output.json index 33e4c8db..b4d6b7a4 100644 --- a/tests/fixtures/parser/ast/template-curly-spacing-test-output.json +++ b/tests/fixtures/parser/ast/template-curly-spacing-test-output.json @@ -210,56 +210,21 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "item", - "range": [ - 68, - 72 - ], - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 29 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "level", - "range": [ - 73, - 78 - ], - "loc": { - "start": { - "line": 5, - "column": 30 - }, - "end": { - "line": 5, - "column": 35 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "TemplateLiteral", + "expressions": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "item", "range": [ 68, - 78 + 72 ], "loc": { "start": { @@ -268,88 +233,121 @@ }, "end": { "line": 5, - "column": 35 + "column": 29 } } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "tail": false, - "value": { - "cooked": "bytemd-toc-", - "raw": "bytemd-toc-" - }, + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "level", "range": [ - 54, - 68 + 73, + 78 ], "loc": { "start": { "line": 5, - "column": 11 + "column": 30 }, "end": { "line": 5, - "column": 25 + "column": 35 } } }, - { - "type": "TemplateElement", - "tail": true, - "value": { - "cooked": "", - "raw": "" + "range": [ + 68, + 78 + ], + "loc": { + "start": { + "line": 5, + "column": 25 }, - "range": [ - 78, - 80 - ], - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 37 - } + "end": { + "line": 5, + "column": 35 } } - ], - "range": [ - 54, - 80 - ], - "loc": { - "start": { - "line": 5, - "column": 11 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "tail": false, + "value": { + "cooked": "bytemd-toc-", + "raw": "bytemd-toc-" }, - "end": { - "line": 5, - "column": 37 + "range": [ + 54, + 68 + ], + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 25 + } + } + }, + { + "type": "TemplateElement", + "tail": true, + "value": { + "cooked": "", + "raw": "" + }, + "range": [ + 78, + 80 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 37 + } } } - }, + ], "range": [ - 53, - 81 + 54, + 80 ], "loc": { "start": { "line": 5, - "column": 10 + "column": 11 }, "end": { "line": 5, - "column": 38 + "column": 37 } } + }, + "range": [ + 53, + 81 + ], + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 38 + } } - ], + }, "range": [ 47, 81 diff --git a/tests/fixtures/parser/ast/this-attr01-output.json b/tests/fixtures/parser/ast/this-attr01-output.json index 301337cc..10472004 100644 --- a/tests/fixtures/parser/ast/this-attr01-output.json +++ b/tests/fixtures/parser/ast/this-attr01-output.json @@ -581,44 +581,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "style", - "range": [ - 202, - 207 - ], - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "style", "range": [ - 201, - 208 + 202, + 207 ], "loc": { "start": { "line": 11, - "column": 15 + "column": 16 }, "end": { "line": 11, - "column": 22 + "column": 21 } } + }, + "range": [ + 201, + 208 + ], + "loc": { + "start": { + "line": 11, + "column": 15 + }, + "end": { + "line": 11, + "column": 22 + } } - ], + }, "range": [ 187, 208 diff --git a/tests/fixtures/parser/ast/this-attr02-output.json b/tests/fixtures/parser/ast/this-attr02-output.json index 73079c24..5ff1ae9d 100644 --- a/tests/fixtures/parser/ast/this-attr02-output.json +++ b/tests/fixtures/parser/ast/this-attr02-output.json @@ -528,44 +528,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "style", - "range": [ - 184, - 189 - ], - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "style", "range": [ - 183, - 190 + 184, + 189 ], "loc": { "start": { "line": 10, - "column": 15 + "column": 16 }, "end": { "line": 10, - "column": 22 + "column": 21 } } + }, + "range": [ + 183, + 190 + ], + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 22 + } } - ], + }, "range": [ 169, 190 diff --git a/tests/fixtures/parser/ast/this-attr03-output.json b/tests/fixtures/parser/ast/this-attr03-output.json index 6e75521c..f4b224b9 100644 --- a/tests/fixtures/parser/ast/this-attr03-output.json +++ b/tests/fixtures/parser/ast/this-attr03-output.json @@ -528,44 +528,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "style", - "range": [ - 184, - 189 - ], - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "style", "range": [ - 183, - 190 + 184, + 189 ], "loc": { "start": { "line": 10, - "column": 15 + "column": 16 }, "end": { "line": 10, - "column": 22 + "column": 21 } } + }, + "range": [ + 183, + 190 + ], + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 22 + } } - ], + }, "range": [ 169, 190 diff --git a/tests/fixtures/parser/ast/this-attr04-output.json b/tests/fixtures/parser/ast/this-attr04-output.json index eb18e9af..bad6b3f7 100644 --- a/tests/fixtures/parser/ast/this-attr04-output.json +++ b/tests/fixtures/parser/ast/this-attr04-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 23, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 23, + 26 + ], + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 } } - ], + }, "range": [ 16, 27 @@ -102,26 +100,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "input", - "range": [ - 34, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 39 - } + "value": { + "type": "SvelteLiteral", + "value": "input", + "range": [ + 34, + 39 + ], + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 39 } } - ], + }, "range": [ 28, 40 @@ -158,26 +154,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 47, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 53 } } - ], + }, "range": [ 41, 54 @@ -290,26 +284,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 80, - 83 - ], - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 80, + 83 + ], + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 26 } } - ], + }, "range": [ 73, 84 @@ -400,26 +392,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 106, - 112 - ], - "loc": { - "start": { - "line": 2, - "column": 49 - }, - "end": { - "line": 2, - "column": 55 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 106, + 112 + ], + "loc": { + "start": { + "line": 2, + "column": 49 + }, + "end": { + "line": 2, + "column": 55 } } - ], + }, "range": [ 100, 113 diff --git a/tests/fixtures/parser/ast/this-attr05-output.json b/tests/fixtures/parser/ast/this-attr05-output.json index 308f0730..82cfe22f 100644 --- a/tests/fixtures/parser/ast/this-attr05-output.json +++ b/tests/fixtures/parser/ast/this-attr05-output.json @@ -46,26 +46,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 23, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 23, + 26 + ], + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 } } - ], + }, "range": [ 16, 27 @@ -156,26 +154,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 49, - 55 - ], - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 55 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 49, + 55 + ], + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 55 } } - ], + }, "range": [ 43, 56 @@ -288,26 +284,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 82, - 85 - ], - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 82, + 85 + ], + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 26 } } - ], + }, "range": [ 75, 86 @@ -421,26 +415,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 108, - 114 - ], - "loc": { - "start": { - "line": 2, - "column": 49 - }, - "end": { - "line": 2, - "column": 55 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 108, + 114 + ], + "loc": { + "start": { + "line": 2, + "column": 49 + }, + "end": { + "line": 2, + "column": 55 } } - ], + }, "range": [ 102, 115 diff --git a/tests/fixtures/parser/ast/trailing-comment01-output.json b/tests/fixtures/parser/ast/trailing-comment01-output.json index 3f064d5b..71ab1990 100644 --- a/tests/fixtures/parser/ast/trailing-comment01-output.json +++ b/tests/fixtures/parser/ast/trailing-comment01-output.json @@ -289,26 +289,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 65, - 71 - ], - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 65, + 71 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 19 } } - ], + }, "range": [ 59, 72 diff --git a/tests/fixtures/parser/ast/ts-$$props01-output.json b/tests/fixtures/parser/ast/ts-$$props01-output.json index 958c6abc..cf7040f9 100644 --- a/tests/fixtures/parser/ast/ts-$$props01-output.json +++ b/tests/fixtures/parser/ast/ts-$$props01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-$$slots01-output.json b/tests/fixtures/parser/ast/ts-$$slots01-output.json index 5689b674..4f9163c4 100644 --- a/tests/fixtures/parser/ast/ts-$$slots01-output.json +++ b/tests/fixtures/parser/ast/ts-$$slots01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-$$slots02-no-slot-output.json b/tests/fixtures/parser/ast/ts-$$slots02-no-slot-output.json index 24dbb472..ab932870 100644 --- a/tests/fixtures/parser/ast/ts-$$slots02-no-slot-output.json +++ b/tests/fixtures/parser/ast/ts-$$slots02-no-slot-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-$$slots03-named-output.json b/tests/fixtures/parser/ast/ts-$$slots03-named-output.json index a47054d7..d2948a1a 100644 --- a/tests/fixtures/parser/ast/ts-$$slots03-named-output.json +++ b/tests/fixtures/parser/ast/ts-$$slots03-named-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -229,26 +227,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 54, - 57 - ], - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 54, + 57 + ], + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 15 } } - ], + }, "range": [ 48, 58 diff --git a/tests/fixtures/parser/ast/ts-$$slots04-named-output.json b/tests/fixtures/parser/ast/ts-$$slots04-named-output.json index 270a43df..df0f224c 100644 --- a/tests/fixtures/parser/ast/ts-$$slots04-named-output.json +++ b/tests/fixtures/parser/ast/ts-$$slots04-named-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -229,26 +227,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 54, - 57 - ], - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 54, + 57 + ], + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 15 } } - ], + }, "range": [ 48, 58 @@ -377,26 +373,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "bar", - "range": [ - 79, - 82 - ], - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "bar", + "range": [ + 79, + 82 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 15 } } - ], + }, "range": [ 73, 83 diff --git a/tests/fixtures/parser/ast/ts-await-non-promise01-output.json b/tests/fixtures/parser/ast/ts-await-non-promise01-output.json index 1600d867..147aaf0e 100644 --- a/tests/fixtures/parser/ast/ts-await-non-promise01-output.json +++ b/tests/fixtures/parser/ast/ts-await-non-promise01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-each01-output.json b/tests/fixtures/parser/ast/ts-each01-output.json index 01290af5..6eacfe9b 100644 --- a/tests/fixtures/parser/ast/ts-each01-output.json +++ b/tests/fixtures/parser/ast/ts-each01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-event01-output.json b/tests/fixtures/parser/ast/ts-event01-output.json index 419c27cf..1488b3d7 100644 --- a/tests/fixtures/parser/ast/ts-event01-output.json +++ b/tests/fixtures/parser/ast/ts-event01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-event02-output.json b/tests/fixtures/parser/ast/ts-event02-output.json index e19e0bea..e9f27247 100644 --- a/tests/fixtures/parser/ast/ts-event02-output.json +++ b/tests/fixtures/parser/ast/ts-event02-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "typescript", - "range": [ - 14, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "typescript", + "range": [ + 14, + 24 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 } } - ], + }, "range": [ 8, 25 diff --git a/tests/fixtures/parser/ast/ts-event03-output.json b/tests/fixtures/parser/ast/ts-event03-output.json index dbd1d8f4..6b6049ea 100644 --- a/tests/fixtures/parser/ast/ts-event03-output.json +++ b/tests/fixtures/parser/ast/ts-event03-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-event04-output.json b/tests/fixtures/parser/ast/ts-event04-output.json index 3f9ce536..ac186120 100644 --- a/tests/fixtures/parser/ast/ts-event04-output.json +++ b/tests/fixtures/parser/ast/ts-event04-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-event05-output.json b/tests/fixtures/parser/ast/ts-event05-output.json index 9a13d315..c97147c3 100644 --- a/tests/fixtures/parser/ast/ts-event05-output.json +++ b/tests/fixtures/parser/ast/ts-event05-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-event06-output.json b/tests/fixtures/parser/ast/ts-event06-output.json index ca339e8c..3bbb97f3 100644 --- a/tests/fixtures/parser/ast/ts-event06-output.json +++ b/tests/fixtures/parser/ast/ts-event06-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-issue226-output.json b/tests/fixtures/parser/ast/ts-issue226-output.json index 918e5895..163bb1ba 100644 --- a/tests/fixtures/parser/ast/ts-issue226-output.json +++ b/tests/fixtures/parser/ast/ts-issue226-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -1719,26 +1717,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "text", - "range": [ - 403, - 407 - ], - "loc": { - "start": { - "line": 15, - "column": 13 - }, - "end": { - "line": 15, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "text", + "range": [ + 403, + 407 + ], + "loc": { + "start": { + "line": 15, + "column": 13 + }, + "end": { + "line": 15, + "column": 17 } } - ], + }, "range": [ 397, 408 diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-output.json b/tests/fixtures/parser/ast/ts-let/ts-let01-output.json index 9ef12230..7affdbb5 100644 --- a/tests/fixtures/parser/ast/ts-let/ts-let01-output.json +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -1753,26 +1751,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "count", - "range": [ - 561, - 566 - ], - "loc": { - "start": { - "line": 30, - "column": 16 - }, - "end": { - "line": 30, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "count", + "range": [ + 561, + 566 + ], + "loc": { + "start": { + "line": 30, + "column": 16 + }, + "end": { + "line": 30, + "column": 21 } } - ], + }, "range": [ 555, 567 diff --git a/tests/fixtures/parser/ast/ts-let/ts-let01-scope-output.json b/tests/fixtures/parser/ast/ts-let/ts-let01-scope-output.json index 85cf239b..e04ae728 100644 --- a/tests/fixtures/parser/ast/ts-let/ts-let01-scope-output.json +++ b/tests/fixtures/parser/ast/ts-let/ts-let01-scope-output.json @@ -3110,26 +3110,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "count", - "range": [ - 561, - 566 - ], - "loc": { - "start": { - "line": 30, - "column": 16 - }, - "end": { - "line": 30, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "count", + "range": [ + 561, + 566 + ], + "loc": { + "start": { + "line": 30, + "column": 16 + }, + "end": { + "line": 30, + "column": 21 } } - ], + }, "range": [ 555, 567 diff --git a/tests/fixtures/parser/ast/ts-newline-output.json b/tests/fixtures/parser/ast/ts-newline-output.json index 50eb925b..218623fd 100644 --- a/tests/fixtures/parser/ast/ts-newline-output.json +++ b/tests/fixtures/parser/ast/ts-newline-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-not-reactive01-output.json b/tests/fixtures/parser/ast/ts-not-reactive01-output.json index 3085e69f..0608ea1d 100644 --- a/tests/fixtures/parser/ast/ts-not-reactive01-output.json +++ b/tests/fixtures/parser/ast/ts-not-reactive01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-promise01-output.json b/tests/fixtures/parser/ast/ts-promise01-output.json index 107f6348..84f91f5f 100644 --- a/tests/fixtures/parser/ast/ts-promise01-output.json +++ b/tests/fixtures/parser/ast/ts-promise01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -1049,26 +1047,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 216, - 226 - ], - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 216, + 226 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 21 } } - ], + }, "range": [ 209, 227 diff --git a/tests/fixtures/parser/ast/ts-promise01-scope-output.json b/tests/fixtures/parser/ast/ts-promise01-scope-output.json index 5c2dda73..60a3d2e3 100644 --- a/tests/fixtures/parser/ast/ts-promise01-scope-output.json +++ b/tests/fixtures/parser/ast/ts-promise01-scope-output.json @@ -2758,26 +2758,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 216, - 226 - ], - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 216, + 226 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 21 } } - ], + }, "range": [ 209, 227 diff --git a/tests/fixtures/parser/ast/ts-promise02-output.json b/tests/fixtures/parser/ast/ts-promise02-output.json index b4378f1f..71e59b8e 100644 --- a/tests/fixtures/parser/ast/ts-promise02-output.json +++ b/tests/fixtures/parser/ast/ts-promise02-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -679,26 +677,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 149, - 159 - ], - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 149, + 159 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 21 } } - ], + }, "range": [ 142, 160 @@ -1554,26 +1550,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 339, - 349 - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 339, + 349 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 22 } } - ], + }, "range": [ 332, 350 @@ -2083,26 +2077,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 453, - 463 - ], - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 453, + 463 + ], + "loc": { + "start": { + "line": 24, + "column": 11 + }, + "end": { + "line": 24, + "column": 21 } } - ], + }, "range": [ 446, 464 @@ -2840,26 +2832,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 608, - 618 - ], - "loc": { - "start": { - "line": 32, - "column": 11 - }, - "end": { - "line": 32, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 608, + 618 + ], + "loc": { + "start": { + "line": 32, + "column": 11 + }, + "end": { + "line": 32, + "column": 21 } } - ], + }, "range": [ 601, 619 @@ -3597,26 +3587,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 769, - 779 - ], - "loc": { - "start": { - "line": 40, - "column": 11 - }, - "end": { - "line": 40, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 769, + 779 + ], + "loc": { + "start": { + "line": 40, + "column": 11 + }, + "end": { + "line": 40, + "column": 21 } } - ], + }, "range": [ 762, 780 @@ -4354,26 +4342,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 930, - 940 - ], - "loc": { - "start": { - "line": 48, - "column": 11 - }, - "end": { - "line": 48, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 930, + 940 + ], + "loc": { + "start": { + "line": 48, + "column": 11 + }, + "end": { + "line": 48, + "column": 21 } } - ], + }, "range": [ 923, 941 @@ -5111,26 +5097,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 1091, - 1101 - ], - "loc": { - "start": { - "line": 56, - "column": 11 - }, - "end": { - "line": 56, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 1091, + 1101 + ], + "loc": { + "start": { + "line": 56, + "column": 11 + }, + "end": { + "line": 56, + "column": 21 } } - ], + }, "range": [ 1084, 1102 @@ -5868,26 +5852,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 1252, - 1262 - ], - "loc": { - "start": { - "line": 64, - "column": 11 - }, - "end": { - "line": 64, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 1252, + 1262 + ], + "loc": { + "start": { + "line": 64, + "column": 11 + }, + "end": { + "line": 64, + "column": 21 } } - ], + }, "range": [ 1245, 1263 diff --git a/tests/fixtures/parser/ast/ts-promise02-scope-output.json b/tests/fixtures/parser/ast/ts-promise02-scope-output.json index 5c38953b..771dcc09 100644 --- a/tests/fixtures/parser/ast/ts-promise02-scope-output.json +++ b/tests/fixtures/parser/ast/ts-promise02-scope-output.json @@ -666,26 +666,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 149, - 159 - ], - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 149, + 159 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 21 } } - ], + }, "range": [ 142, 160 @@ -1456,26 +1454,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 339, - 349 - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 339, + 349 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 22 } } - ], + }, "range": [ 332, 350 @@ -2237,26 +2233,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 453, - 463 - ], - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 453, + 463 + ], + "loc": { + "start": { + "line": 24, + "column": 11 + }, + "end": { + "line": 24, + "column": 21 } } - ], + }, "range": [ 446, 464 @@ -2998,26 +2992,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 608, - 618 - ], - "loc": { - "start": { - "line": 32, - "column": 11 - }, - "end": { - "line": 32, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 608, + 618 + ], + "loc": { + "start": { + "line": 32, + "column": 11 + }, + "end": { + "line": 32, + "column": 21 } } - ], + }, "range": [ 601, 619 @@ -3759,26 +3751,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 769, - 779 - ], - "loc": { - "start": { - "line": 40, - "column": 11 - }, - "end": { - "line": 40, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 769, + 779 + ], + "loc": { + "start": { + "line": 40, + "column": 11 + }, + "end": { + "line": 40, + "column": 21 } } - ], + }, "range": [ 762, 780 @@ -4520,26 +4510,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 930, - 940 - ], - "loc": { - "start": { - "line": 48, - "column": 11 - }, - "end": { - "line": 48, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 930, + 940 + ], + "loc": { + "start": { + "line": 48, + "column": 11 + }, + "end": { + "line": 48, + "column": 21 } } - ], + }, "range": [ 923, 941 @@ -5281,26 +5269,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 1091, - 1101 - ], - "loc": { - "start": { - "line": 56, - "column": 11 - }, - "end": { - "line": 56, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 1091, + 1101 + ], + "loc": { + "start": { + "line": 56, + "column": 11 + }, + "end": { + "line": 56, + "column": 21 } } - ], + }, "range": [ 1084, 1102 @@ -6042,26 +6028,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 1252, - 1262 - ], - "loc": { - "start": { - "line": 64, - "column": 11 - }, - "end": { - "line": 64, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 1252, + 1262 + ], + "loc": { + "start": { + "line": 64, + "column": 11 + }, + "end": { + "line": 64, + "column": 21 } } - ], + }, "range": [ 1245, 1263 diff --git a/tests/fixtures/parser/ast/ts-reactive01-output.json b/tests/fixtures/parser/ast/ts-reactive01-output.json index e429ef1e..b3da20d6 100644 --- a/tests/fixtures/parser/ast/ts-reactive01-output.json +++ b/tests/fixtures/parser/ast/ts-reactive01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -682,44 +680,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "z", - "range": [ - 144, - 145 - ], - "loc": { - "start": { - "line": 10, - "column": 14 - }, - "end": { - "line": 10, - "column": 15 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "z", "range": [ - 143, - 146 + 144, + 145 ], "loc": { "start": { "line": 10, - "column": 13 + "column": 14 }, "end": { "line": 10, - "column": 16 + "column": 15 } } + }, + "range": [ + 143, + 146 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 16 + } } - ], + }, "range": [ 137, 146 diff --git a/tests/fixtures/parser/ast/ts-reactive02-output.json b/tests/fixtures/parser/ast/ts-reactive02-output.json index 117e4f76..27f64fd2 100644 --- a/tests/fixtures/parser/ast/ts-reactive02-output.json +++ b/tests/fixtures/parser/ast/ts-reactive02-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -999,44 +997,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "z", - "range": [ - 225, - 226 - ], - "loc": { - "start": { - "line": 14, - "column": 14 - }, - "end": { - "line": 14, - "column": 15 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "z", "range": [ - 224, - 227 + 225, + 226 ], "loc": { "start": { "line": 14, - "column": 13 + "column": 14 }, "end": { "line": 14, - "column": 16 + "column": 15 } } + }, + "range": [ + 224, + 227 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 16 + } } - ], + }, "range": [ 218, 227 diff --git a/tests/fixtures/parser/ast/ts-reactive03-output.json b/tests/fixtures/parser/ast/ts-reactive03-output.json index 506de01b..879c4565 100644 --- a/tests/fixtures/parser/ast/ts-reactive03-output.json +++ b/tests/fixtures/parser/ast/ts-reactive03-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-reactive04-output.json b/tests/fixtures/parser/ast/ts-reactive04-output.json index e6bf28d9..2fea60e6 100644 --- a/tests/fixtures/parser/ast/ts-reactive04-output.json +++ b/tests/fixtures/parser/ast/ts-reactive04-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-reactive05-output.json b/tests/fixtures/parser/ast/ts-reactive05-output.json index 6841d30e..cd2e493e 100644 --- a/tests/fixtures/parser/ast/ts-reactive05-output.json +++ b/tests/fixtures/parser/ast/ts-reactive05-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-reactive06-output.json b/tests/fixtures/parser/ast/ts-reactive06-output.json index add071a9..cdb840f7 100644 --- a/tests/fixtures/parser/ast/ts-reactive06-output.json +++ b/tests/fixtures/parser/ast/ts-reactive06-output.json @@ -63,26 +63,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 15, - 17 - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 15, + 17 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 } } - ], + }, "range": [ 9, 18 diff --git a/tests/fixtures/parser/ast/ts-scope-issue01-output.json b/tests/fixtures/parser/ast/ts-scope-issue01-output.json index c2d2e9bd..4c65c333 100644 --- a/tests/fixtures/parser/ast/ts-scope-issue01-output.json +++ b/tests/fixtures/parser/ast/ts-scope-issue01-output.json @@ -81,26 +81,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 88, - 90 - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 88, + 90 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 } } - ], + }, "range": [ 82, 91 diff --git a/tests/fixtures/parser/ast/ts-shorthand-attr01-output.json b/tests/fixtures/parser/ast/ts-shorthand-attr01-output.json index 654c5d3c..881c6e12 100644 --- a/tests/fixtures/parser/ast/ts-shorthand-attr01-output.json +++ b/tests/fixtures/parser/ast/ts-shorthand-attr01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 @@ -268,44 +266,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "src", - "range": [ - 62, - 65 - ], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 13 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "src", "range": [ - 61, - 66 + 62, + 65 ], "loc": { "start": { "line": 5, - "column": 9 + "column": 10 }, "end": { "line": 5, - "column": 14 + "column": 13 } } + }, + "range": [ + 61, + 66 + ], + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 14 + } } - ], + }, "range": [ 57, 66 @@ -342,26 +338,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 72, - 75 - ], - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 72, + 75 + ], + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 23 } } - ], + }, "range": [ 67, 76 @@ -527,26 +521,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foo", - "range": [ - 94, - 97 - ], - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "foo", + "range": [ + 94, + 97 + ], + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 19 } } - ], + }, "range": [ 89, 98 diff --git a/tests/fixtures/parser/ast/ts-store01-output.json b/tests/fixtures/parser/ast/ts-store01-output.json index 325c8e68..07b0e9a4 100644 --- a/tests/fixtures/parser/ast/ts-store01-output.json +++ b/tests/fixtures/parser/ast/ts-store01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-store02-output.json b/tests/fixtures/parser/ast/ts-store02-output.json index a7fd4c4f..b5e4b172 100644 --- a/tests/fixtures/parser/ast/ts-store02-output.json +++ b/tests/fixtures/parser/ast/ts-store02-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "module", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "module", + "range": [ + 17, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 } } - ], + }, "range": [ 8, 24 @@ -101,26 +99,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 31, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 31, + 33 + ], + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 } } - ], + }, "range": [ 25, 34 @@ -545,26 +541,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 151, - 153 - ], - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 151, + 153 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 16 } } - ], + }, "range": [ 145, 154 diff --git a/tests/fixtures/parser/ast/ts-store03-output.json b/tests/fixtures/parser/ast/ts-store03-output.json index f5c30d10..0b486801 100644 --- a/tests/fixtures/parser/ast/ts-store03-output.json +++ b/tests/fixtures/parser/ast/ts-store03-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/ts-use01-output.json b/tests/fixtures/parser/ast/ts-use01-output.json index 965bef68..a6215e9a 100644 --- a/tests/fixtures/parser/ast/ts-use01-output.json +++ b/tests/fixtures/parser/ast/ts-use01-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 } } - ], + }, "range": [ 8, 17 diff --git a/tests/fixtures/parser/ast/tutorial/actions-output.json b/tests/fixtures/parser/ast/tutorial/actions-output.json index 0f0f219c..4c6067ef 100644 --- a/tests/fixtures/parser/ast/tutorial/actions-output.json +++ b/tests/fixtures/parser/ast/tutorial/actions-output.json @@ -2190,26 +2190,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "box", - "range": [ - 808, - 811 - ], - "loc": { - "start": { - "line": 43, - "column": 12 - }, - "end": { - "line": 43, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "box", + "range": [ + 808, + 811 + ], + "loc": { + "start": { + "line": 43, + "column": 12 + }, + "end": { + "line": 43, + "column": 15 } } - ], + }, "range": [ 801, 812 @@ -2517,61 +2515,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "transform:\n\t\ttranslate(", - "range": [ - 919, - 942 - ], - "loc": { - "start": { - "line": 48, - "column": 8 - }, - "end": { - "line": 49, - "column": 12 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "transform:\n\t\ttranslate(", + "range": [ + 919, + 942 + ], + "loc": { + "start": { + "line": 48, + "column": 8 + }, + "end": { + "line": 49, + "column": 12 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "$coords", - "range": [ - 943, - 950 - ], - "loc": { - "start": { - "line": 49, - "column": 13 - }, - "end": { - "line": 49, - "column": 20 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$coords", + "range": [ + 943, + 950 + ], + "loc": { + "start": { + "line": 49, + "column": 13 + }, + "end": { + "line": 49, + "column": 20 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "x", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "x", + "range": [ + 951, + 952 + ], + "loc": { + "start": { + "line": 49, + "column": 21 + }, + "end": { + "line": 49, + "column": 22 + } + } + }, "range": [ - 951, + 943, 952 ], "loc": { "start": { "line": 49, - "column": 21 + "column": 13 }, "end": { "line": 49, @@ -2580,89 +2595,89 @@ } }, "range": [ - 943, - 952 + 942, + 953 ], "loc": { "start": { "line": 49, - "column": 13 + "column": 12 }, "end": { "line": 49, - "column": 22 + "column": 23 } } }, - "range": [ - 942, - 953 - ], - "loc": { - "start": { - "line": 49, - "column": 12 - }, - "end": { - "line": 49, - "column": 23 - } - } - }, - { - "type": "SvelteLiteral", - "value": "px,", - "range": [ - 953, - 956 - ], - "loc": { - "start": { - "line": 49, - "column": 23 - }, - "end": { - "line": 49, - "column": 26 + { + "type": "SvelteLiteral", + "value": "px,", + "range": [ + 953, + 956 + ], + "loc": { + "start": { + "line": 49, + "column": 23 + }, + "end": { + "line": 49, + "column": 26 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "$coords", - "range": [ - 957, - 964 - ], - "loc": { - "start": { - "line": 49, - "column": 27 - }, - "end": { - "line": 49, - "column": 34 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$coords", + "range": [ + 957, + 964 + ], + "loc": { + "start": { + "line": 49, + "column": 27 + }, + "end": { + "line": 49, + "column": 34 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "y", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "y", + "range": [ + 965, + 966 + ], + "loc": { + "start": { + "line": 49, + "column": 35 + }, + "end": { + "line": 49, + "column": 36 + } + } + }, "range": [ - 965, + 957, 966 ], "loc": { "start": { "line": 49, - "column": 35 + "column": 27 }, "end": { "line": 49, @@ -2671,67 +2686,86 @@ } }, "range": [ - 957, - 966 + 956, + 967 ], "loc": { "start": { "line": 49, - "column": 27 + "column": 26 }, "end": { "line": 49, - "column": 36 + "column": 37 } } }, - "range": [ - 956, - 967 - ], - "loc": { - "start": { - "line": 49, - "column": 26 - }, - "end": { - "line": 49, - "column": 37 - } - } - }, - { - "type": "SvelteLiteral", - "value": "px)\n\t\trotate(", - "range": [ - 967, - 980 - ], - "loc": { - "start": { - "line": 49, - "column": 37 - }, - "end": { - "line": 50, - "column": 9 + { + "type": "SvelteLiteral", + "value": "px)\n\t\trotate(", + "range": [ + 967, + 980 + ], + "loc": { + "start": { + "line": 49, + "column": 37 + }, + "end": { + "line": 50, + "column": 9 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "$coords", + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "BinaryExpression", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$coords", + "range": [ + 981, + 988 + ], + "loc": { + "start": { + "line": 50, + "column": 10 + }, + "end": { + "line": 50, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "x", + "range": [ + 989, + 990 + ], + "loc": { + "start": { + "line": 50, + "column": 18 + }, + "end": { + "line": 50, + "column": 19 + } + } + }, "range": [ 981, - 988 + 990 ], "loc": { "start": { @@ -2740,57 +2774,38 @@ }, "end": { "line": 50, - "column": 17 + "column": 19 } } }, - "optional": false, - "property": { - "type": "Identifier", - "name": "x", + "operator": "*", + "right": { + "type": "Literal", + "raw": "0.2", + "value": 0.2, "range": [ - 989, - 990 + 993, + 996 ], "loc": { "start": { "line": 50, - "column": 18 + "column": 22 }, "end": { "line": 50, - "column": 19 + "column": 25 } } }, "range": [ 981, - 990 - ], - "loc": { - "start": { - "line": 50, - "column": 10 - }, - "end": { - "line": 50, - "column": 19 - } - } - }, - "operator": "*", - "right": { - "type": "Literal", - "raw": "0.2", - "value": 0.2, - "range": [ - 993, 996 ], "loc": { "start": { "line": 50, - "column": 22 + "column": 10 }, "end": { "line": 50, @@ -2799,54 +2814,54 @@ } }, "range": [ - 981, - 996 + 980, + 997 ], "loc": { "start": { "line": 50, - "column": 10 + "column": 9 }, "end": { "line": 50, - "column": 25 + "column": 26 } } }, - "range": [ - 980, - 997 - ], - "loc": { - "start": { - "line": 50, - "column": 9 - }, - "end": { - "line": 50, - "column": 26 + { + "type": "SvelteLiteral", + "value": "deg)", + "range": [ + 997, + 1001 + ], + "loc": { + "start": { + "line": 50, + "column": 26 + }, + "end": { + "line": 50, + "column": 30 + } } } - }, - { - "type": "SvelteLiteral", - "value": "deg)", - "range": [ - 997, - 1001 - ], - "loc": { - "start": { - "line": 50, - "column": 26 - }, - "end": { - "line": 50, - "column": 30 - } + ], + "range": [ + 919, + 1001 + ], + "loc": { + "start": { + "line": 48, + "column": 8 + }, + "end": { + "line": 50, + "column": 30 } } - ], + }, "range": [ 912, 1002 diff --git a/tests/fixtures/parser/ast/tutorial/adding-parameters-to-actions-output.json b/tests/fixtures/parser/ast/tutorial/adding-parameters-to-actions-output.json index 969c07d0..e63adef9 100644 --- a/tests/fixtures/parser/ast/tutorial/adding-parameters-to-actions-output.json +++ b/tests/fixtures/parser/ast/tutorial/adding-parameters-to-actions-output.json @@ -435,26 +435,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 131, - 136 - ], - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 131, + 136 + ], + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 18 } } - ], + }, "range": [ 126, 136 @@ -564,45 +562,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "2000", - "value": 2000, - "range": [ - 164, - 168 - ], - "loc": { - "start": { - "line": 9, - "column": 46 - }, - "end": { - "line": 9, - "column": 50 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "2000", + "value": 2000, "range": [ - 163, - 169 + 164, + 168 ], "loc": { "start": { "line": 9, - "column": 45 + "column": 46 }, "end": { "line": 9, - "column": 51 + "column": 50 } } + }, + "range": [ + 163, + 169 + ], + "loc": { + "start": { + "line": 9, + "column": 45 + }, + "end": { + "line": 9, + "column": 51 + } } - ], + }, "range": [ 159, 169 @@ -639,45 +635,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "100", - "value": 100, - "range": [ - 176, - 179 - ], - "loc": { - "start": { - "line": 9, - "column": 58 - }, - "end": { - "line": 9, - "column": 61 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "100", + "value": 100, "range": [ - 175, - 180 + 176, + 179 ], "loc": { "start": { "line": 9, - "column": 57 + "column": 58 }, "end": { "line": 9, - "column": 62 + "column": 61 } } + }, + "range": [ + 175, + 180 + ], + "loc": { + "start": { + "line": 9, + "column": 57 + }, + "end": { + "line": 9, + "column": 62 + } } - ], + }, "range": [ 170, 180 diff --git a/tests/fixtures/parser/ast/tutorial/adding-parameters-to-transitions-output.json b/tests/fixtures/parser/ast/tutorial/adding-parameters-to-transitions-output.json index 0c7dc73a..f022270e 100644 --- a/tests/fixtures/parser/ast/tutorial/adding-parameters-to-transitions-output.json +++ b/tests/fixtures/parser/ast/tutorial/adding-parameters-to-transitions-output.json @@ -361,26 +361,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 105, - 113 - ], - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 105, + 113 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 22 } } - ], + }, "range": [ 99, 114 diff --git a/tests/fixtures/parser/ast/tutorial/animate-output.json b/tests/fixtures/parser/ast/tutorial/animate-output.json index 3c7746f0..fea8de5c 100644 --- a/tests/fixtures/parser/ast/tutorial/animate-output.json +++ b/tests/fixtures/parser/ast/tutorial/animate-output.json @@ -4378,26 +4378,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "board", - "range": [ - 1264, - 1269 - ], - "loc": { - "start": { - "line": 57, - "column": 12 - }, - "end": { - "line": 57, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "board", + "range": [ + 1264, + 1269 + ], + "loc": { + "start": { + "line": 57, + "column": 12 + }, + "end": { + "line": 57, + "column": 17 } } - ], + }, "range": [ 1257, 1270 @@ -4494,26 +4492,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "what needs to be done?", - "range": [ - 1295, - 1317 - ], - "loc": { - "start": { - "line": 59, - "column": 15 - }, - "end": { - "line": 59, - "column": 37 - } + "value": { + "type": "SvelteLiteral", + "value": "what needs to be done?", + "range": [ + 1295, + 1317 + ], + "loc": { + "start": { + "line": 59, + "column": 15 + }, + "end": { + "line": 59, + "column": 37 } } - ], + }, "range": [ 1282, 1318 @@ -4924,26 +4920,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "left", - "range": [ - 1391, - 1395 - ], - "loc": { - "start": { - "line": 63, - "column": 13 - }, - "end": { - "line": 63, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "left", + "range": [ + 1391, + 1395 + ], + "loc": { + "start": { + "line": 63, + "column": 13 + }, + "end": { + "line": 63, + "column": 17 } } - ], + }, "range": [ 1384, 1396 @@ -5870,26 +5864,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1583, - 1591 - ], - "loc": { - "start": { - "line": 71, - "column": 16 - }, - "end": { - "line": 71, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1583, + 1591 + ], + "loc": { + "start": { + "line": 71, + "column": 16 + }, + "end": { + "line": 71, + "column": 24 } } - ], + }, "range": [ 1578, 1591 @@ -6606,26 +6598,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "right", - "range": [ - 1755, - 1760 - ], - "loc": { - "start": { - "line": 78, - "column": 13 - }, - "end": { - "line": 78, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "right", + "range": [ + 1755, + 1760 + ], + "loc": { + "start": { + "line": 78, + "column": 13 + }, + "end": { + "line": 78, + "column": 18 } } - ], + }, "range": [ 1748, 1761 @@ -7080,26 +7070,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "done", - "range": [ - 1854, - 1858 - ], - "loc": { - "start": { - "line": 82, - "column": 11 - }, - "end": { - "line": 82, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "done", + "range": [ + 1854, + 1858 + ], + "loc": { + "start": { + "line": 82, + "column": 11 + }, + "end": { + "line": 82, + "column": 15 } } - ], + }, "range": [ 1847, 1859 @@ -7665,26 +7653,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1984, - 1992 - ], - "loc": { - "start": { - "line": 87, - "column": 16 - }, - "end": { - "line": 87, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1984, + 1992 + ], + "loc": { + "start": { + "line": 87, + "column": 16 + }, + "end": { + "line": 87, + "column": 24 } } - ], + }, "range": [ 1979, 1992 @@ -7721,7 +7707,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 1993, 2000 diff --git a/tests/fixtures/parser/ast/tutorial/animate-scope-output.json b/tests/fixtures/parser/ast/tutorial/animate-scope-output.json index 4c6db18a..79dfcff2 100644 --- a/tests/fixtures/parser/ast/tutorial/animate-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/animate-scope-output.json @@ -16763,26 +16763,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1583, - 1591 - ], - "loc": { - "start": { - "line": 71, - "column": 16 - }, - "end": { - "line": 71, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1583, + 1591 + ], + "loc": { + "start": { + "line": 71, + "column": 16 + }, + "end": { + "line": 71, + "column": 24 } } - ], + }, "range": [ 1578, 1591 @@ -19028,26 +19026,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "done", - "range": [ - 1854, - 1858 - ], - "loc": { - "start": { - "line": 82, - "column": 11 - }, - "end": { - "line": 82, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "done", + "range": [ + 1854, + 1858 + ], + "loc": { + "start": { + "line": 82, + "column": 11 + }, + "end": { + "line": 82, + "column": 15 } } - ], + }, "range": [ 1847, 1859 @@ -19613,26 +19609,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1984, - 1992 - ], - "loc": { - "start": { - "line": 87, - "column": 16 - }, - "end": { - "line": 87, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1984, + 1992 + ], + "loc": { + "start": { + "line": 87, + "column": 16 + }, + "end": { + "line": 87, + "column": 24 } } - ], + }, "range": [ 1979, 1992 @@ -19669,7 +19663,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 1993, 2000 diff --git a/tests/fixtures/parser/ast/tutorial/await-blocks-output.json b/tests/fixtures/parser/ast/tutorial/await-blocks-output.json index 554500be..82f05aa9 100644 --- a/tests/fixtures/parser/ast/tutorial/await-blocks-output.json +++ b/tests/fixtures/parser/ast/tutorial/await-blocks-output.json @@ -1579,26 +1579,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 520, - 530 - ], - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 30, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 520, + 530 + ], + "loc": { + "start": { + "line": 30, + "column": 11 + }, + "end": { + "line": 30, + "column": 21 } } - ], + }, "range": [ 513, 531 @@ -2171,26 +2169,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 669, - 679 - ], - "loc": { - "start": { - "line": 38, - "column": 11 - }, - "end": { - "line": 38, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 669, + 679 + ], + "loc": { + "start": { + "line": 38, + "column": 11 + }, + "end": { + "line": 38, + "column": 21 } } - ], + }, "range": [ 662, 680 @@ -2706,26 +2702,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 794, - 804 - ], - "loc": { - "start": { - "line": 44, - "column": 11 - }, - "end": { - "line": 44, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 794, + 804 + ], + "loc": { + "start": { + "line": 44, + "column": 11 + }, + "end": { + "line": 44, + "column": 21 } } - ], + }, "range": [ 787, 805 diff --git a/tests/fixtures/parser/ast/tutorial/await-blocks-scope-output.json b/tests/fixtures/parser/ast/tutorial/await-blocks-scope-output.json index f49f0151..28e3bd70 100644 --- a/tests/fixtures/parser/ast/tutorial/await-blocks-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/await-blocks-scope-output.json @@ -3323,26 +3323,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 520, - 530 - ], - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 30, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 520, + 530 + ], + "loc": { + "start": { + "line": 30, + "column": 11 + }, + "end": { + "line": 30, + "column": 21 } } - ], + }, "range": [ 513, 531 @@ -4077,26 +4075,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 669, - 679 - ], - "loc": { - "start": { - "line": 38, - "column": 11 - }, - "end": { - "line": 38, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 669, + 679 + ], + "loc": { + "start": { + "line": 38, + "column": 11 + }, + "end": { + "line": 38, + "column": 21 } } - ], + }, "range": [ 662, 680 @@ -4831,26 +4827,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: red", - "range": [ - 794, - 804 - ], - "loc": { - "start": { - "line": 44, - "column": 11 - }, - "end": { - "line": 44, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "color: red", + "range": [ + 794, + 804 + ], + "loc": { + "start": { + "line": 44, + "column": 11 + }, + "end": { + "line": 44, + "column": 21 } } - ], + }, "range": [ 787, 805 diff --git a/tests/fixtures/parser/ast/tutorial/bind-this-output.json b/tests/fixtures/parser/ast/tutorial/bind-this-output.json index 5352df53..cae2046b 100644 --- a/tests/fixtures/parser/ast/tutorial/bind-this-output.json +++ b/tests/fixtures/parser/ast/tutorial/bind-this-output.json @@ -3910,45 +3910,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "32", - "value": 32, - "range": [ - 1095, - 1097 - ], - "loc": { - "start": { - "line": 51, - "column": 8 - }, - "end": { - "line": 51, - "column": 10 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "32", + "value": 32, "range": [ - 1094, - 1098 + 1095, + 1097 ], "loc": { "start": { "line": 51, - "column": 7 + "column": 8 }, "end": { "line": 51, - "column": 11 + "column": 10 } } + }, + "range": [ + 1094, + 1098 + ], + "loc": { + "start": { + "line": 51, + "column": 7 + }, + "end": { + "line": 51, + "column": 11 + } } - ], + }, "range": [ 1088, 1098 @@ -3985,45 +3983,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "32", - "value": 32, - "range": [ - 1108, - 1110 - ], - "loc": { - "start": { - "line": 52, - "column": 9 - }, - "end": { - "line": 52, - "column": 11 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "32", + "value": 32, "range": [ - 1107, - 1111 + 1108, + 1110 ], "loc": { "start": { "line": 52, - "column": 8 + "column": 9 }, "end": { "line": 52, - "column": 12 + "column": 11 } } + }, + "range": [ + 1107, + 1111 + ], + "loc": { + "start": { + "line": 52, + "column": 8 + }, + "end": { + "line": 52, + "column": 12 + } } - ], + }, "range": [ 1100, 1111 diff --git a/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json b/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json index 4f8c10c2..03d1aec1 100644 --- a/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json +++ b/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json @@ -270,26 +270,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 59, - 67 - ], - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 59, + 67 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 21 } } - ], + }, "range": [ 54, 67 @@ -786,40 +784,22 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Identifier", - "name": "yes", - "range": [ - 332, - 335 - ], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "operator": "!", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Identifier", + "name": "yes", "range": [ - 331, + 332, 335 ], "loc": { "start": { "line": 16, - "column": 18 + "column": 19 }, "end": { "line": 16, @@ -827,22 +807,38 @@ } } }, + "operator": "!", + "prefix": true, "range": [ - 330, - 336 + 331, + 335 ], "loc": { "start": { "line": 16, - "column": 17 + "column": 18 }, "end": { "line": 16, - "column": 23 + "column": 22 } } + }, + "range": [ + 330, + 336 + ], + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 23 + } } - ], + }, "range": [ 321, 336 diff --git a/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json b/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json index f5a8d8d3..f32036a7 100644 --- a/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json +++ b/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json @@ -379,26 +379,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 106, - 114 - ], - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 106, + 114 + ], + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 21 } } - ], + }, "range": [ 101, 114 diff --git a/tests/fixtures/parser/ast/tutorial/classes-output.json b/tests/fixtures/parser/ast/tutorial/classes-output.json index d82eb9c0..8b82daca 100644 --- a/tests/fixtures/parser/ast/tutorial/classes-output.json +++ b/tests/fixtures/parser/ast/tutorial/classes-output.json @@ -1024,98 +1024,82 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "ConditionalExpression", - "alternate": { - "type": "Literal", - "raw": "''", - "value": "", - "range": [ - 397, - 399 - ], - "loc": { - "start": { - "line": 27, - "column": 42 - }, - "end": { - "line": 27, - "column": 44 - } + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "ConditionalExpression", + "alternate": { + "type": "Literal", + "raw": "''", + "value": "", + "range": [ + 397, + 399 + ], + "loc": { + "start": { + "line": 27, + "column": 42 + }, + "end": { + "line": 27, + "column": 44 } - }, - "consequent": { - "type": "Literal", - "raw": "'selected'", - "value": "selected", + } + }, + "consequent": { + "type": "Literal", + "raw": "'selected'", + "value": "selected", + "range": [ + 384, + 394 + ], + "loc": { + "start": { + "line": 27, + "column": 29 + }, + "end": { + "line": 27, + "column": 39 + } + } + }, + "test": { + "type": "BinaryExpression", + "left": { + "type": "Identifier", + "name": "current", "range": [ - 384, - 394 + 364, + 371 ], "loc": { "start": { "line": 27, - "column": 29 + "column": 9 }, "end": { "line": 27, - "column": 39 + "column": 16 } } }, - "test": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "current", - "range": [ - 364, - 371 - ], - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "operator": "===", - "right": { - "type": "Literal", - "raw": "'baz'", - "value": "baz", - "range": [ - 376, - 381 - ], - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, + "operator": "===", + "right": { + "type": "Literal", + "raw": "'baz'", + "value": "baz", "range": [ - 364, + 376, 381 ], "loc": { "start": { "line": 27, - "column": 9 + "column": 21 }, "end": { "line": 27, @@ -1125,7 +1109,7 @@ }, "range": [ 364, - 399 + 381 ], "loc": { "start": { @@ -1134,26 +1118,40 @@ }, "end": { "line": 27, - "column": 44 + "column": 26 } } }, "range": [ - 363, - 400 + 364, + 399 ], "loc": { "start": { "line": 27, - "column": 8 + "column": 9 }, "end": { "line": 27, - "column": 45 + "column": 44 } } + }, + "range": [ + 363, + 400 + ], + "loc": { + "start": { + "line": 27, + "column": 8 + }, + "end": { + "line": 27, + "column": 45 + } } - ], + }, "range": [ 356, 401 diff --git a/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json b/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json index 22be501f..2eb8cbe3 100644 --- a/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json +++ b/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json @@ -721,74 +721,91 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "color: ", - "range": [ - 207, - 214 - ], - "loc": { - "start": { - "line": 12, - "column": 11 - }, - "end": { - "line": 12, - "column": 18 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "color: ", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 12, + "column": 11 + }, + "end": { + "line": 12, + "column": 18 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "ConditionalExpression", - "alternate": { - "type": "Literal", - "raw": "'#ccc'", - "value": "#ccc", - "range": [ - 230, - 236 - ], - "loc": { - "start": { - "line": 12, - "column": 34 - }, - "end": { - "line": 12, - "column": 40 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "ConditionalExpression", + "alternate": { + "type": "Literal", + "raw": "'#ccc'", + "value": "#ccc", + "range": [ + 230, + 236 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 40 + } } - } - }, - "consequent": { - "type": "Literal", - "raw": "'#333'", - "value": "#333", - "range": [ - 221, - 227 - ], - "loc": { - "start": { - "line": 12, - "column": 25 - }, - "end": { - "line": 12, - "column": 31 + }, + "consequent": { + "type": "Literal", + "raw": "'#333'", + "value": "#333", + "range": [ + 221, + 227 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 31 + } } - } - }, - "test": { - "type": "Identifier", - "name": "pin", + }, + "test": { + "type": "Identifier", + "name": "pin", + "range": [ + 215, + 218 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 22 + } + } + }, "range": [ 215, - 218 + 236 ], "loc": { "start": { @@ -797,41 +814,41 @@ }, "end": { "line": 12, - "column": 22 + "column": 40 } } }, "range": [ - 215, - 236 + 214, + 237 ], "loc": { "start": { "line": 12, - "column": 19 + "column": 18 }, "end": { "line": 12, - "column": 40 + "column": 41 } } + } + ], + "range": [ + 207, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 11 }, - "range": [ - 214, - 237 - ], - "loc": { - "start": { - "line": 12, - "column": 18 - }, - "end": { - "line": 12, - "column": 41 - } + "end": { + "line": 12, + "column": 41 } } - ], + }, "range": [ 200, 238 diff --git a/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json b/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json index 653eff35..a6ad9961 100644 --- a/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json +++ b/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json @@ -960,26 +960,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "keypad", - "range": [ - 442, - 448 - ], - "loc": { - "start": { - "line": 26, - "column": 12 - }, - "end": { - "line": 26, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "keypad", + "range": [ + 442, + 448 + ], + "loc": { + "start": { + "line": 26, + "column": 12 + }, + "end": { + "line": 26, + "column": 18 } } - ], + }, "range": [ 435, 449 @@ -3074,40 +3072,22 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Identifier", - "name": "value", - "range": [ - 841, - 846 - ], - "loc": { - "start": { - "line": 37, - "column": 20 - }, - "end": { - "line": 37, - "column": 25 - } - } - }, - "operator": "!", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Identifier", + "name": "value", "range": [ - 840, + 841, 846 ], "loc": { "start": { "line": 37, - "column": 19 + "column": 20 }, "end": { "line": 37, @@ -3115,22 +3095,38 @@ } } }, + "operator": "!", + "prefix": true, "range": [ - 839, - 847 + 840, + 846 ], "loc": { "start": { "line": 37, - "column": 18 + "column": 19 }, "end": { "line": 37, - "column": 26 + "column": 25 } } + }, + "range": [ + 839, + 847 + ], + "loc": { + "start": { + "line": 37, + "column": 18 + }, + "end": { + "line": 37, + "column": 26 + } } - ], + }, "range": [ 830, 847 @@ -3572,40 +3568,22 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Identifier", - "name": "value", - "range": [ - 941, - 946 - ], - "loc": { - "start": { - "line": 39, - "column": 20 - }, - "end": { - "line": 39, - "column": 25 - } - } - }, - "operator": "!", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Identifier", + "name": "value", "range": [ - 940, + 941, 946 ], "loc": { "start": { "line": 39, - "column": 19 + "column": 20 }, "end": { "line": 39, @@ -3613,22 +3591,38 @@ } } }, + "operator": "!", + "prefix": true, "range": [ - 939, - 947 + 940, + 946 ], "loc": { "start": { "line": 39, - "column": 18 + "column": 19 }, "end": { "line": 39, - "column": 26 + "column": 25 } } + }, + "range": [ + 939, + 947 + ], + "loc": { + "start": { + "line": 39, + "column": 18 + }, + "end": { + "line": 39, + "column": 26 + } } - ], + }, "range": [ 930, 947 diff --git a/tests/fixtures/parser/ast/tutorial/congratulations-output.json b/tests/fixtures/parser/ast/tutorial/congratulations-output.json index e30ee485..3c7ae554 100644 --- a/tests/fixtures/parser/ast/tutorial/congratulations-output.json +++ b/tests/fixtures/parser/ast/tutorial/congratulations-output.json @@ -2912,61 +2912,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "left: ", - "range": [ - 782, - 788 - ], - "loc": { - "start": { - "line": 48, - "column": 14 - }, - "end": { - "line": 48, - "column": 20 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "left: ", + "range": [ + 782, + 788 + ], + "loc": { + "start": { + "line": 48, + "column": 14 + }, + "end": { + "line": 48, + "column": 20 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "c", - "range": [ - 789, - 790 - ], - "loc": { - "start": { - "line": 48, - "column": 21 - }, - "end": { - "line": 48, - "column": 22 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 789, + 790 + ], + "loc": { + "start": { + "line": 48, + "column": 21 + }, + "end": { + "line": 48, + "column": 22 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "x", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "x", + "range": [ + 791, + 792 + ], + "loc": { + "start": { + "line": 48, + "column": 23 + }, + "end": { + "line": 48, + "column": 24 + } + } + }, "range": [ - 791, + 789, 792 ], "loc": { "start": { "line": 48, - "column": 23 + "column": 21 }, "end": { "line": 48, @@ -2975,89 +2992,89 @@ } }, "range": [ - 789, - 792 + 788, + 793 ], "loc": { "start": { "line": 48, - "column": 21 + "column": 20 }, "end": { "line": 48, - "column": 24 + "column": 25 } } }, - "range": [ - 788, - 793 - ], - "loc": { - "start": { - "line": 48, - "column": 20 - }, - "end": { - "line": 48, - "column": 25 - } - } - }, - { - "type": "SvelteLiteral", - "value": "%; top: ", - "range": [ - 793, - 801 - ], - "loc": { - "start": { - "line": 48, - "column": 25 - }, - "end": { - "line": 48, - "column": 33 + { + "type": "SvelteLiteral", + "value": "%; top: ", + "range": [ + 793, + 801 + ], + "loc": { + "start": { + "line": 48, + "column": 25 + }, + "end": { + "line": 48, + "column": 33 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "c", - "range": [ - 802, - 803 - ], - "loc": { - "start": { - "line": 48, - "column": 34 - }, - "end": { - "line": 48, - "column": 35 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 802, + 803 + ], + "loc": { + "start": { + "line": 48, + "column": 34 + }, + "end": { + "line": 48, + "column": 35 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "y", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "y", + "range": [ + 804, + 805 + ], + "loc": { + "start": { + "line": 48, + "column": 36 + }, + "end": { + "line": 48, + "column": 37 + } + } + }, "range": [ - 804, + 802, 805 ], "loc": { "start": { "line": 48, - "column": 36 + "column": 34 }, "end": { "line": 48, @@ -3066,89 +3083,89 @@ } }, "range": [ - 802, - 805 + 801, + 806 ], "loc": { "start": { "line": 48, - "column": 34 + "column": 33 }, "end": { "line": 48, - "column": 37 + "column": 38 } } }, - "range": [ - 801, - 806 - ], - "loc": { - "start": { - "line": 48, - "column": 33 - }, - "end": { - "line": 48, - "column": 38 - } - } - }, - { - "type": "SvelteLiteral", - "value": "%; transform: scale(", - "range": [ - 806, - 826 - ], - "loc": { - "start": { - "line": 48, - "column": 38 - }, - "end": { - "line": 48, - "column": 58 + { + "type": "SvelteLiteral", + "value": "%; transform: scale(", + "range": [ + 806, + 826 + ], + "loc": { + "start": { + "line": 48, + "column": 38 + }, + "end": { + "line": 48, + "column": 58 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "c", - "range": [ - 827, - 828 - ], - "loc": { - "start": { - "line": 48, - "column": 59 - }, - "end": { - "line": 48, - "column": 60 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 827, + 828 + ], + "loc": { + "start": { + "line": 48, + "column": 59 + }, + "end": { + "line": 48, + "column": 60 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "r", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "r", + "range": [ + 829, + 830 + ], + "loc": { + "start": { + "line": 48, + "column": 61 + }, + "end": { + "line": 48, + "column": 62 + } + } + }, "range": [ - 829, + 827, 830 ], "loc": { "start": { "line": 48, - "column": 61 + "column": 59 }, "end": { "line": 48, @@ -3157,54 +3174,54 @@ } }, "range": [ - 827, - 830 + 826, + 831 ], "loc": { "start": { "line": 48, - "column": 59 + "column": 58 }, "end": { "line": 48, - "column": 62 + "column": 63 } } }, - "range": [ - 826, - 831 - ], - "loc": { - "start": { - "line": 48, - "column": 58 - }, - "end": { - "line": 48, - "column": 63 + { + "type": "SvelteLiteral", + "value": ")", + "range": [ + 831, + 832 + ], + "loc": { + "start": { + "line": 48, + "column": 63 + }, + "end": { + "line": 48, + "column": 64 + } } } - }, - { - "type": "SvelteLiteral", - "value": ")", - "range": [ - 831, - 832 - ], - "loc": { - "start": { - "line": 48, - "column": 63 - }, - "end": { - "line": 48, - "column": 64 - } + ], + "range": [ + 782, + 832 + ], + "loc": { + "start": { + "line": 48, + "column": 14 + }, + "end": { + "line": 48, + "column": 64 } } - ], + }, "range": [ 775, 833 diff --git a/tests/fixtures/parser/ast/tutorial/congratulations-scope-output.json b/tests/fixtures/parser/ast/tutorial/congratulations-scope-output.json index ecba3001..8bb9f66a 100644 --- a/tests/fixtures/parser/ast/tutorial/congratulations-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/congratulations-scope-output.json @@ -7783,61 +7783,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "left: ", - "range": [ - 782, - 788 - ], - "loc": { - "start": { - "line": 48, - "column": 14 - }, - "end": { - "line": 48, - "column": 20 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "left: ", + "range": [ + 782, + 788 + ], + "loc": { + "start": { + "line": 48, + "column": 14 + }, + "end": { + "line": 48, + "column": 20 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "c", - "range": [ - 789, - 790 - ], - "loc": { - "start": { - "line": 48, - "column": 21 - }, - "end": { - "line": 48, - "column": 22 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 789, + 790 + ], + "loc": { + "start": { + "line": 48, + "column": 21 + }, + "end": { + "line": 48, + "column": 22 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "x", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "x", + "range": [ + 791, + 792 + ], + "loc": { + "start": { + "line": 48, + "column": 23 + }, + "end": { + "line": 48, + "column": 24 + } + } + }, "range": [ - 791, + 789, 792 ], "loc": { "start": { "line": 48, - "column": 23 + "column": 21 }, "end": { "line": 48, @@ -7846,89 +7863,89 @@ } }, "range": [ - 789, - 792 + 788, + 793 ], "loc": { "start": { "line": 48, - "column": 21 + "column": 20 }, "end": { "line": 48, - "column": 24 + "column": 25 } } }, - "range": [ - 788, - 793 - ], - "loc": { - "start": { - "line": 48, - "column": 20 - }, - "end": { - "line": 48, - "column": 25 - } - } - }, - { - "type": "SvelteLiteral", - "value": "%; top: ", - "range": [ - 793, - 801 - ], - "loc": { - "start": { - "line": 48, - "column": 25 - }, - "end": { - "line": 48, - "column": 33 + { + "type": "SvelteLiteral", + "value": "%; top: ", + "range": [ + 793, + 801 + ], + "loc": { + "start": { + "line": 48, + "column": 25 + }, + "end": { + "line": 48, + "column": 33 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "c", - "range": [ - 802, - 803 - ], - "loc": { - "start": { - "line": 48, - "column": 34 - }, - "end": { - "line": 48, - "column": 35 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 802, + 803 + ], + "loc": { + "start": { + "line": 48, + "column": 34 + }, + "end": { + "line": 48, + "column": 35 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "y", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "y", + "range": [ + 804, + 805 + ], + "loc": { + "start": { + "line": 48, + "column": 36 + }, + "end": { + "line": 48, + "column": 37 + } + } + }, "range": [ - 804, + 802, 805 ], "loc": { "start": { "line": 48, - "column": 36 + "column": 34 }, "end": { "line": 48, @@ -7937,89 +7954,89 @@ } }, "range": [ - 802, - 805 + 801, + 806 ], "loc": { "start": { "line": 48, - "column": 34 + "column": 33 }, "end": { "line": 48, - "column": 37 + "column": 38 } } }, - "range": [ - 801, - 806 - ], - "loc": { - "start": { - "line": 48, - "column": 33 - }, - "end": { - "line": 48, - "column": 38 - } - } - }, - { - "type": "SvelteLiteral", - "value": "%; transform: scale(", - "range": [ - 806, - 826 - ], - "loc": { - "start": { - "line": 48, - "column": 38 - }, - "end": { - "line": 48, - "column": 58 + { + "type": "SvelteLiteral", + "value": "%; transform: scale(", + "range": [ + 806, + 826 + ], + "loc": { + "start": { + "line": 48, + "column": 38 + }, + "end": { + "line": 48, + "column": 58 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "c", - "range": [ - 827, - 828 - ], - "loc": { - "start": { - "line": 48, - "column": 59 - }, - "end": { - "line": 48, - "column": 60 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 827, + 828 + ], + "loc": { + "start": { + "line": 48, + "column": 59 + }, + "end": { + "line": 48, + "column": 60 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "r", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "r", + "range": [ + 829, + 830 + ], + "loc": { + "start": { + "line": 48, + "column": 61 + }, + "end": { + "line": 48, + "column": 62 + } + } + }, "range": [ - 829, + 827, 830 ], "loc": { "start": { "line": 48, - "column": 61 + "column": 59 }, "end": { "line": 48, @@ -8028,54 +8045,54 @@ } }, "range": [ - 827, - 830 + 826, + 831 ], "loc": { "start": { "line": 48, - "column": 59 + "column": 58 }, "end": { "line": 48, - "column": 62 + "column": 63 } } }, - "range": [ - 826, - 831 - ], - "loc": { - "start": { - "line": 48, - "column": 58 - }, - "end": { - "line": 48, - "column": 63 + { + "type": "SvelteLiteral", + "value": ")", + "range": [ + 831, + 832 + ], + "loc": { + "start": { + "line": 48, + "column": 63 + }, + "end": { + "line": 48, + "column": 64 + } } } - }, - { - "type": "SvelteLiteral", - "value": ")", - "range": [ - 831, - 832 - ], - "loc": { - "start": { - "line": 48, - "column": 63 - }, - "end": { - "line": 48, - "column": 64 - } + ], + "range": [ + 782, + 832 + ], + "loc": { + "start": { + "line": 48, + "column": 14 + }, + "end": { + "line": 48, + "column": 64 } } - ], + }, "range": [ 775, 833 diff --git a/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json b/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json index e2319b3f..96e7d416 100644 --- a/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json @@ -211,26 +211,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "true", - "range": [ - 81, - 85 - ], - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 26 - } + "value": { + "type": "SvelteLiteral", + "value": "true", + "range": [ + 81, + 85 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 26 } } - ], + }, "range": [ 64, 86 diff --git a/tests/fixtures/parser/ast/tutorial/context-api01-output.json b/tests/fixtures/parser/ast/tutorial/context-api01-output.json index 7479368e..d0e02c05 100644 --- a/tests/fixtures/parser/ast/tutorial/context-api01-output.json +++ b/tests/fixtures/parser/ast/tutorial/context-api01-output.json @@ -283,45 +283,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "35", - "value": 35, - "range": [ - 108, - 110 - ], - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 12 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "35", + "value": 35, "range": [ - 107, - 111 + 108, + 110 ], "loc": { "start": { "line": 6, - "column": 9 + "column": 10 }, "end": { "line": 6, - "column": 13 + "column": 12 } } + }, + "range": [ + 107, + 111 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 13 + } } - ], + }, "range": [ 103, 111 @@ -358,41 +356,23 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Literal", - "raw": "84", - "value": 84, - "range": [ - 118, - 120 - ], - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 6, - "column": 22 - } - } - }, - "operator": "-", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Literal", + "raw": "84", + "value": 84, "range": [ - 117, + 118, 120 ], "loc": { "start": { "line": 6, - "column": 19 + "column": 20 }, "end": { "line": 6, @@ -400,22 +380,38 @@ } } }, + "operator": "-", + "prefix": true, "range": [ - 116, - 121 + 117, + 120 ], "loc": { "start": { "line": 6, - "column": 18 + "column": 19 }, "end": { "line": 6, - "column": 23 + "column": 22 } } + }, + "range": [ + 116, + 121 + ], + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 23 + } } - ], + }, "range": [ 112, 121 @@ -452,45 +448,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "3.5", - "value": 3.5, - "range": [ - 128, - 131 - ], - "loc": { - "start": { - "line": 6, - "column": 30 - }, - "end": { - "line": 6, - "column": 33 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "3.5", + "value": 3.5, "range": [ - 127, - 132 + 128, + 131 ], "loc": { "start": { "line": 6, - "column": 29 + "column": 30 }, "end": { "line": 6, - "column": 34 + "column": 33 } } + }, + "range": [ + 127, + 132 + ], + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 34 + } } - ], + }, "range": [ 122, 132 @@ -587,45 +581,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "37.8225", - "value": 37.8225, - "range": [ - 151, - 158 - ], - "loc": { - "start": { - "line": 7, - "column": 17 - }, - "end": { - "line": 7, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "37.8225", + "value": 37.8225, "range": [ - 150, - 159 + 151, + 158 ], "loc": { "start": { "line": 7, - "column": 16 + "column": 17 }, "end": { "line": 7, - "column": 25 + "column": 24 } } + }, + "range": [ + 150, + 159 + ], + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 25 + } } - ], + }, "range": [ 146, 159 @@ -662,41 +654,23 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Literal", - "raw": "122.0024", - "value": 122.0024, - "range": [ - 166, - 174 - ], - "loc": { - "start": { - "line": 7, - "column": 32 - }, - "end": { - "line": 7, - "column": 40 - } - } - }, - "operator": "-", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Literal", + "raw": "122.0024", + "value": 122.0024, "range": [ - 165, + 166, 174 ], "loc": { "start": { "line": 7, - "column": 31 + "column": 32 }, "end": { "line": 7, @@ -704,22 +678,38 @@ } } }, + "operator": "-", + "prefix": true, "range": [ - 164, - 175 + 165, + 174 ], "loc": { "start": { "line": 7, - "column": 30 + "column": 31 }, "end": { "line": 7, - "column": 41 + "column": 40 } } + }, + "range": [ + 164, + 175 + ], + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 41 + } } - ], + }, "range": [ 160, 175 @@ -756,26 +746,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Svelte Body Shaping", - "range": [ - 183, - 202 - ], - "loc": { - "start": { - "line": 7, - "column": 49 - }, - "end": { - "line": 7, - "column": 68 - } + "value": { + "type": "SvelteLiteral", + "value": "Svelte Body Shaping", + "range": [ + 183, + 202 + ], + "loc": { + "start": { + "line": 7, + "column": 49 + }, + "end": { + "line": 7, + "column": 68 } } - ], + }, "range": [ 176, 203 @@ -888,45 +876,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "33.8981", - "value": 33.8981, - "range": [ - 223, - 230 - ], - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "33.8981", + "value": 33.8981, "range": [ - 222, - 231 + 223, + 230 ], "loc": { "start": { "line": 8, - "column": 16 + "column": 17 }, "end": { "line": 8, - "column": 25 + "column": 24 } } + }, + "range": [ + 222, + 231 + ], + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 25 + } } - ], + }, "range": [ 218, 231 @@ -963,41 +949,23 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Literal", - "raw": "118.4169", - "value": 118.4169, - "range": [ - 238, - 246 - ], - "loc": { - "start": { - "line": 8, - "column": 32 - }, - "end": { - "line": 8, - "column": 40 - } - } - }, - "operator": "-", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Literal", + "raw": "118.4169", + "value": 118.4169, "range": [ - 237, + 238, 246 ], "loc": { "start": { "line": 8, - "column": 31 + "column": 32 }, "end": { "line": 8, @@ -1005,22 +973,38 @@ } } }, + "operator": "-", + "prefix": true, "range": [ - 236, - 247 + 237, + 246 ], "loc": { "start": { "line": 8, - "column": 30 + "column": 31 }, "end": { "line": 8, - "column": 41 + "column": 40 } } + }, + "range": [ + 236, + 247 + ], + "loc": { + "start": { + "line": 8, + "column": 30 + }, + "end": { + "line": 8, + "column": 41 + } } - ], + }, "range": [ 232, 247 @@ -1057,26 +1041,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Svelte Barbershop & Essentials", - "range": [ - 255, - 285 - ], - "loc": { - "start": { - "line": 8, - "column": 49 - }, - "end": { - "line": 8, - "column": 79 - } + "value": { + "type": "SvelteLiteral", + "value": "Svelte Barbershop & Essentials", + "range": [ + 255, + 285 + ], + "loc": { + "start": { + "line": 8, + "column": 49 + }, + "end": { + "line": 8, + "column": 79 } } - ], + }, "range": [ 248, 286 @@ -1189,45 +1171,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "29.7230", - "value": 29.723, - "range": [ - 306, - 313 - ], - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "29.7230", + "value": 29.723, "range": [ - 305, - 314 + 306, + 313 ], "loc": { "start": { "line": 9, - "column": 16 + "column": 17 }, "end": { "line": 9, - "column": 25 + "column": 24 } } + }, + "range": [ + 305, + 314 + ], + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 25 + } } - ], + }, "range": [ 301, 314 @@ -1264,41 +1244,23 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Literal", - "raw": "95.4189", - "value": 95.4189, - "range": [ - 321, - 328 - ], - "loc": { - "start": { - "line": 9, - "column": 32 - }, - "end": { - "line": 9, - "column": 39 - } - } - }, - "operator": "-", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Literal", + "raw": "95.4189", + "value": 95.4189, "range": [ - 320, + 321, 328 ], "loc": { "start": { "line": 9, - "column": 31 + "column": 32 }, "end": { "line": 9, @@ -1306,22 +1268,38 @@ } } }, + "operator": "-", + "prefix": true, "range": [ - 319, - 329 + 320, + 328 ], "loc": { "start": { "line": 9, - "column": 30 + "column": 31 }, "end": { "line": 9, - "column": 40 + "column": 39 } } + }, + "range": [ + 319, + 329 + ], + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 40 + } } - ], + }, "range": [ 315, 329 @@ -1358,26 +1336,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Svelte Waxing Studio", - "range": [ - 337, - 357 - ], - "loc": { - "start": { - "line": 9, - "column": 48 - }, - "end": { - "line": 9, - "column": 68 - } + "value": { + "type": "SvelteLiteral", + "value": "Svelte Waxing Studio", + "range": [ + 337, + 357 + ], + "loc": { + "start": { + "line": 9, + "column": 48 + }, + "end": { + "line": 9, + "column": 68 } } - ], + }, "range": [ 330, 358 @@ -1490,45 +1466,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "28.3378", - "value": 28.3378, - "range": [ - 378, - 385 - ], - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 10, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "28.3378", + "value": 28.3378, "range": [ - 377, - 386 + 378, + 385 ], "loc": { "start": { "line": 10, - "column": 16 + "column": 17 }, "end": { "line": 10, - "column": 25 + "column": 24 } } + }, + "range": [ + 377, + 386 + ], + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 25 + } } - ], + }, "range": [ 373, 386 @@ -1565,41 +1539,23 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Literal", - "raw": "81.3966", - "value": 81.3966, - "range": [ - 393, - 400 - ], - "loc": { - "start": { - "line": 10, - "column": 32 - }, - "end": { - "line": 10, - "column": 39 - } - } - }, - "operator": "-", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Literal", + "raw": "81.3966", + "value": 81.3966, "range": [ - 392, + 393, 400 ], "loc": { "start": { "line": 10, - "column": 31 + "column": 32 }, "end": { "line": 10, @@ -1607,22 +1563,38 @@ } } }, + "operator": "-", + "prefix": true, "range": [ - 391, - 401 + 392, + 400 ], "loc": { "start": { "line": 10, - "column": 30 + "column": 31 }, "end": { "line": 10, - "column": 40 + "column": 39 } } + }, + "range": [ + 391, + 401 + ], + "loc": { + "start": { + "line": 10, + "column": 30 + }, + "end": { + "line": 10, + "column": 40 + } } - ], + }, "range": [ 387, 401 @@ -1659,26 +1631,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Svelte 30 Nutritional Consultants", - "range": [ - 409, - 442 - ], - "loc": { - "start": { - "line": 10, - "column": 48 - }, - "end": { - "line": 10, - "column": 81 - } + "value": { + "type": "SvelteLiteral", + "value": "Svelte 30 Nutritional Consultants", + "range": [ + 409, + 442 + ], + "loc": { + "start": { + "line": 10, + "column": 48 + }, + "end": { + "line": 10, + "column": 81 } } - ], + }, "range": [ 402, 443 @@ -1791,45 +1761,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "40.6483", - "value": 40.6483, - "range": [ - 463, - 470 - ], - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "40.6483", + "value": 40.6483, "range": [ - 462, - 471 + 463, + 470 ], "loc": { "start": { "line": 11, - "column": 16 + "column": 17 }, "end": { "line": 11, - "column": 25 + "column": 24 } } + }, + "range": [ + 462, + 471 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 25 + } } - ], + }, "range": [ 458, 471 @@ -1866,41 +1834,23 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Literal", - "raw": "74.0237", - "value": 74.0237, - "range": [ - 478, - 485 - ], - "loc": { - "start": { - "line": 11, - "column": 32 - }, - "end": { - "line": 11, - "column": 39 - } - } - }, - "operator": "-", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Literal", + "raw": "74.0237", + "value": 74.0237, "range": [ - 477, + 478, 485 ], "loc": { "start": { "line": 11, - "column": 31 + "column": 32 }, "end": { "line": 11, @@ -1908,22 +1858,38 @@ } } }, + "operator": "-", + "prefix": true, "range": [ - 476, - 486 + 477, + 485 ], "loc": { "start": { "line": 11, - "column": 30 + "column": 31 }, "end": { "line": 11, - "column": 40 + "column": 39 } } + }, + "range": [ + 476, + 486 + ], + "loc": { + "start": { + "line": 11, + "column": 30 + }, + "end": { + "line": 11, + "column": 40 + } } - ], + }, "range": [ 472, 486 @@ -1960,26 +1926,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Svelte Brands LLC", - "range": [ - 494, - 511 - ], - "loc": { - "start": { - "line": 11, - "column": 48 - }, - "end": { - "line": 11, - "column": 65 - } + "value": { + "type": "SvelteLiteral", + "value": "Svelte Brands LLC", + "range": [ + 494, + 511 + ], + "loc": { + "start": { + "line": 11, + "column": 48 + }, + "end": { + "line": 11, + "column": 65 } } - ], + }, "range": [ 487, 512 @@ -2092,45 +2056,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "40.6986", - "value": 40.6986, - "range": [ - 532, - 539 - ], - "loc": { - "start": { - "line": 12, - "column": 17 - }, - "end": { - "line": 12, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "40.6986", + "value": 40.6986, "range": [ - 531, - 540 + 532, + 539 ], "loc": { "start": { "line": 12, - "column": 16 + "column": 17 }, "end": { "line": 12, - "column": 25 + "column": 24 } } + }, + "range": [ + 531, + 540 + ], + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 25 + } } - ], + }, "range": [ 527, 540 @@ -2167,41 +2129,23 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Literal", - "raw": "74.4100", - "value": 74.41, - "range": [ - 547, - 554 - ], - "loc": { - "start": { - "line": 12, - "column": 32 - }, - "end": { - "line": 12, - "column": 39 - } - } - }, - "operator": "-", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Literal", + "raw": "74.4100", + "value": 74.41, "range": [ - 546, + 547, 554 ], "loc": { "start": { "line": 12, - "column": 31 + "column": 32 }, "end": { "line": 12, @@ -2209,22 +2153,38 @@ } } }, + "operator": "-", + "prefix": true, "range": [ - 545, - 555 + 546, + 554 ], "loc": { "start": { "line": 12, - "column": 30 + "column": 31 }, "end": { "line": 12, - "column": 40 + "column": 39 } } + }, + "range": [ + 545, + 555 + ], + "loc": { + "start": { + "line": 12, + "column": 30 + }, + "end": { + "line": 12, + "column": 40 + } } - ], + }, "range": [ 541, 555 @@ -2261,26 +2221,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Svelte Medical Systems", - "range": [ - 563, - 585 - ], - "loc": { - "start": { - "line": 12, - "column": 48 - }, - "end": { - "line": 12, - "column": 70 - } + "value": { + "type": "SvelteLiteral", + "value": "Svelte Medical Systems", + "range": [ + 563, + 585 + ], + "loc": { + "start": { + "line": 12, + "column": 48 + }, + "end": { + "line": 12, + "column": 70 } } - ], + }, "range": [ 556, 586 diff --git a/tests/fixtures/parser/ast/tutorial/custom-css-transitions01-output.json b/tests/fixtures/parser/ast/tutorial/custom-css-transitions01-output.json index 82aa67a6..99ff360a 100644 --- a/tests/fixtures/parser/ast/tutorial/custom-css-transitions01-output.json +++ b/tests/fixtures/parser/ast/tutorial/custom-css-transitions01-output.json @@ -1545,26 +1545,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 533, - 541 - ], - "loc": { - "start": { - "line": 41, - "column": 14 - }, - "end": { - "line": 41, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 533, + 541 + ], + "loc": { + "start": { + "line": 41, + "column": 14 + }, + "end": { + "line": 41, + "column": 22 } } - ], + }, "range": [ 527, 542 @@ -1823,26 +1821,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "centered", - "range": [ - 613, - 621 - ], - "loc": { - "start": { - "line": 46, - "column": 13 - }, - "end": { - "line": 46, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "centered", + "range": [ + 613, + 621 + ], + "loc": { + "start": { + "line": 46, + "column": 13 + }, + "end": { + "line": 46, + "column": 21 } } - ], + }, "range": [ 606, 622 diff --git a/tests/fixtures/parser/ast/tutorial/custom-css-transitions02-output.json b/tests/fixtures/parser/ast/tutorial/custom-css-transitions02-output.json index 9f406b31..3de85954 100644 --- a/tests/fixtures/parser/ast/tutorial/custom-css-transitions02-output.json +++ b/tests/fixtures/parser/ast/tutorial/custom-css-transitions02-output.json @@ -1725,26 +1725,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 680, - 688 - ], - "loc": { - "start": { - "line": 41, - "column": 14 - }, - "end": { - "line": 41, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 680, + 688 + ], + "loc": { + "start": { + "line": 41, + "column": 14 + }, + "end": { + "line": 41, + "column": 22 } } - ], + }, "range": [ 674, 689 @@ -2003,26 +2001,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "centered", - "range": [ - 760, - 768 - ], - "loc": { - "start": { - "line": 46, - "column": 13 - }, - "end": { - "line": 46, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "centered", + "range": [ + 760, + 768 + ], + "loc": { + "start": { + "line": 46, + "column": 13 + }, + "end": { + "line": 46, + "column": 21 } } - ], + }, "range": [ 753, 769 diff --git a/tests/fixtures/parser/ast/tutorial/custom-js-transitions-output.json b/tests/fixtures/parser/ast/tutorial/custom-js-transitions-output.json index f17dd724..3c6db0be 100644 --- a/tests/fixtures/parser/ast/tutorial/custom-js-transitions-output.json +++ b/tests/fixtures/parser/ast/tutorial/custom-js-transitions-output.json @@ -1868,26 +1868,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 535, - 543 - ], - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 535, + 543 + ], + "loc": { + "start": { + "line": 28, + "column": 14 + }, + "end": { + "line": 28, + "column": 22 } } - ], + }, "range": [ 529, 544 diff --git a/tests/fixtures/parser/ast/tutorial/declaring-props01-output.json b/tests/fixtures/parser/ast/tutorial/declaring-props01-output.json index c6554af4..2bed28db 100644 --- a/tests/fixtures/parser/ast/tutorial/declaring-props01-output.json +++ b/tests/fixtures/parser/ast/tutorial/declaring-props01-output.json @@ -210,45 +210,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "42", - "value": 42, - "range": [ - 75, - 77 - ], - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 18 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "42", + "value": 42, "range": [ - 74, - 78 + 75, + 77 ], "loc": { "start": { "line": 5, - "column": 15 + "column": 16 }, "end": { "line": 5, - "column": 19 + "column": 18 } } + }, + "range": [ + 74, + 78 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 19 + } } - ], + }, "range": [ 67, 78 diff --git a/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json b/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json index 389d0277..b4337279 100644 --- a/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json +++ b/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json @@ -4287,26 +4287,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "board", - "range": [ - 1224, - 1229 - ], - "loc": { - "start": { - "line": 56, - "column": 12 - }, - "end": { - "line": 56, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "board", + "range": [ + 1224, + 1229 + ], + "loc": { + "start": { + "line": 56, + "column": 12 + }, + "end": { + "line": 56, + "column": 17 } } - ], + }, "range": [ 1217, 1230 @@ -4403,26 +4401,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "what needs to be done?", - "range": [ - 1255, - 1277 - ], - "loc": { - "start": { - "line": 58, - "column": 15 - }, - "end": { - "line": 58, - "column": 37 - } + "value": { + "type": "SvelteLiteral", + "value": "what needs to be done?", + "range": [ + 1255, + 1277 + ], + "loc": { + "start": { + "line": 58, + "column": 15 + }, + "end": { + "line": 58, + "column": 37 } } - ], + }, "range": [ 1242, 1278 @@ -4833,26 +4829,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "left", - "range": [ - 1351, - 1355 - ], - "loc": { - "start": { - "line": 62, - "column": 13 - }, - "end": { - "line": 62, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "left", + "range": [ + 1351, + 1355 + ], + "loc": { + "start": { + "line": 62, + "column": 13 + }, + "end": { + "line": 62, + "column": 17 } } - ], + }, "range": [ 1344, 1356 @@ -5724,26 +5718,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1526, - 1534 - ], - "loc": { - "start": { - "line": 69, - "column": 16 - }, - "end": { - "line": 69, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1526, + 1534 + ], + "loc": { + "start": { + "line": 69, + "column": 16 + }, + "end": { + "line": 69, + "column": 24 } } - ], + }, "range": [ 1521, 1534 @@ -6460,26 +6452,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "right", - "range": [ - 1698, - 1703 - ], - "loc": { - "start": { - "line": 76, - "column": 13 - }, - "end": { - "line": 76, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "right", + "range": [ + 1698, + 1703 + ], + "loc": { + "start": { + "line": 76, + "column": 13 + }, + "end": { + "line": 76, + "column": 18 } } - ], + }, "range": [ 1691, 1704 @@ -6934,26 +6924,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "done", - "range": [ - 1793, - 1797 - ], - "loc": { - "start": { - "line": 79, - "column": 17 - }, - "end": { - "line": 79, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "done", + "range": [ + 1793, + 1797 + ], + "loc": { + "start": { + "line": 79, + "column": 17 + }, + "end": { + "line": 79, + "column": 21 } } - ], + }, "range": [ 1786, 1798 @@ -7388,26 +7376,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1882, - 1890 - ], - "loc": { - "start": { - "line": 82, - "column": 16 - }, - "end": { - "line": 82, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1882, + 1890 + ], + "loc": { + "start": { + "line": 82, + "column": 16 + }, + "end": { + "line": 82, + "column": 24 } } - ], + }, "range": [ 1877, 1890 @@ -7444,7 +7430,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 1891, 1898 diff --git a/tests/fixtures/parser/ast/tutorial/deferred-transitions-scope-output.json b/tests/fixtures/parser/ast/tutorial/deferred-transitions-scope-output.json index de8ad023..b5950d56 100644 --- a/tests/fixtures/parser/ast/tutorial/deferred-transitions-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/deferred-transitions-scope-output.json @@ -16527,26 +16527,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1526, - 1534 - ], - "loc": { - "start": { - "line": 69, - "column": 16 - }, - "end": { - "line": 69, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1526, + 1534 + ], + "loc": { + "start": { + "line": 69, + "column": 16 + }, + "end": { + "line": 69, + "column": 24 } } - ], + }, "range": [ 1521, 1534 @@ -18712,26 +18710,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "done", - "range": [ - 1793, - 1797 - ], - "loc": { - "start": { - "line": 79, - "column": 17 - }, - "end": { - "line": 79, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "done", + "range": [ + 1793, + 1797 + ], + "loc": { + "start": { + "line": 79, + "column": 17 + }, + "end": { + "line": 79, + "column": 21 } } - ], + }, "range": [ 1786, 1798 @@ -19166,26 +19162,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 1882, - 1890 - ], - "loc": { - "start": { - "line": 82, - "column": 16 - }, - "end": { - "line": 82, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 1882, + 1890 + ], + "loc": { + "start": { + "line": 82, + "column": 16 + }, + "end": { + "line": 82, + "column": 24 } } - ], + }, "range": [ 1877, 1890 @@ -19222,7 +19216,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 1891, 1898 diff --git a/tests/fixtures/parser/ast/tutorial/dimensions-output.json b/tests/fixtures/parser/ast/tutorial/dimensions-output.json index ea013ff6..2077d163 100644 --- a/tests/fixtures/parser/ast/tutorial/dimensions-output.json +++ b/tests/fixtures/parser/ast/tutorial/dimensions-output.json @@ -506,26 +506,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 197, - 202 - ], - "loc": { - "start": { - "line": 14, - "column": 12 - }, - "end": { - "line": 14, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 197, + 202 + ], + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 17 } } - ], + }, "range": [ 192, 202 @@ -1284,80 +1282,97 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "font-size: ", - "range": [ - 340, - 351 - ], - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "size", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "font-size: ", "range": [ - 352, - 356 + 340, + 351 ], "loc": { "start": { "line": 20, - "column": 26 + "column": 14 }, "end": { "line": 20, - "column": 30 + "column": 25 } } }, - "range": [ - 351, - 357 - ], - "loc": { - "start": { - "line": 20, - "column": 25 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "size", + "range": [ + 352, + 356 + ], + "loc": { + "start": { + "line": 20, + "column": 26 + }, + "end": { + "line": 20, + "column": 30 + } + } }, - "end": { - "line": 20, - "column": 31 + "range": [ + 351, + 357 + ], + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 31 + } } - } - }, - { - "type": "SvelteLiteral", - "value": "px", - "range": [ - 357, - 359 - ], - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 33 + }, + { + "type": "SvelteLiteral", + "value": "px", + "range": [ + 357, + 359 + ], + "loc": { + "start": { + "line": 20, + "column": 31 + }, + "end": { + "line": 20, + "column": 33 + } } } + ], + "range": [ + 340, + 359 + ], + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 33 + } } - ], + }, "range": [ 333, 360 diff --git a/tests/fixtures/parser/ast/tutorial/dynamic-attributes-output.json b/tests/fixtures/parser/ast/tutorial/dynamic-attributes-output.json index 4a759a96..a85c61cd 100644 --- a/tests/fixtures/parser/ast/tutorial/dynamic-attributes-output.json +++ b/tests/fixtures/parser/ast/tutorial/dynamic-attributes-output.json @@ -286,44 +286,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "src", - "range": [ - 69, - 72 - ], - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 13 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "src", "range": [ - 68, - 73 + 69, + 72 ], "loc": { "start": { "line": 6, - "column": 9 + "column": 10 }, "end": { "line": 6, - "column": 14 + "column": 13 } } + }, + "range": [ + 68, + 73 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 14 + } } - ], + }, "range": [ 64, 73 @@ -436,44 +434,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "src", - "range": [ - 85, - 88 - ], - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 13 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "src", "range": [ - 84, - 89 + 85, + 88 ], "loc": { "start": { "line": 7, - "column": 9 + "column": 10 }, "end": { "line": 7, - "column": 14 + "column": 13 } } + }, + "range": [ + 84, + 89 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 14 + } } - ], + }, "range": [ 80, 89 @@ -510,26 +506,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "A man dances.", - "range": [ - 95, - 108 - ], - "loc": { - "start": { - "line": 7, - "column": 20 - }, - "end": { - "line": 7, - "column": 33 - } + "value": { + "type": "SvelteLiteral", + "value": "A man dances.", + "range": [ + 95, + 108 + ], + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 33 } } - ], + }, "range": [ 90, 109 @@ -695,26 +689,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "A man dances.", - "range": [ - 127, - 140 - ], - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 29 - } + "value": { + "type": "SvelteLiteral", + "value": "A man dances.", + "range": [ + 127, + 140 + ], + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 29 } } - ], + }, "range": [ 122, 141 diff --git a/tests/fixtures/parser/ast/tutorial/each-block-bindings-output.json b/tests/fixtures/parser/ast/tutorial/each-block-bindings-output.json index 3bec3f88..0ada37ed 100644 --- a/tests/fixtures/parser/ast/tutorial/each-block-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/each-block-bindings-output.json @@ -1983,26 +1983,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 493, - 501 - ], - "loc": { - "start": { - "line": 30, - "column": 8 - }, - "end": { - "line": 30, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 493, + 501 + ], + "loc": { + "start": { + "line": 30, + "column": 8 + }, + "end": { + "line": 30, + "column": 16 } } - ], + }, "range": [ 488, 501 @@ -2225,26 +2223,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "What needs to be done?", - "range": [ - 560, - 582 - ], - "loc": { - "start": { - "line": 35, - "column": 16 - }, - "end": { - "line": 35, - "column": 38 - } + "value": { + "type": "SvelteLiteral", + "value": "What needs to be done?", + "range": [ + 560, + 582 + ], + "loc": { + "start": { + "line": 35, + "column": 16 + }, + "end": { + "line": 35, + "column": 38 } } - ], + }, "range": [ 547, 583 diff --git a/tests/fixtures/parser/ast/tutorial/each-block-bindings-scope-output.json b/tests/fixtures/parser/ast/tutorial/each-block-bindings-scope-output.json index b68a286f..b5501b8a 100644 --- a/tests/fixtures/parser/ast/tutorial/each-block-bindings-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/each-block-bindings-scope-output.json @@ -3404,26 +3404,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 493, - 501 - ], - "loc": { - "start": { - "line": 30, - "column": 8 - }, - "end": { - "line": 30, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 493, + 501 + ], + "loc": { + "start": { + "line": 30, + "column": 8 + }, + "end": { + "line": 30, + "column": 16 } } - ], + }, "range": [ 488, 501 @@ -3646,26 +3644,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "What needs to be done?", - "range": [ - 560, - 582 - ], - "loc": { - "start": { - "line": 35, - "column": 16 - }, - "end": { - "line": 35, - "column": 38 - } + "value": { + "type": "SvelteLiteral", + "value": "What needs to be done?", + "range": [ + 560, + 582 + ], + "loc": { + "start": { + "line": 35, + "column": 16 + }, + "end": { + "line": 35, + "column": 38 } } - ], + }, "range": [ 547, 583 diff --git a/tests/fixtures/parser/ast/tutorial/each-blocks01-output.json b/tests/fixtures/parser/ast/tutorial/each-blocks01-output.json index 6316a4db..31c7b4e5 100644 --- a/tests/fixtures/parser/ast/tutorial/each-blocks01-output.json +++ b/tests/fixtures/parser/ast/tutorial/each-blocks01-output.json @@ -867,26 +867,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "_blank", - "range": [ - 263, - 269 - ], - "loc": { - "start": { - "line": 13, - "column": 17 - }, - "end": { - "line": 13, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "_blank", + "range": [ + 263, + 269 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 23 } } - ], + }, "range": [ 255, 270 @@ -923,61 +921,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.youtube.com/watch?v=", - "range": [ - 277, - 309 - ], - "loc": { - "start": { - "line": 13, - "column": 31 - }, - "end": { - "line": 13, - "column": 63 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.youtube.com/watch?v=", + "range": [ + 277, + 309 + ], + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 63 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "cat", - "range": [ - 310, - 313 - ], - "loc": { - "start": { - "line": 13, - "column": 64 - }, - "end": { - "line": 13, - "column": 67 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "cat", + "range": [ + 310, + 313 + ], + "loc": { + "start": { + "line": 13, + "column": 64 + }, + "end": { + "line": 13, + "column": 67 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "id", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 314, + 316 + ], + "loc": { + "start": { + "line": 13, + "column": 68 + }, + "end": { + "line": 13, + "column": 70 + } + } + }, "range": [ - 314, + 310, 316 ], "loc": { "start": { "line": 13, - "column": 68 + "column": 64 }, "end": { "line": 13, @@ -986,36 +1001,36 @@ } }, "range": [ - 310, - 316 + 309, + 317 ], "loc": { "start": { "line": 13, - "column": 64 + "column": 63 }, "end": { "line": 13, - "column": 70 + "column": 71 } } + } + ], + "range": [ + 277, + 317 + ], + "loc": { + "start": { + "line": 13, + "column": 31 }, - "range": [ - 309, - 317 - ], - "loc": { - "start": { - "line": 13, - "column": 63 - }, - "end": { - "line": 13, - "column": 71 - } + "end": { + "line": 13, + "column": 71 } } - ], + }, "range": [ 271, 318 diff --git a/tests/fixtures/parser/ast/tutorial/each-blocks01-scope-output.json b/tests/fixtures/parser/ast/tutorial/each-blocks01-scope-output.json index 2ff11068..d3ba017f 100644 --- a/tests/fixtures/parser/ast/tutorial/each-blocks01-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/each-blocks01-scope-output.json @@ -869,26 +869,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "_blank", - "range": [ - 263, - 269 - ], - "loc": { - "start": { - "line": 13, - "column": 17 - }, - "end": { - "line": 13, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "_blank", + "range": [ + 263, + 269 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 23 } } - ], + }, "range": [ 255, 270 @@ -925,61 +923,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.youtube.com/watch?v=", - "range": [ - 277, - 309 - ], - "loc": { - "start": { - "line": 13, - "column": 31 - }, - "end": { - "line": 13, - "column": 63 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.youtube.com/watch?v=", + "range": [ + 277, + 309 + ], + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 63 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "cat", - "range": [ - 310, - 313 - ], - "loc": { - "start": { - "line": 13, - "column": 64 - }, - "end": { - "line": 13, - "column": 67 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "cat", + "range": [ + 310, + 313 + ], + "loc": { + "start": { + "line": 13, + "column": 64 + }, + "end": { + "line": 13, + "column": 67 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "id", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 314, + 316 + ], + "loc": { + "start": { + "line": 13, + "column": 68 + }, + "end": { + "line": 13, + "column": 70 + } + } + }, "range": [ - 314, + 310, 316 ], "loc": { "start": { "line": 13, - "column": 68 + "column": 64 }, "end": { "line": 13, @@ -988,36 +1003,36 @@ } }, "range": [ - 310, - 316 + 309, + 317 ], "loc": { "start": { "line": 13, - "column": 64 + "column": 63 }, "end": { "line": 13, - "column": 70 + "column": 71 } } + } + ], + "range": [ + 277, + 317 + ], + "loc": { + "start": { + "line": 13, + "column": 31 }, - "range": [ - 309, - 317 - ], - "loc": { - "start": { - "line": 13, - "column": 63 - }, - "end": { - "line": 13, - "column": 71 - } + "end": { + "line": 13, + "column": 71 } } - ], + }, "range": [ 271, 318 diff --git a/tests/fixtures/parser/ast/tutorial/each-blocks02-output.json b/tests/fixtures/parser/ast/tutorial/each-blocks02-output.json index d4609f7e..a5dd5767 100644 --- a/tests/fixtures/parser/ast/tutorial/each-blocks02-output.json +++ b/tests/fixtures/parser/ast/tutorial/each-blocks02-output.json @@ -884,26 +884,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "_blank", - "range": [ - 266, - 272 - ], - "loc": { - "start": { - "line": 13, - "column": 17 - }, - "end": { - "line": 13, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "_blank", + "range": [ + 266, + 272 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 23 } } - ], + }, "range": [ 258, 273 @@ -940,61 +938,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.youtube.com/watch?v=", - "range": [ - 280, - 312 - ], - "loc": { - "start": { - "line": 13, - "column": 31 - }, - "end": { - "line": 13, - "column": 63 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.youtube.com/watch?v=", + "range": [ + 280, + 312 + ], + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 63 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "cat", - "range": [ - 313, - 316 - ], - "loc": { - "start": { - "line": 13, - "column": 64 - }, - "end": { - "line": 13, - "column": 67 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "cat", + "range": [ + 313, + 316 + ], + "loc": { + "start": { + "line": 13, + "column": 64 + }, + "end": { + "line": 13, + "column": 67 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "id", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 317, + 319 + ], + "loc": { + "start": { + "line": 13, + "column": 68 + }, + "end": { + "line": 13, + "column": 70 + } + } + }, "range": [ - 317, + 313, 319 ], "loc": { "start": { "line": 13, - "column": 68 + "column": 64 }, "end": { "line": 13, @@ -1003,36 +1018,36 @@ } }, "range": [ - 313, - 319 + 312, + 320 ], "loc": { "start": { "line": 13, - "column": 64 + "column": 63 }, "end": { "line": 13, - "column": 70 + "column": 71 } } + } + ], + "range": [ + 280, + 320 + ], + "loc": { + "start": { + "line": 13, + "column": 31 }, - "range": [ - 312, - 320 - ], - "loc": { - "start": { - "line": 13, - "column": 63 - }, - "end": { - "line": 13, - "column": 71 - } + "end": { + "line": 13, + "column": 71 } } - ], + }, "range": [ 274, 321 diff --git a/tests/fixtures/parser/ast/tutorial/each-blocks02-scope-output.json b/tests/fixtures/parser/ast/tutorial/each-blocks02-scope-output.json index 31e48a68..6d9a756a 100644 --- a/tests/fixtures/parser/ast/tutorial/each-blocks02-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/each-blocks02-scope-output.json @@ -886,26 +886,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "_blank", - "range": [ - 266, - 272 - ], - "loc": { - "start": { - "line": 13, - "column": 17 - }, - "end": { - "line": 13, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "_blank", + "range": [ + 266, + 272 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 23 } } - ], + }, "range": [ 258, 273 @@ -942,61 +940,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.youtube.com/watch?v=", - "range": [ - 280, - 312 - ], - "loc": { - "start": { - "line": 13, - "column": 31 - }, - "end": { - "line": 13, - "column": 63 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.youtube.com/watch?v=", + "range": [ + 280, + 312 + ], + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 63 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "cat", - "range": [ - 313, - 316 - ], - "loc": { - "start": { - "line": 13, - "column": 64 - }, - "end": { - "line": 13, - "column": 67 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "cat", + "range": [ + 313, + 316 + ], + "loc": { + "start": { + "line": 13, + "column": 64 + }, + "end": { + "line": 13, + "column": 67 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "id", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 317, + 319 + ], + "loc": { + "start": { + "line": 13, + "column": 68 + }, + "end": { + "line": 13, + "column": 70 + } + } + }, "range": [ - 317, + 313, 319 ], "loc": { "start": { "line": 13, - "column": 68 + "column": 64 }, "end": { "line": 13, @@ -1005,36 +1020,36 @@ } }, "range": [ - 313, - 319 + 312, + 320 ], "loc": { "start": { "line": 13, - "column": 64 + "column": 63 }, "end": { "line": 13, - "column": 70 + "column": 71 } } + } + ], + "range": [ + 280, + 320 + ], + "loc": { + "start": { + "line": 13, + "column": 31 }, - "range": [ - 312, - 320 - ], - "loc": { - "start": { - "line": 13, - "column": 63 - }, - "end": { - "line": 13, - "column": 71 - } + "end": { + "line": 13, + "column": 71 } } - ], + }, "range": [ 274, 321 @@ -1623,26 +1638,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "_blank", - "range": [ - 266, - 272 - ], - "loc": { - "start": { - "line": 13, - "column": 17 - }, - "end": { - "line": 13, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "_blank", + "range": [ + 266, + 272 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 23 } } - ], + }, "range": [ 258, 273 @@ -1679,61 +1692,78 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.youtube.com/watch?v=", - "range": [ - 280, - 312 - ], - "loc": { - "start": { - "line": 13, - "column": 31 - }, - "end": { - "line": 13, - "column": 63 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.youtube.com/watch?v=", + "range": [ + 280, + 312 + ], + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 63 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "cat", - "range": [ - 313, - 316 - ], - "loc": { - "start": { - "line": 13, - "column": 64 - }, - "end": { - "line": 13, - "column": 67 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "cat", + "range": [ + 313, + 316 + ], + "loc": { + "start": { + "line": 13, + "column": 64 + }, + "end": { + "line": 13, + "column": 67 + } } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "id", + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 317, + 319 + ], + "loc": { + "start": { + "line": 13, + "column": 68 + }, + "end": { + "line": 13, + "column": 70 + } + } + }, "range": [ - 317, + 313, 319 ], "loc": { "start": { "line": 13, - "column": 68 + "column": 64 }, "end": { "line": 13, @@ -1742,36 +1772,36 @@ } }, "range": [ - 313, - 319 + 312, + 320 ], "loc": { "start": { "line": 13, - "column": 64 + "column": 63 }, "end": { "line": 13, - "column": 70 + "column": 71 } } + } + ], + "range": [ + 280, + 320 + ], + "loc": { + "start": { + "line": 13, + "column": 31 }, - "range": [ - 312, - 320 - ], - "loc": { - "start": { - "line": 13, - "column": 63 - }, - "end": { - "line": 13, - "column": 71 - } + "end": { + "line": 13, + "column": 71 } } - ], + }, "range": [ 274, 321 diff --git a/tests/fixtures/parser/ast/tutorial/group-inputs-output.json b/tests/fixtures/parser/ast/tutorial/group-inputs-output.json index 1b416b64..5b016d27 100644 --- a/tests/fixtures/parser/ast/tutorial/group-inputs-output.json +++ b/tests/fixtures/parser/ast/tutorial/group-inputs-output.json @@ -1305,26 +1305,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 356, - 361 - ], - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 356, + 361 + ], + "loc": { + "start": { + "line": 19, + "column": 13 + }, + "end": { + "line": 19, + "column": 18 } } - ], + }, "range": [ 351, 361 @@ -1434,45 +1432,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "1", - "value": 1, - "range": [ - 389, - 390 - ], - "loc": { - "start": { - "line": 19, - "column": 46 - }, - "end": { - "line": 19, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "1", + "value": 1, "range": [ - 388, - 391 + 389, + 390 ], "loc": { "start": { "line": 19, - "column": 45 + "column": 46 }, "end": { "line": 19, - "column": 48 + "column": 47 } } + }, + "range": [ + 388, + 391 + ], + "loc": { + "start": { + "line": 19, + "column": 45 + }, + "end": { + "line": 19, + "column": 48 + } } - ], + }, "range": [ 382, 391 @@ -1695,26 +1691,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 435, - 440 - ], - "loc": { - "start": { - "line": 24, - "column": 13 - }, - "end": { - "line": 24, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 435, + 440 + ], + "loc": { + "start": { + "line": 24, + "column": 13 + }, + "end": { + "line": 24, + "column": 18 } } - ], + }, "range": [ 430, 440 @@ -1824,45 +1818,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "2", - "value": 2, - "range": [ - 468, - 469 - ], - "loc": { - "start": { - "line": 24, - "column": 46 - }, - "end": { - "line": 24, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "2", + "value": 2, "range": [ - 467, - 470 + 468, + 469 ], "loc": { "start": { "line": 24, - "column": 45 + "column": 46 }, "end": { "line": 24, - "column": 48 + "column": 47 } } + }, + "range": [ + 467, + 470 + ], + "loc": { + "start": { + "line": 24, + "column": 45 + }, + "end": { + "line": 24, + "column": 48 + } } - ], + }, "range": [ 461, 470 @@ -2085,26 +2077,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 515, - 520 - ], - "loc": { - "start": { - "line": 29, - "column": 13 - }, - "end": { - "line": 29, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 515, + 520 + ], + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 29, + "column": 18 } } - ], + }, "range": [ 510, 520 @@ -2214,45 +2204,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "3", - "value": 3, - "range": [ - 548, - 549 - ], - "loc": { - "start": { - "line": 29, - "column": 46 - }, - "end": { - "line": 29, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "3", + "value": 3, "range": [ - 547, - 550 + 548, + 549 ], "loc": { "start": { "line": 29, - "column": 45 + "column": 46 }, "end": { "line": 29, - "column": 48 + "column": 47 } } + }, + "range": [ + 547, + 550 + ], + "loc": { + "start": { + "line": 29, + "column": 45 + }, + "end": { + "line": 29, + "column": 48 + } } - ], + }, "range": [ 541, 550 @@ -2626,26 +2614,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 642, - 650 - ], - "loc": { - "start": { - "line": 37, - "column": 14 - }, - "end": { - "line": 37, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 642, + 650 + ], + "loc": { + "start": { + "line": 37, + "column": 14 + }, + "end": { + "line": 37, + "column": 22 } } - ], + }, "range": [ 637, 650 @@ -2755,44 +2741,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "flavour", - "range": [ - 680, - 687 - ], - "loc": { - "start": { - "line": 37, - "column": 52 - }, - "end": { - "line": 37, - "column": 59 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "flavour", "range": [ - 679, - 688 + 680, + 687 ], "loc": { "start": { "line": 37, - "column": 51 + "column": 52 }, "end": { "line": 37, - "column": 60 + "column": 59 } } + }, + "range": [ + 679, + 688 + ], + "loc": { + "start": { + "line": 37, + "column": 51 + }, + "end": { + "line": 37, + "column": 60 + } } - ], + }, "range": [ 673, 688 diff --git a/tests/fixtures/parser/ast/tutorial/group-inputs-scope-output.json b/tests/fixtures/parser/ast/tutorial/group-inputs-scope-output.json index 7e087144..16734aca 100644 --- a/tests/fixtures/parser/ast/tutorial/group-inputs-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/group-inputs-scope-output.json @@ -3515,26 +3515,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 642, - 650 - ], - "loc": { - "start": { - "line": 37, - "column": 14 - }, - "end": { - "line": 37, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 642, + 650 + ], + "loc": { + "start": { + "line": 37, + "column": 14 + }, + "end": { + "line": 37, + "column": 22 } } - ], + }, "range": [ 637, 650 @@ -3644,44 +3642,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "flavour", - "range": [ - 680, - 687 - ], - "loc": { - "start": { - "line": 37, - "column": 52 - }, - "end": { - "line": 37, - "column": 59 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "flavour", "range": [ - 679, - 688 + 680, + 687 ], "loc": { "start": { "line": 37, - "column": 51 + "column": 52 }, "end": { "line": 37, - "column": 60 + "column": 59 } } + }, + "range": [ + 679, + 688 + ], + "loc": { + "start": { + "line": 37, + "column": 51 + }, + "end": { + "line": 37, + "column": 60 + } } - ], + }, "range": [ 673, 688 diff --git a/tests/fixtures/parser/ast/tutorial/in-and-out-output.json b/tests/fixtures/parser/ast/tutorial/in-and-out-output.json index d272d0a3..2598022c 100644 --- a/tests/fixtures/parser/ast/tutorial/in-and-out-output.json +++ b/tests/fixtures/parser/ast/tutorial/in-and-out-output.json @@ -414,26 +414,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 111, - 119 - ], - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 111, + 119 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 22 } } - ], + }, "range": [ 105, 120 diff --git a/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-output.json b/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-output.json index e50118b1..784df132 100644 --- a/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-output.json +++ b/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-output.json @@ -1442,59 +1442,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "thing", - "range": [ - 402, - 407 - ], - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "color", - "range": [ - 408, - 413 - ], - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 28 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "thing", "range": [ 402, - 413 + 407 ], "loc": { "start": { "line": 22, "column": 17 }, + "end": { + "line": 22, + "column": 22 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "color", + "range": [ + 408, + 413 + ], + "loc": { + "start": { + "line": 22, + "column": 23 + }, "end": { "line": 22, "column": 28 @@ -1502,21 +1486,35 @@ } }, "range": [ - 401, - 414 + 402, + 413 ], "loc": { "start": { "line": 22, - "column": 16 + "column": 17 }, "end": { "line": 22, - "column": 29 + "column": 28 } } + }, + "range": [ + 401, + 414 + ], + "loc": { + "start": { + "line": 22, + "column": 16 + }, + "end": { + "line": 22, + "column": 29 + } } - ], + }, "range": [ 393, 414 diff --git a/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-scope-output.json b/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-scope-output.json index 29606a3d..fc49833b 100644 --- a/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-scope-output.json @@ -1864,59 +1864,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "thing", - "range": [ - 402, - 407 - ], - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "color", - "range": [ - 408, - 413 - ], - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 28 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "thing", "range": [ 402, - 413 + 407 ], "loc": { "start": { "line": 22, "column": 17 }, + "end": { + "line": 22, + "column": 22 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "color", + "range": [ + 408, + 413 + ], + "loc": { + "start": { + "line": 22, + "column": 23 + }, "end": { "line": 22, "column": 28 @@ -1924,21 +1908,35 @@ } }, "range": [ - 401, - 414 + 402, + 413 ], "loc": { "start": { "line": 22, - "column": 16 + "column": 17 }, "end": { "line": 22, - "column": 29 + "column": 28 } } + }, + "range": [ + 401, + 414 + ], + "loc": { + "start": { + "line": 22, + "column": 16 + }, + "end": { + "line": 22, + "column": 29 + } } - ], + }, "range": [ 393, 414 diff --git a/tests/fixtures/parser/ast/tutorial/local-transitions-output.json b/tests/fixtures/parser/ast/tutorial/local-transitions-output.json index e8357625..2dac6fd0 100644 --- a/tests/fixtures/parser/ast/tutorial/local-transitions-output.json +++ b/tests/fixtures/parser/ast/tutorial/local-transitions-output.json @@ -808,26 +808,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 294, - 302 - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 294, + 302 + ], + "loc": { + "start": { + "line": 17, + "column": 14 + }, + "end": { + "line": 17, + "column": 22 } } - ], + }, "range": [ 288, 303 @@ -1123,26 +1121,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 373, - 378 - ], - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 373, + 378 + ], + "loc": { + "start": { + "line": 22, + "column": 14 + }, + "end": { + "line": 22, + "column": 19 } } - ], + }, "range": [ 367, 379 @@ -1252,26 +1248,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 399, - 401 - ], - "loc": { - "start": { - "line": 22, - "column": 40 - }, - "end": { - "line": 22, - "column": 42 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 399, + 401 + ], + "loc": { + "start": { + "line": 22, + "column": 40 + }, + "end": { + "line": 22, + "column": 42 } } - ], + }, "range": [ 395, 401 diff --git a/tests/fixtures/parser/ast/tutorial/media-elements-output.json b/tests/fixtures/parser/ast/tutorial/media-elements-output.json index 53e399a2..7abc9697 100644 --- a/tests/fixtures/parser/ast/tutorial/media-elements-output.json +++ b/tests/fixtures/parser/ast/tutorial/media-elements-output.json @@ -3711,26 +3711,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://cloud.blender.org/open-projects", - "range": [ - 2054, - 2093 - ], - "loc": { - "start": { - "line": 108, - "column": 17 - }, - "end": { - "line": 108, - "column": 56 - } + "value": { + "type": "SvelteLiteral", + "value": "https://cloud.blender.org/open-projects", + "range": [ + 2054, + 2093 + ], + "loc": { + "start": { + "line": 108, + "column": 17 + }, + "end": { + "line": 108, + "column": 56 } } - ], + }, "range": [ 2048, 2094 @@ -3988,26 +3986,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/caminandes-llamigos.jpg", - "range": [ - 2157, - 2214 - ], - "loc": { - "start": { - "line": 112, - "column": 10 - }, - "end": { - "line": 112, - "column": 67 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/caminandes-llamigos.jpg", + "range": [ + 2157, + 2214 + ], + "loc": { + "start": { + "line": 112, + "column": 10 + }, + "end": { + "line": 112, + "column": 67 } } - ], + }, "range": [ 2149, 2215 @@ -4044,26 +4040,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/caminandes-llamigos.mp4", - "range": [ - 2223, - 2280 - ], - "loc": { - "start": { - "line": 113, - "column": 7 - }, - "end": { - "line": 113, - "column": 64 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/caminandes-llamigos.mp4", + "range": [ + 2223, + 2280 + ], + "loc": { + "start": { + "line": 113, + "column": 7 + }, + "end": { + "line": 113, + "column": 64 } } - ], + }, "range": [ 2218, 2281 @@ -4523,26 +4517,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "captions", - "range": [ - 2420, - 2428 - ], - "loc": { - "start": { - "line": 119, - "column": 15 - }, - "end": { - "line": 119, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "captions", + "range": [ + 2420, + 2428 + ], + "loc": { + "start": { + "line": 119, + "column": 15 + }, + "end": { + "line": 119, + "column": 23 } } - ], + }, "range": [ 2414, 2429 @@ -4706,26 +4698,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "controls", - "range": [ - 2455, - 2463 - ], - "loc": { - "start": { - "line": 122, - "column": 13 - }, - "end": { - "line": 122, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "controls", + "range": [ + 2455, + 2463 + ], + "loc": { + "start": { + "line": 122, + "column": 13 + }, + "end": { + "line": 122, + "column": 21 } } - ], + }, "range": [ 2448, 2464 @@ -4762,100 +4752,117 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "opacity: ", - "range": [ - 2472, - 2481 - ], - "loc": { - "start": { - "line": 122, - "column": 30 - }, - "end": { - "line": 122, - "column": 39 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "ConditionalExpression", - "alternate": { - "type": "Literal", - "raw": "0", - "value": 0, - "range": [ - 2513, - 2514 - ], - "loc": { - "start": { - "line": 122, - "column": 71 - }, - "end": { - "line": 122, - "column": 72 - } + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "opacity: ", + "range": [ + 2472, + 2481 + ], + "loc": { + "start": { + "line": 122, + "column": 30 + }, + "end": { + "line": 122, + "column": 39 } - }, - "consequent": { - "type": "Literal", - "raw": "1", - "value": 1, - "range": [ - 2509, - 2510 - ], - "loc": { - "start": { - "line": 122, - "column": 67 - }, - "end": { - "line": 122, - "column": 68 + } + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "ConditionalExpression", + "alternate": { + "type": "Literal", + "raw": "0", + "value": 0, + "range": [ + 2513, + 2514 + ], + "loc": { + "start": { + "line": 122, + "column": 71 + }, + "end": { + "line": 122, + "column": 72 + } } - } - }, - "test": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "duration", + }, + "consequent": { + "type": "Literal", + "raw": "1", + "value": 1, "range": [ - 2482, - 2490 + 2509, + 2510 ], "loc": { "start": { "line": 122, - "column": 40 + "column": 67 }, "end": { "line": 122, - "column": 48 + "column": 68 } } }, - "operator": "&&", - "right": { - "type": "Identifier", - "name": "showControls", + "test": { + "type": "LogicalExpression", + "left": { + "type": "Identifier", + "name": "duration", + "range": [ + 2482, + 2490 + ], + "loc": { + "start": { + "line": 122, + "column": 40 + }, + "end": { + "line": 122, + "column": 48 + } + } + }, + "operator": "&&", + "right": { + "type": "Identifier", + "name": "showControls", + "range": [ + 2494, + 2506 + ], + "loc": { + "start": { + "line": 122, + "column": 52 + }, + "end": { + "line": 122, + "column": 64 + } + } + }, "range": [ - 2494, + 2482, 2506 ], "loc": { "start": { "line": 122, - "column": 52 + "column": 40 }, "end": { "line": 122, @@ -4865,7 +4872,7 @@ }, "range": [ 2482, - 2506 + 2514 ], "loc": { "start": { @@ -4874,41 +4881,41 @@ }, "end": { "line": 122, - "column": 64 + "column": 72 } } }, "range": [ - 2482, - 2514 + 2481, + 2515 ], "loc": { "start": { "line": 122, - "column": 40 + "column": 39 }, "end": { "line": 122, - "column": 72 + "column": 73 } } + } + ], + "range": [ + 2472, + 2515 + ], + "loc": { + "start": { + "line": 122, + "column": 30 }, - "range": [ - 2481, - 2515 - ], - "loc": { - "start": { - "line": 122, - "column": 39 - }, - "end": { - "line": 122, - "column": 73 - } + "end": { + "line": 122, + "column": 73 } } - ], + }, "range": [ 2465, 2516 @@ -5005,54 +5012,19 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "LogicalExpression", + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "LogicalExpression", + "left": { + "type": "BinaryExpression", "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "time", - "range": [ - 2539, - 2543 - ], - "loc": { - "start": { - "line": 123, - "column": 21 - }, - "end": { - "line": 123, - "column": 25 - } - } - }, - "operator": "/", - "right": { - "type": "Identifier", - "name": "duration", - "range": [ - 2546, - 2554 - ], - "loc": { - "start": { - "line": 123, - "column": 28 - }, - "end": { - "line": 123, - "column": 36 - } - } - }, + "type": "Identifier", + "name": "time", "range": [ 2539, - 2554 + 2543 ], "loc": { "start": { @@ -5061,38 +5033,57 @@ }, "end": { "line": 123, - "column": 36 + "column": 25 } } }, - "operator": "||", + "operator": "/", "right": { - "type": "Literal", - "raw": "0", - "value": 0, + "type": "Identifier", + "name": "duration", "range": [ - 2559, - 2560 + 2546, + 2554 ], "loc": { "start": { "line": 123, - "column": 41 + "column": 28 }, "end": { "line": 123, - "column": 42 + "column": 36 } } }, "range": [ - 2538, + 2539, + 2554 + ], + "loc": { + "start": { + "line": 123, + "column": 21 + }, + "end": { + "line": 123, + "column": 36 + } + } + }, + "operator": "||", + "right": { + "type": "Literal", + "raw": "0", + "value": 0, + "range": [ + 2559, 2560 ], "loc": { "start": { "line": 123, - "column": 20 + "column": 41 }, "end": { "line": 123, @@ -5101,21 +5092,35 @@ } }, "range": [ - 2537, - 2561 + 2538, + 2560 ], "loc": { "start": { "line": 123, - "column": 19 + "column": 20 }, "end": { "line": 123, - "column": 43 + "column": 42 } } + }, + "range": [ + 2537, + 2561 + ], + "loc": { + "start": { + "line": 123, + "column": 19 + }, + "end": { + "line": 123, + "column": 43 + } } - ], + }, "range": [ 2530, 2562 @@ -5228,26 +5233,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "info", - "range": [ - 2580, - 2584 - ], - "loc": { - "start": { - "line": 125, - "column": 14 - }, - "end": { - "line": 125, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "info", + "range": [ + 2580, + 2584 + ], + "loc": { + "start": { + "line": 125, + "column": 14 + }, + "end": { + "line": 125, + "column": 18 } } - ], + }, "range": [ 2573, 2585 @@ -5344,26 +5347,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "time", - "range": [ - 2603, - 2607 - ], - "loc": { - "start": { - "line": 126, - "column": 16 - }, - "end": { - "line": 126, - "column": 20 - } + "value": { + "type": "SvelteLiteral", + "value": "time", + "range": [ + 2603, + 2607 + ], + "loc": { + "start": { + "line": 126, + "column": 16 + }, + "end": { + "line": 126, + "column": 20 } } - ], + }, "range": [ 2596, 2608 @@ -5786,26 +5787,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "time", - "range": [ - 2724, - 2728 - ], - "loc": { - "start": { - "line": 128, - "column": 16 - }, - "end": { - "line": 128, - "column": 20 - } + "value": { + "type": "SvelteLiteral", + "value": "time", + "range": [ + 2724, + 2728 + ], + "loc": { + "start": { + "line": 128, + "column": 16 + }, + "end": { + "line": 128, + "column": 20 } } - ], + }, "range": [ 2717, 2729 diff --git a/tests/fixtures/parser/ast/tutorial/module-exports01-output.json b/tests/fixtures/parser/ast/tutorial/module-exports01-output.json index 94fbe71f..c0223fcd 100644 --- a/tests/fixtures/parser/ast/tutorial/module-exports01-output.json +++ b/tests/fixtures/parser/ast/tutorial/module-exports01-output.json @@ -482,26 +482,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/strauss.mp3", - "range": [ - 220, - 271 - ], - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 57 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/strauss.mp3", + "range": [ + 220, + 271 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 57 } } - ], + }, "range": [ 215, 272 @@ -538,26 +536,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "The Blue Danube Waltz", - "range": [ - 281, - 302 - ], - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 29 - } + "value": { + "type": "SvelteLiteral", + "value": "The Blue Danube Waltz", + "range": [ + 281, + 302 + ], + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 29 } } - ], + }, "range": [ 274, 303 @@ -594,26 +590,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Johann Strauss", - "range": [ - 315, - 329 - ], - "loc": { - "start": { - "line": 13, - "column": 11 - }, - "end": { - "line": 13, - "column": 25 - } + "value": { + "type": "SvelteLiteral", + "value": "Johann Strauss", + "range": [ + 315, + 329 + ], + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 25 } } - ], + }, "range": [ 305, 330 @@ -650,26 +644,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "European Archive", - "range": [ - 343, - 359 - ], - "loc": { - "start": { - "line": 14, - "column": 12 - }, - "end": { - "line": 14, - "column": 28 - } + "value": { + "type": "SvelteLiteral", + "value": "European Archive", + "range": [ + 343, + 359 + ], + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 28 } } - ], + }, "range": [ 332, 360 @@ -818,26 +810,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/holst.mp3", - "range": [ - 444, - 493 - ], - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 55 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/holst.mp3", + "range": [ + 444, + 493 + ], + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 55 } } - ], + }, "range": [ 439, 494 @@ -874,26 +864,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Mars, the Bringer of War", - "range": [ - 503, - 527 - ], - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 32 - } + "value": { + "type": "SvelteLiteral", + "value": "Mars, the Bringer of War", + "range": [ + 503, + 527 + ], + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 32 } } - ], + }, "range": [ 496, 528 @@ -930,26 +918,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Gustav Holst", - "range": [ - 540, - 552 - ], - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "Gustav Holst", + "range": [ + 540, + 552 + ], + "loc": { + "start": { + "line": 21, + "column": 11 + }, + "end": { + "line": 21, + "column": 23 } } - ], + }, "range": [ 530, 553 @@ -986,26 +972,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "USAF Heritage of America Band", - "range": [ - 566, - 595 - ], - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 41 - } + "value": { + "type": "SvelteLiteral", + "value": "USAF Heritage of America Band", + "range": [ + 566, + 595 + ], + "loc": { + "start": { + "line": 22, + "column": 12 + }, + "end": { + "line": 22, + "column": 41 } } - ], + }, "range": [ 555, 596 @@ -1154,26 +1138,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/satie.mp3", - "range": [ - 675, - 724 - ], - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 55 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/satie.mp3", + "range": [ + 675, + 724 + ], + "loc": { + "start": { + "line": 27, + "column": 6 + }, + "end": { + "line": 27, + "column": 55 } } - ], + }, "range": [ 670, 725 @@ -1210,26 +1192,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Gymnopédie no. 1", - "range": [ - 734, - 750 - ], - "loc": { - "start": { - "line": 28, - "column": 8 - }, - "end": { - "line": 28, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "Gymnopédie no. 1", + "range": [ + 734, + 750 + ], + "loc": { + "start": { + "line": 28, + "column": 8 + }, + "end": { + "line": 28, + "column": 24 } } - ], + }, "range": [ 727, 751 @@ -1266,26 +1246,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Erik Satie", - "range": [ - 763, - 773 - ], - "loc": { - "start": { - "line": 29, - "column": 11 - }, - "end": { - "line": 29, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "Erik Satie", + "range": [ + 763, + 773 + ], + "loc": { + "start": { + "line": 29, + "column": 11 + }, + "end": { + "line": 29, + "column": 21 } } - ], + }, "range": [ 753, 774 @@ -1322,26 +1300,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Prodigal Procrastinator", - "range": [ - 787, - 810 - ], - "loc": { - "start": { - "line": 30, - "column": 12 - }, - "end": { - "line": 30, - "column": 35 - } + "value": { + "type": "SvelteLiteral", + "value": "Prodigal Procrastinator", + "range": [ + 787, + 810 + ], + "loc": { + "start": { + "line": 30, + "column": 12 + }, + "end": { + "line": 30, + "column": 35 } } - ], + }, "range": [ 776, 811 @@ -1490,26 +1466,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/beethoven.mp3", - "range": [ - 907, - 960 - ], - "loc": { - "start": { - "line": 35, - "column": 6 - }, - "end": { - "line": 35, - "column": 59 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/beethoven.mp3", + "range": [ + 907, + 960 + ], + "loc": { + "start": { + "line": 35, + "column": 6 + }, + "end": { + "line": 35, + "column": 59 } } - ], + }, "range": [ 902, 961 @@ -1546,26 +1520,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Symphony no. 5 in Cm, Op. 67 - I. Allegro con brio", - "range": [ - 970, - 1020 - ], - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 58 - } + "value": { + "type": "SvelteLiteral", + "value": "Symphony no. 5 in Cm, Op. 67 - I. Allegro con brio", + "range": [ + 970, + 1020 + ], + "loc": { + "start": { + "line": 36, + "column": 8 + }, + "end": { + "line": 36, + "column": 58 } } - ], + }, "range": [ 963, 1021 @@ -1602,26 +1574,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Ludwig van Beethoven", - "range": [ - 1033, - 1053 - ], - "loc": { - "start": { - "line": 37, - "column": 11 - }, - "end": { - "line": 37, - "column": 31 - } + "value": { + "type": "SvelteLiteral", + "value": "Ludwig van Beethoven", + "range": [ + 1033, + 1053 + ], + "loc": { + "start": { + "line": 37, + "column": 11 + }, + "end": { + "line": 37, + "column": 31 } } - ], + }, "range": [ 1023, 1054 @@ -1658,26 +1628,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "European Archive", - "range": [ - 1067, - 1083 - ], - "loc": { - "start": { - "line": 38, - "column": 12 - }, - "end": { - "line": 38, - "column": 28 - } + "value": { + "type": "SvelteLiteral", + "value": "European Archive", + "range": [ + 1067, + 1083 + ], + "loc": { + "start": { + "line": 38, + "column": 12 + }, + "end": { + "line": 38, + "column": 28 } } - ], + }, "range": [ 1056, 1084 @@ -1826,26 +1794,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/mozart.mp3", - "range": [ - 1175, - 1225 - ], - "loc": { - "start": { - "line": 43, - "column": 6 - }, - "end": { - "line": 43, - "column": 56 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/mozart.mp3", + "range": [ + 1175, + 1225 + ], + "loc": { + "start": { + "line": 43, + "column": 6 + }, + "end": { + "line": 43, + "column": 56 } } - ], + }, "range": [ 1170, 1226 @@ -1882,26 +1848,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Requiem in D minor, K. 626 - III. Sequence - Lacrymosa", - "range": [ - 1235, - 1289 - ], - "loc": { - "start": { - "line": 44, - "column": 8 - }, - "end": { - "line": 44, - "column": 62 - } + "value": { + "type": "SvelteLiteral", + "value": "Requiem in D minor, K. 626 - III. Sequence - Lacrymosa", + "range": [ + 1235, + 1289 + ], + "loc": { + "start": { + "line": 44, + "column": 8 + }, + "end": { + "line": 44, + "column": 62 } } - ], + }, "range": [ 1228, 1290 @@ -1938,26 +1902,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Wolfgang Amadeus Mozart", - "range": [ - 1302, - 1325 - ], - "loc": { - "start": { - "line": 45, - "column": 11 - }, - "end": { - "line": 45, - "column": 34 - } + "value": { + "type": "SvelteLiteral", + "value": "Wolfgang Amadeus Mozart", + "range": [ + 1302, + 1325 + ], + "loc": { + "start": { + "line": 45, + "column": 11 + }, + "end": { + "line": 45, + "column": 34 } } - ], + }, "range": [ 1292, 1326 @@ -1994,26 +1956,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Markus Staab", - "range": [ - 1339, - 1351 - ], - "loc": { - "start": { - "line": 46, - "column": 12 - }, - "end": { - "line": 46, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "Markus Staab", + "range": [ + 1339, + 1351 + ], + "loc": { + "start": { + "line": 46, + "column": 12 + }, + "end": { + "line": 46, + "column": 24 } } - ], + }, "range": [ 1328, 1352 diff --git a/tests/fixtures/parser/ast/tutorial/module-exports02-output.json b/tests/fixtures/parser/ast/tutorial/module-exports02-output.json index f4d9e458..51e5a310 100644 --- a/tests/fixtures/parser/ast/tutorial/module-exports02-output.json +++ b/tests/fixtures/parser/ast/tutorial/module-exports02-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "module", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "module", + "range": [ + 17, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 } } - ], + }, "range": [ 8, 24 @@ -2791,7 +2789,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 881, 889 diff --git a/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-output.json b/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-output.json index 58145081..b0a685fb 100644 --- a/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-output.json @@ -1305,26 +1305,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 357, - 362 - ], - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 357, + 362 + ], + "loc": { + "start": { + "line": 20, + "column": 13 + }, + "end": { + "line": 20, + "column": 18 } } - ], + }, "range": [ 352, 362 @@ -1434,45 +1432,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "1", - "value": 1, - "range": [ - 390, - 391 - ], - "loc": { - "start": { - "line": 20, - "column": 46 - }, - "end": { - "line": 20, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "1", + "value": 1, "range": [ - 389, - 392 + 390, + 391 ], "loc": { "start": { "line": 20, - "column": 45 + "column": 46 }, "end": { "line": 20, - "column": 48 + "column": 47 } } + }, + "range": [ + 389, + 392 + ], + "loc": { + "start": { + "line": 20, + "column": 45 + }, + "end": { + "line": 20, + "column": 48 + } } - ], + }, "range": [ 383, 392 @@ -1695,26 +1691,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 436, - 441 - ], - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 436, + 441 + ], + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 25, + "column": 18 } } - ], + }, "range": [ 431, 441 @@ -1824,45 +1818,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "2", - "value": 2, - "range": [ - 469, - 470 - ], - "loc": { - "start": { - "line": 25, - "column": 46 - }, - "end": { - "line": 25, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "2", + "value": 2, "range": [ - 468, - 471 + 469, + 470 ], "loc": { "start": { "line": 25, - "column": 45 + "column": 46 }, "end": { "line": 25, - "column": 48 + "column": 47 } } + }, + "range": [ + 468, + 471 + ], + "loc": { + "start": { + "line": 25, + "column": 45 + }, + "end": { + "line": 25, + "column": 48 + } } - ], + }, "range": [ 462, 471 @@ -2085,26 +2077,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "radio", - "range": [ - 516, - 521 - ], - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 30, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "radio", + "range": [ + 516, + 521 + ], + "loc": { + "start": { + "line": 30, + "column": 13 + }, + "end": { + "line": 30, + "column": 18 } } - ], + }, "range": [ 511, 521 @@ -2214,45 +2204,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "3", - "value": 3, - "range": [ - 549, - 550 - ], - "loc": { - "start": { - "line": 30, - "column": 46 - }, - "end": { - "line": 30, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "3", + "value": 3, "range": [ - 548, - 551 + 549, + 550 ], "loc": { "start": { "line": 30, - "column": 45 + "column": 46 }, "end": { "line": 30, - "column": 48 + "column": 47 } } + }, + "range": [ + 548, + 551 + ], + "loc": { + "start": { + "line": 30, + "column": 45 + }, + "end": { + "line": 30, + "column": 48 + } } - ], + }, "range": [ 542, 551 @@ -2526,7 +2514,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 604, 612 @@ -2737,44 +2725,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "flavour", - "range": [ - 678, - 685 - ], - "loc": { - "start": { - "line": 38, - "column": 17 - }, - "end": { - "line": 38, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "flavour", "range": [ - 677, - 686 + 678, + 685 ], "loc": { "start": { "line": 38, - "column": 16 + "column": 17 }, "end": { "line": 38, - "column": 25 + "column": 24 } } + }, + "range": [ + 677, + 686 + ], + "loc": { + "start": { + "line": 38, + "column": 16 + }, + "end": { + "line": 38, + "column": 25 + } } - ], + }, "range": [ 671, 686 diff --git a/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-scope-output.json b/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-scope-output.json index 02e1e272..d84548e2 100644 --- a/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-scope-output.json @@ -3496,44 +3496,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "flavour", - "range": [ - 678, - 685 - ], - "loc": { - "start": { - "line": 38, - "column": 17 - }, - "end": { - "line": 38, - "column": 24 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "flavour", "range": [ - 677, - 686 + 678, + 685 ], "loc": { "start": { "line": 38, - "column": 16 + "column": 17 }, "end": { "line": 38, - "column": 25 + "column": 24 } } + }, + "range": [ + 677, + 686 + ], + "loc": { + "start": { + "line": 38, + "column": 16 + }, + "end": { + "line": 38, + "column": 25 + } } - ], + }, "range": [ 671, 686 diff --git a/tests/fixtures/parser/ast/tutorial/named-slots01-output.json b/tests/fixtures/parser/ast/tutorial/named-slots01-output.json index ce150cd9..64e7e351 100644 --- a/tests/fixtures/parser/ast/tutorial/named-slots01-output.json +++ b/tests/fixtures/parser/ast/tutorial/named-slots01-output.json @@ -305,26 +305,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "name", - "range": [ - 130, - 134 - ], - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "name", + "range": [ + 130, + 134 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 17 } } - ], + }, "range": [ 124, 135 @@ -472,26 +470,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "address", - "range": [ - 173, - 180 - ], - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 20 - } + "value": { + "type": "SvelteLiteral", + "value": "address", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 20 } } - ], + }, "range": [ 167, 181 diff --git a/tests/fixtures/parser/ast/tutorial/named-slots02-output.json b/tests/fixtures/parser/ast/tutorial/named-slots02-output.json index 27b53f61..6fe94e48 100644 --- a/tests/fixtures/parser/ast/tutorial/named-slots02-output.json +++ b/tests/fixtures/parser/ast/tutorial/named-slots02-output.json @@ -155,26 +155,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "contact-card", - "range": [ - 574, - 586 - ], - "loc": { - "start": { - "line": 29, - "column": 16 - }, - "end": { - "line": 29, - "column": 28 - } + "value": { + "type": "SvelteLiteral", + "value": "contact-card", + "range": [ + 574, + 586 + ], + "loc": { + "start": { + "line": 29, + "column": 16 + }, + "end": { + "line": 29, + "column": 28 } } - ], + }, "range": [ 567, 587 @@ -330,26 +328,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "name", - "range": [ - 609, - 613 - ], - "loc": { - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 31, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "name", + "range": [ + 609, + 613 + ], + "loc": { + "start": { + "line": 31, + "column": 14 + }, + "end": { + "line": 31, + "column": 18 } } - ], + }, "range": [ 603, 614 @@ -446,26 +442,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "missing", - "range": [ - 632, - 639 - ], - "loc": { - "start": { - "line": 32, - "column": 16 - }, - "end": { - "line": 32, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "missing", + "range": [ + 632, + 639 + ], + "loc": { + "start": { + "line": 32, + "column": 16 + }, + "end": { + "line": 32, + "column": 23 } } - ], + }, "range": [ 625, 640 @@ -715,26 +709,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "address", - "range": [ - 692, - 699 - ], - "loc": { - "start": { - "line": 36, - "column": 13 - }, - "end": { - "line": 36, - "column": 20 - } + "value": { + "type": "SvelteLiteral", + "value": "address", + "range": [ + 692, + 699 + ], + "loc": { + "start": { + "line": 36, + "column": 13 + }, + "end": { + "line": 36, + "column": 20 } } - ], + }, "range": [ 685, 700 @@ -831,26 +823,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "address", - "range": [ - 716, - 723 - ], - "loc": { - "start": { - "line": 37, - "column": 14 - }, - "end": { - "line": 37, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "address", + "range": [ + 716, + 723 + ], + "loc": { + "start": { + "line": 37, + "column": 14 + }, + "end": { + "line": 37, + "column": 21 } } - ], + }, "range": [ 710, 724 @@ -947,26 +937,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "missing", - "range": [ - 742, - 749 - ], - "loc": { - "start": { - "line": 38, - "column": 16 - }, - "end": { - "line": 38, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "missing", + "range": [ + 742, + 749 + ], + "loc": { + "start": { + "line": 38, + "column": 16 + }, + "end": { + "line": 38, + "column": 23 } } - ], + }, "range": [ 735, 750 @@ -1216,26 +1204,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "email", - "range": [ - 806, - 811 - ], - "loc": { - "start": { - "line": 42, - "column": 13 - }, - "end": { - "line": 42, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "email", + "range": [ + 806, + 811 + ], + "loc": { + "start": { + "line": 42, + "column": 13 + }, + "end": { + "line": 42, + "column": 18 } } - ], + }, "range": [ 799, 812 @@ -1332,26 +1318,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "email", - "range": [ - 828, - 833 - ], - "loc": { - "start": { - "line": 43, - "column": 14 - }, - "end": { - "line": 43, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "email", + "range": [ + 828, + 833 + ], + "loc": { + "start": { + "line": 43, + "column": 14 + }, + "end": { + "line": 43, + "column": 19 } } - ], + }, "range": [ 822, 834 @@ -1448,26 +1432,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "missing", - "range": [ - 852, - 859 - ], - "loc": { - "start": { - "line": 44, - "column": 16 - }, - "end": { - "line": 44, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "missing", + "range": [ + 852, + 859 + ], + "loc": { + "start": { + "line": 44, + "column": 16 + }, + "end": { + "line": 44, + "column": 23 } } - ], + }, "range": [ 845, 860 diff --git a/tests/fixtures/parser/ast/tutorial/numeric-inputs01-output.json b/tests/fixtures/parser/ast/tutorial/numeric-inputs01-output.json index f8d9cd68..d2226ce7 100644 --- a/tests/fixtures/parser/ast/tutorial/numeric-inputs01-output.json +++ b/tests/fixtures/parser/ast/tutorial/numeric-inputs01-output.json @@ -344,26 +344,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 65, - 71 - ], - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 65, + 71 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 19 } } - ], + }, "range": [ 60, 71 @@ -400,44 +398,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "a", - "range": [ - 79, - 80 - ], - "loc": { - "start": { - "line": 7, - "column": 27 - }, - "end": { - "line": 7, - "column": 28 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "a", "range": [ - 78, - 81 + 79, + 80 ], "loc": { "start": { "line": 7, - "column": 26 + "column": 27 }, "end": { "line": 7, - "column": 29 + "column": 28 } } + }, + "range": [ + 78, + 81 + ], + "loc": { + "start": { + "line": 7, + "column": 26 + }, + "end": { + "line": 7, + "column": 29 + } } - ], + }, "range": [ 72, 81 @@ -474,26 +470,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 86, - 87 - ], - "loc": { - "start": { - "line": 7, - "column": 34 - }, - "end": { - "line": 7, - "column": 35 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 86, + 87 + ], + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 35 } } - ], + }, "range": [ 82, 87 @@ -530,26 +524,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 92, - 94 - ], - "loc": { - "start": { - "line": 7, - "column": 40 - }, - "end": { - "line": 7, - "column": 42 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 92, + 94 + ], + "loc": { + "start": { + "line": 7, + "column": 40 + }, + "end": { + "line": 7, + "column": 42 } } - ], + }, "range": [ 88, 94 @@ -662,26 +654,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 109, - 114 - ], - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 109, + 114 + ], + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 18 } } - ], + }, "range": [ 104, 114 @@ -718,44 +708,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "a", - "range": [ - 122, - 123 - ], - "loc": { - "start": { - "line": 8, - "column": 26 - }, - "end": { - "line": 8, - "column": 27 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "a", "range": [ - 121, - 124 + 122, + 123 ], "loc": { "start": { "line": 8, - "column": 25 + "column": 26 }, "end": { "line": 8, - "column": 28 + "column": 27 } } + }, + "range": [ + 121, + 124 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 28 + } } - ], + }, "range": [ 115, 124 @@ -792,26 +780,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 129, - 130 - ], - "loc": { - "start": { - "line": 8, - "column": 33 - }, - "end": { - "line": 8, - "column": 34 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 129, + 130 + ], + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 34 } } - ], + }, "range": [ 125, 130 @@ -848,26 +834,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 135, - 137 - ], - "loc": { - "start": { - "line": 8, - "column": 39 - }, - "end": { - "line": 8, - "column": 41 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 135, + 137 + ], + "loc": { + "start": { + "line": 8, + "column": 39 + }, + "end": { + "line": 8, + "column": 41 } } - ], + }, "range": [ 131, 137 @@ -1090,26 +1074,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 170, - 176 - ], - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 170, + 176 + ], + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 19 } } - ], + }, "range": [ 165, 176 @@ -1146,44 +1128,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "b", - "range": [ - 184, - 185 - ], - "loc": { - "start": { - "line": 12, - "column": 27 - }, - "end": { - "line": 12, - "column": 28 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "b", "range": [ - 183, - 186 + 184, + 185 ], "loc": { "start": { "line": 12, - "column": 26 + "column": 27 }, "end": { "line": 12, - "column": 29 + "column": 28 } } + }, + "range": [ + 183, + 186 + ], + "loc": { + "start": { + "line": 12, + "column": 26 + }, + "end": { + "line": 12, + "column": 29 + } } - ], + }, "range": [ 177, 186 @@ -1220,26 +1200,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 191, - 192 - ], - "loc": { - "start": { - "line": 12, - "column": 34 - }, - "end": { - "line": 12, - "column": 35 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 191, + 192 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 35 } } - ], + }, "range": [ 187, 192 @@ -1276,26 +1254,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 197, - 199 - ], - "loc": { - "start": { - "line": 12, - "column": 40 - }, - "end": { - "line": 12, - "column": 42 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 197, + 199 + ], + "loc": { + "start": { + "line": 12, + "column": 40 + }, + "end": { + "line": 12, + "column": 42 } } - ], + }, "range": [ 193, 199 @@ -1408,26 +1384,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 214, - 219 - ], - "loc": { - "start": { - "line": 13, - "column": 13 - }, - "end": { - "line": 13, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 214, + 219 + ], + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 18 } } - ], + }, "range": [ 209, 219 @@ -1464,44 +1438,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "b", - "range": [ - 227, - 228 - ], - "loc": { - "start": { - "line": 13, - "column": 26 - }, - "end": { - "line": 13, - "column": 27 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "b", "range": [ - 226, - 229 + 227, + 228 ], "loc": { "start": { "line": 13, - "column": 25 + "column": 26 }, "end": { "line": 13, - "column": 28 + "column": 27 } } + }, + "range": [ + 226, + 229 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 28 + } } - ], + }, "range": [ 220, 229 @@ -1538,26 +1510,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 234, - 235 - ], - "loc": { - "start": { - "line": 13, - "column": 33 - }, - "end": { - "line": 13, - "column": 34 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 234, + 235 + ], + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 34 } } - ], + }, "range": [ 230, 235 @@ -1594,26 +1564,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 240, - 242 - ], - "loc": { - "start": { - "line": 13, - "column": 39 - }, - "end": { - "line": 13, - "column": 41 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 240, + 242 + ], + "loc": { + "start": { + "line": 13, + "column": 39 + }, + "end": { + "line": 13, + "column": 41 } } - ], + }, "range": [ 236, 242 diff --git a/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json b/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json index 4ea74674..6d188777 100644 --- a/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json +++ b/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json @@ -344,26 +344,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 65, - 71 - ], - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 65, + 71 + ], + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 19 } } - ], + }, "range": [ 60, 71 @@ -473,26 +471,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 91, - 92 - ], - "loc": { - "start": { - "line": 7, - "column": 39 - }, - "end": { - "line": 7, - "column": 40 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 91, + 92 + ], + "loc": { + "start": { + "line": 7, + "column": 39 + }, + "end": { + "line": 7, + "column": 40 } } - ], + }, "range": [ 87, 92 @@ -529,26 +525,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 97, - 99 - ], - "loc": { - "start": { - "line": 7, - "column": 45 - }, - "end": { - "line": 7, - "column": 47 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 97, + 99 + ], + "loc": { + "start": { + "line": 7, + "column": 45 + }, + "end": { + "line": 7, + "column": 47 } } - ], + }, "range": [ 93, 99 @@ -661,26 +655,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 114, - 119 - ], - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 114, + 119 + ], + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 18 } } - ], + }, "range": [ 109, 119 @@ -790,26 +782,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 139, - 140 - ], - "loc": { - "start": { - "line": 8, - "column": 38 - }, - "end": { - "line": 8, - "column": 39 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 139, + 140 + ], + "loc": { + "start": { + "line": 8, + "column": 38 + }, + "end": { + "line": 8, + "column": 39 } } - ], + }, "range": [ 135, 140 @@ -846,26 +836,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 145, - 147 - ], - "loc": { - "start": { - "line": 8, - "column": 44 - }, - "end": { - "line": 8, - "column": 46 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 145, + 147 + ], + "loc": { + "start": { + "line": 8, + "column": 44 + }, + "end": { + "line": 8, + "column": 46 } } - ], + }, "range": [ 141, 147 @@ -1088,26 +1076,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "number", - "range": [ - 180, - 186 - ], - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "number", + "range": [ + 180, + 186 + ], + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 19 } } - ], + }, "range": [ 175, 186 @@ -1217,26 +1203,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 206, - 207 - ], - "loc": { - "start": { - "line": 12, - "column": 39 - }, - "end": { - "line": 12, - "column": 40 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 206, + 207 + ], + "loc": { + "start": { + "line": 12, + "column": 39 + }, + "end": { + "line": 12, + "column": 40 } } - ], + }, "range": [ 202, 207 @@ -1273,26 +1257,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 212, - 214 - ], - "loc": { - "start": { - "line": 12, - "column": 45 - }, - "end": { - "line": 12, - "column": 47 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 212, + 214 + ], + "loc": { + "start": { + "line": 12, + "column": 45 + }, + "end": { + "line": 12, + "column": 47 } } - ], + }, "range": [ 208, 214 @@ -1405,26 +1387,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 229, - 234 - ], - "loc": { - "start": { - "line": 13, - "column": 13 - }, - "end": { - "line": 13, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 229, + 234 + ], + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 18 } } - ], + }, "range": [ 224, 234 @@ -1534,26 +1514,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 254, - 255 - ], - "loc": { - "start": { - "line": 13, - "column": 38 - }, - "end": { - "line": 13, - "column": 39 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 254, + 255 + ], + "loc": { + "start": { + "line": 13, + "column": 38 + }, + "end": { + "line": 13, + "column": 39 } } - ], + }, "range": [ 250, 255 @@ -1590,26 +1568,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "10", - "range": [ - 260, - 262 - ], - "loc": { - "start": { - "line": 13, - "column": 44 - }, - "end": { - "line": 13, - "column": 46 - } + "value": { + "type": "SvelteLiteral", + "value": "10", + "range": [ + 260, + 262 + ], + "loc": { + "start": { + "line": 13, + "column": 44 + }, + "end": { + "line": 13, + "column": 46 } } - ], + }, "range": [ 256, 262 diff --git a/tests/fixtures/parser/ast/tutorial/onmount-output.json b/tests/fixtures/parser/ast/tutorial/onmount-output.json index 2a802b95..14472bc1 100644 --- a/tests/fixtures/parser/ast/tutorial/onmount-output.json +++ b/tests/fixtures/parser/ast/tutorial/onmount-output.json @@ -912,26 +912,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "photos", - "range": [ - 419, - 425 - ], - "loc": { - "start": { - "line": 28, - "column": 12 - }, - "end": { - "line": 28, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "photos", + "range": [ + 419, + 425 + ], + "loc": { + "start": { + "line": 28, + "column": 12 + }, + "end": { + "line": 28, + "column": 18 } } - ], + }, "range": [ 412, 426 @@ -1128,59 +1126,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "photo", - "range": [ - 477, - 482 - ], - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 18 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "thumbnailUrl", - "range": [ - 483, - 495 - ], - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "photo", "range": [ 477, - 495 + 482 ], "loc": { "start": { "line": 31, "column": 13 }, + "end": { + "line": 31, + "column": 18 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "thumbnailUrl", + "range": [ + 483, + 495 + ], + "loc": { + "start": { + "line": 31, + "column": 19 + }, "end": { "line": 31, "column": 31 @@ -1188,21 +1170,35 @@ } }, "range": [ - 476, - 496 + 477, + 495 ], "loc": { "start": { "line": 31, - "column": 12 + "column": 13 }, "end": { "line": 31, - "column": 32 + "column": 31 } } + }, + "range": [ + 476, + 496 + ], + "loc": { + "start": { + "line": 31, + "column": 12 + }, + "end": { + "line": 31, + "column": 32 + } } - ], + }, "range": [ 472, 496 @@ -1239,59 +1235,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "photo", - "range": [ - 502, - 507 - ], - "loc": { - "start": { - "line": 31, - "column": 38 - }, - "end": { - "line": 31, - "column": 43 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "title", - "range": [ - 508, - 513 - ], - "loc": { - "start": { - "line": 31, - "column": 44 - }, - "end": { - "line": 31, - "column": 49 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "photo", "range": [ 502, - 513 + 507 ], "loc": { "start": { "line": 31, "column": 38 }, + "end": { + "line": 31, + "column": 43 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "title", + "range": [ + 508, + 513 + ], + "loc": { + "start": { + "line": 31, + "column": 44 + }, "end": { "line": 31, "column": 49 @@ -1299,21 +1279,35 @@ } }, "range": [ - 501, - 514 + 502, + 513 ], "loc": { "start": { "line": 31, - "column": 37 + "column": 38 }, "end": { "line": 31, - "column": 50 + "column": 49 } } + }, + "range": [ + 501, + 514 + ], + "loc": { + "start": { + "line": 31, + "column": 37 + }, + "end": { + "line": 31, + "column": 50 + } } - ], + }, "range": [ 497, 514 diff --git a/tests/fixtures/parser/ast/tutorial/onmount-scope-output.json b/tests/fixtures/parser/ast/tutorial/onmount-scope-output.json index f5fc6fca..7b82c494 100644 --- a/tests/fixtures/parser/ast/tutorial/onmount-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/onmount-scope-output.json @@ -1178,59 +1178,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "photo", - "range": [ - 477, - 482 - ], - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 18 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "thumbnailUrl", - "range": [ - 483, - 495 - ], - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "photo", "range": [ 477, - 495 + 482 ], "loc": { "start": { "line": 31, "column": 13 }, + "end": { + "line": 31, + "column": 18 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "thumbnailUrl", + "range": [ + 483, + 495 + ], + "loc": { + "start": { + "line": 31, + "column": 19 + }, "end": { "line": 31, "column": 31 @@ -1238,21 +1222,35 @@ } }, "range": [ - 476, - 496 + 477, + 495 ], "loc": { "start": { "line": 31, - "column": 12 + "column": 13 }, "end": { "line": 31, - "column": 32 + "column": 31 } } + }, + "range": [ + 476, + 496 + ], + "loc": { + "start": { + "line": 31, + "column": 12 + }, + "end": { + "line": 31, + "column": 32 + } } - ], + }, "range": [ 472, 496 @@ -1289,59 +1287,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "photo", - "range": [ - 502, - 507 - ], - "loc": { - "start": { - "line": 31, - "column": 38 - }, - "end": { - "line": 31, - "column": 43 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "title", - "range": [ - 508, - 513 - ], - "loc": { - "start": { - "line": 31, - "column": 44 - }, - "end": { - "line": 31, - "column": 49 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "photo", "range": [ 502, - 513 + 507 ], "loc": { "start": { "line": 31, "column": 38 }, + "end": { + "line": 31, + "column": 43 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "title", + "range": [ + 508, + 513 + ], + "loc": { + "start": { + "line": 31, + "column": 44 + }, "end": { "line": 31, "column": 49 @@ -1349,21 +1331,35 @@ } }, "range": [ - 501, - 514 + 502, + 513 ], "loc": { "start": { "line": 31, - "column": 37 + "column": 38 }, "end": { "line": 31, - "column": 50 + "column": 49 } } + }, + "range": [ + 501, + 514 + ], + "loc": { + "start": { + "line": 31, + "column": 37 + }, + "end": { + "line": 31, + "column": 50 + } } - ], + }, "range": [ 497, 514 diff --git a/tests/fixtures/parser/ast/tutorial/optional-slots01-output.json b/tests/fixtures/parser/ast/tutorial/optional-slots01-output.json index cb49a424..d7663aa4 100644 --- a/tests/fixtures/parser/ast/tutorial/optional-slots01-output.json +++ b/tests/fixtures/parser/ast/tutorial/optional-slots01-output.json @@ -620,26 +620,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Add Typescript support", - "range": [ - 435, - 457 - ], - "loc": { - "start": { - "line": 39, - "column": 10 - }, - "end": { - "line": 39, - "column": 32 - } + "value": { + "type": "SvelteLiteral", + "value": "Add Typescript support", + "range": [ + 435, + 457 + ], + "loc": { + "start": { + "line": 39, + "column": 10 + }, + "end": { + "line": 39, + "column": 32 } } - ], + }, "range": [ 428, 458 @@ -676,45 +674,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "25", - "value": 25, - "range": [ - 478, - 480 - ], - "loc": { - "start": { - "line": 40, - "column": 19 - }, - "end": { - "line": 40, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "25", + "value": 25, "range": [ - 477, - 481 + 478, + 480 ], "loc": { "start": { "line": 40, - "column": 18 + "column": 19 }, "end": { "line": 40, - "column": 22 + "column": 21 } } + }, + "range": [ + 477, + 481 + ], + "loc": { + "start": { + "line": 40, + "column": 18 + }, + "end": { + "line": 40, + "column": 22 + } } - ], + }, "range": [ 462, 481 @@ -751,45 +747,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "57", - "value": 57, - "range": [ - 497, - 499 - ], - "loc": { - "start": { - "line": 41, - "column": 15 - }, - "end": { - "line": 41, - "column": 17 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "57", + "value": 57, "range": [ - 496, - 500 + 497, + 499 ], "loc": { "start": { "line": 41, - "column": 14 + "column": 15 }, "end": { "line": 41, - "column": 18 + "column": 17 } } + }, + "range": [ + 496, + 500 + ], + "loc": { + "start": { + "line": 41, + "column": 14 + }, + "end": { + "line": 41, + "column": 18 + } } - ], + }, "range": [ 485, 500 @@ -886,26 +880,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "comments", - "range": [ - 519, - 527 - ], - "loc": { - "start": { - "line": 43, - "column": 14 - }, - "end": { - "line": 43, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "comments", + "range": [ + 519, + 527 + ], + "loc": { + "start": { + "line": 43, + "column": 14 + }, + "end": { + "line": 43, + "column": 22 } } - ], + }, "range": [ 513, 528 @@ -1002,26 +994,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Ecma Script", - "range": [ - 549, - 560 - ], - "loc": { - "start": { - "line": 44, - "column": 19 - }, - "end": { - "line": 44, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "Ecma Script", + "range": [ + 549, + 560 + ], + "loc": { + "start": { + "line": 44, + "column": 19 + }, + "end": { + "line": 44, + "column": 30 } } - ], + }, "range": [ 543, 561 @@ -1058,82 +1048,80 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "NewExpression", - "arguments": [ - { - "type": "Literal", - "raw": "'2020-08-17T14:12:23'", - "value": "2020-08-17T14:12:23", - "range": [ - 581, - 602 - ], - "loc": { - "start": { - "line": 44, - "column": 51 - }, - "end": { - "line": 44, - "column": 72 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "Date", + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "NewExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'2020-08-17T14:12:23'", + "value": "2020-08-17T14:12:23", "range": [ - 576, - 580 + 581, + 602 ], "loc": { "start": { "line": 44, - "column": 46 + "column": 51 }, "end": { "line": 44, - "column": 50 + "column": 72 } } - }, + } + ], + "callee": { + "type": "Identifier", + "name": "Date", "range": [ - 572, - 603 + 576, + 580 ], "loc": { "start": { "line": 44, - "column": 42 + "column": 46 }, "end": { "line": 44, - "column": 73 + "column": 50 } } }, "range": [ - 571, - 604 + 572, + 603 ], "loc": { "start": { "line": 44, - "column": 41 + "column": 42 }, "end": { "line": 44, - "column": 74 + "column": 73 } } + }, + "range": [ + 571, + 604 + ], + "loc": { + "start": { + "line": 44, + "column": 41 + }, + "end": { + "line": 44, + "column": 74 + } } - ], + }, "range": [ 562, 604 @@ -1603,26 +1591,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Update documentation", - "range": [ - 729, - 749 - ], - "loc": { - "start": { - "line": 52, - "column": 10 - }, - "end": { - "line": 52, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "Update documentation", + "range": [ + 729, + 749 + ], + "loc": { + "start": { + "line": 52, + "column": 10 + }, + "end": { + "line": 52, + "column": 30 } } - ], + }, "range": [ 722, 750 @@ -1659,45 +1645,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "18", - "value": 18, - "range": [ - 770, - 772 - ], - "loc": { - "start": { - "line": 53, - "column": 19 - }, - "end": { - "line": 53, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "18", + "value": 18, "range": [ - 769, - 773 + 770, + 772 ], "loc": { "start": { "line": 53, - "column": 18 + "column": 19 }, "end": { "line": 53, - "column": 22 + "column": 21 } } + }, + "range": [ + 769, + 773 + ], + "loc": { + "start": { + "line": 53, + "column": 18 + }, + "end": { + "line": 53, + "column": 22 + } } - ], + }, "range": [ 754, 773 @@ -1734,45 +1718,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "21", - "value": 21, - "range": [ - 789, - 791 - ], - "loc": { - "start": { - "line": 54, - "column": 15 - }, - "end": { - "line": 54, - "column": 17 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "21", + "value": 21, "range": [ - 788, - 792 + 789, + 791 ], "loc": { "start": { "line": 54, - "column": 14 + "column": 15 }, "end": { "line": 54, - "column": 18 + "column": 17 } } + }, + "range": [ + 788, + 792 + ], + "loc": { + "start": { + "line": 54, + "column": 14 + }, + "end": { + "line": 54, + "column": 18 + } } - ], + }, "range": [ 777, 792 diff --git a/tests/fixtures/parser/ast/tutorial/optional-slots02-output.json b/tests/fixtures/parser/ast/tutorial/optional-slots02-output.json index 468608ad..5051ce18 100644 --- a/tests/fixtures/parser/ast/tutorial/optional-slots02-output.json +++ b/tests/fixtures/parser/ast/tutorial/optional-slots02-output.json @@ -725,26 +725,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "header", - "range": [ - 619, - 625 - ], - "loc": { - "start": { - "line": 46, - "column": 13 - }, - "end": { - "line": 46, - "column": 19 - } + "value": { + "type": "SvelteLiteral", + "value": "header", + "range": [ + 619, + 625 + ], + "loc": { + "start": { + "line": 46, + "column": 13 + }, + "end": { + "line": 46, + "column": 19 } } - ], + }, "range": [ 612, 626 @@ -841,44 +839,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "avatar", - "range": [ - 640, - 646 - ], - "loc": { - "start": { - "line": 47, - "column": 12 - }, - "end": { - "line": 47, - "column": 18 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "avatar", "range": [ - 639, - 647 + 640, + 646 ], "loc": { "start": { "line": 47, - "column": 11 + "column": 12 }, "end": { "line": 47, - "column": 19 + "column": 18 } } + }, + "range": [ + 639, + 647 + ], + "loc": { + "start": { + "line": 47, + "column": 11 + }, + "end": { + "line": 47, + "column": 19 + } } - ], + }, "range": [ 635, 647 @@ -915,7 +911,7 @@ } }, "boolean": false, - "value": [], + "value": null, "range": [ 648, 654 @@ -952,26 +948,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "32", - "range": [ - 663, - 665 - ], - "loc": { - "start": { - "line": 47, - "column": 35 - }, - "end": { - "line": 47, - "column": 37 - } + "value": { + "type": "SvelteLiteral", + "value": "32", + "range": [ + 663, + 665 + ], + "loc": { + "start": { + "line": 47, + "column": 35 + }, + "end": { + "line": 47, + "column": 37 } } - ], + }, "range": [ 655, 666 @@ -1008,26 +1002,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "32", - "range": [ - 674, - 676 - ], - "loc": { - "start": { - "line": 47, - "column": 46 - }, - "end": { - "line": 47, - "column": 48 - } + "value": { + "type": "SvelteLiteral", + "value": "32", + "range": [ + 674, + 676 + ], + "loc": { + "start": { + "line": 47, + "column": 46 + }, + "end": { + "line": 47, + "column": 48 } } - ], + }, "range": [ 667, 677 @@ -1140,26 +1132,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "details", - "range": [ - 693, - 700 - ], - "loc": { - "start": { - "line": 48, - "column": 14 - }, - "end": { - "line": 48, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "details", + "range": [ + 693, + 700 + ], + "loc": { + "start": { + "line": 48, + "column": 14 + }, + "end": { + "line": 48, + "column": 21 } } - ], + }, "range": [ 686, 701 @@ -1384,56 +1374,21 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "CallExpression", - "arguments": [], - "callee": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "postedAt", - "range": [ - 741, - 749 - ], - "loc": { - "start": { - "line": 50, - "column": 19 - }, - "end": { - "line": 50, - "column": 27 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "toISOString", - "range": [ - 750, - 761 - ], - "loc": { - "start": { - "line": 50, - "column": 28 - }, - "end": { - "line": 50, - "column": 39 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "postedAt", "range": [ 741, - 761 + 749 ], "loc": { "start": { @@ -1442,14 +1397,32 @@ }, "end": { "line": 50, - "column": 39 + "column": 27 } } }, "optional": false, + "property": { + "type": "Identifier", + "name": "toISOString", + "range": [ + 750, + 761 + ], + "loc": { + "start": { + "line": 50, + "column": 28 + }, + "end": { + "line": 50, + "column": 39 + } + } + }, "range": [ 741, - 763 + 761 ], "loc": { "start": { @@ -1458,26 +1431,41 @@ }, "end": { "line": 50, - "column": 41 + "column": 39 } } }, + "optional": false, "range": [ - 740, - 764 + 741, + 763 ], "loc": { "start": { "line": 50, - "column": 18 + "column": 19 }, "end": { "line": 50, - "column": 42 + "column": 41 } } + }, + "range": [ + 740, + 764 + ], + "loc": { + "start": { + "line": 50, + "column": 18 + }, + "end": { + "line": 50, + "column": 42 + } } - ], + }, "range": [ 731, 764 @@ -1801,26 +1789,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "body", - "range": [ - 834, - 838 - ], - "loc": { - "start": { - "line": 53, - "column": 13 - }, - "end": { - "line": 53, - "column": 17 - } + "value": { + "type": "SvelteLiteral", + "value": "body", + "range": [ + 834, + 838 + ], + "loc": { + "start": { + "line": 53, + "column": 13 + }, + "end": { + "line": 53, + "column": 17 } } - ], + }, "range": [ 827, 839 diff --git a/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json b/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json index 16291204..5bbd532f 100644 --- a/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json +++ b/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json @@ -1174,26 +1174,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "discussion", - "range": [ - 904, - 914 - ], - "loc": { - "start": { - "line": 59, - "column": 14 - }, - "end": { - "line": 59, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "discussion", + "range": [ + 904, + 914 + ], + "loc": { + "start": { + "line": 59, + "column": 14 + }, + "end": { + "line": 59, + "column": 24 } } - ], + }, "range": [ 897, 915 @@ -1400,26 +1398,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "comments", - "range": [ - 953, - 961 - ], - "loc": { - "start": { - "line": 61, - "column": 15 - }, - "end": { - "line": 61, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "comments", + "range": [ + 953, + 961 + ], + "loc": { + "start": { + "line": 61, + "column": 15 + }, + "end": { + "line": 61, + "column": 23 } } - ], + }, "range": [ 947, 962 diff --git a/tests/fixtures/parser/ast/tutorial/select-bindings-output.json b/tests/fixtures/parser/ast/tutorial/select-bindings-output.json index cebda0aa..3f4fdfc9 100644 --- a/tests/fixtures/parser/ast/tutorial/select-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/select-bindings-output.json @@ -1823,44 +1823,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "question", - "range": [ - 657, - 665 - ], - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "question", "range": [ - 656, - 666 + 657, + 665 ], "loc": { "start": { "line": 26, - "column": 17 + "column": 18 }, "end": { "line": 26, - "column": 27 + "column": 26 } } + }, + "range": [ + 656, + 666 + ], + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 26, + "column": 27 + } } - ], + }, "range": [ 650, 666 @@ -2316,40 +2314,22 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "UnaryExpression", - "argument": { - "type": "Identifier", - "name": "answer", - "range": [ - 773, - 779 - ], - "loc": { - "start": { - "line": 34, - "column": 20 - }, - "end": { - "line": 34, - "column": 26 - } - } - }, - "operator": "!", - "prefix": true, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "UnaryExpression", + "argument": { + "type": "Identifier", + "name": "answer", "range": [ - 772, + 773, 779 ], "loc": { "start": { "line": 34, - "column": 19 + "column": 20 }, "end": { "line": 34, @@ -2357,22 +2337,38 @@ } } }, + "operator": "!", + "prefix": true, "range": [ - 771, - 780 + 772, + 779 ], "loc": { "start": { "line": 34, - "column": 18 + "column": 19 }, "end": { "line": 34, - "column": 27 + "column": 26 } } + }, + "range": [ + 771, + 780 + ], + "loc": { + "start": { + "line": 34, + "column": 18 + }, + "end": { + "line": 34, + "column": 27 + } } - ], + }, "range": [ 762, 780 @@ -2409,26 +2405,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "submit", - "range": [ - 786, - 792 - ], - "loc": { - "start": { - "line": 34, - "column": 33 - }, - "end": { - "line": 34, - "column": 39 - } + "value": { + "type": "SvelteLiteral", + "value": "submit", + "range": [ + 786, + 792 + ], + "loc": { + "start": { + "line": 34, + "column": 33 + }, + "end": { + "line": 34, + "column": 39 } } - ], + }, "range": [ 781, 792 diff --git a/tests/fixtures/parser/ast/tutorial/select-bindings-scope-output.json b/tests/fixtures/parser/ast/tutorial/select-bindings-scope-output.json index 7df7d267..26d8c48a 100644 --- a/tests/fixtures/parser/ast/tutorial/select-bindings-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/select-bindings-scope-output.json @@ -2592,44 +2592,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "question", - "range": [ - 657, - 665 - ], - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "question", "range": [ - 656, - 666 + 657, + 665 ], "loc": { "start": { "line": 26, - "column": 17 + "column": 18 }, "end": { "line": 26, - "column": 27 + "column": 26 } } + }, + "range": [ + 656, + 666 + ], + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 26, + "column": 27 + } } - ], + }, "range": [ 650, 666 diff --git a/tests/fixtures/parser/ast/tutorial/sharing-code01-output.json b/tests/fixtures/parser/ast/tutorial/sharing-code01-output.json index 55c80c40..ac6d2c57 100644 --- a/tests/fixtures/parser/ast/tutorial/sharing-code01-output.json +++ b/tests/fixtures/parser/ast/tutorial/sharing-code01-output.json @@ -246,26 +246,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/strauss.mp3", - "range": [ - 152, - 203 - ], - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 57 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/strauss.mp3", + "range": [ + 152, + 203 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 57 } } - ], + }, "range": [ 147, 204 @@ -302,26 +300,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "The Blue Danube Waltz", - "range": [ - 213, - 234 - ], - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 29 - } + "value": { + "type": "SvelteLiteral", + "value": "The Blue Danube Waltz", + "range": [ + 213, + 234 + ], + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 29 } } - ], + }, "range": [ 206, 235 @@ -358,26 +354,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Johann Strauss", - "range": [ - 247, - 261 - ], - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 25 - } + "value": { + "type": "SvelteLiteral", + "value": "Johann Strauss", + "range": [ + 247, + 261 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 25 } } - ], + }, "range": [ 237, 262 @@ -414,26 +408,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "European Archive", - "range": [ - 275, - 291 - ], - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 28 - } + "value": { + "type": "SvelteLiteral", + "value": "European Archive", + "range": [ + 275, + 291 + ], + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 28 } } - ], + }, "range": [ 264, 292 @@ -582,26 +574,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/holst.mp3", - "range": [ - 376, - 425 - ], - "loc": { - "start": { - "line": 15, - "column": 6 - }, - "end": { - "line": 15, - "column": 55 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/holst.mp3", + "range": [ + 376, + 425 + ], + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 55 } } - ], + }, "range": [ 371, 426 @@ -638,26 +628,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Mars, the Bringer of War", - "range": [ - 435, - 459 - ], - "loc": { - "start": { - "line": 16, - "column": 8 - }, - "end": { - "line": 16, - "column": 32 - } + "value": { + "type": "SvelteLiteral", + "value": "Mars, the Bringer of War", + "range": [ + 435, + 459 + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 32 } } - ], + }, "range": [ 428, 460 @@ -694,26 +682,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Gustav Holst", - "range": [ - 472, - 484 - ], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "Gustav Holst", + "range": [ + 472, + 484 + ], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 23 } } - ], + }, "range": [ 462, 485 @@ -750,26 +736,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "USAF Heritage of America Band", - "range": [ - 498, - 527 - ], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 41 - } + "value": { + "type": "SvelteLiteral", + "value": "USAF Heritage of America Band", + "range": [ + 498, + 527 + ], + "loc": { + "start": { + "line": 18, + "column": 12 + }, + "end": { + "line": 18, + "column": 41 } } - ], + }, "range": [ 487, 528 @@ -918,26 +902,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/satie.mp3", - "range": [ - 607, - 656 - ], - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 55 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/satie.mp3", + "range": [ + 607, + 656 + ], + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 55 } } - ], + }, "range": [ 602, 657 @@ -974,26 +956,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Gymnopédie no. 1", - "range": [ - 666, - 682 - ], - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "Gymnopédie no. 1", + "range": [ + 666, + 682 + ], + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 24 } } - ], + }, "range": [ 659, 683 @@ -1030,26 +1010,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Erik Satie", - "range": [ - 695, - 705 - ], - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 21 - } + "value": { + "type": "SvelteLiteral", + "value": "Erik Satie", + "range": [ + 695, + 705 + ], + "loc": { + "start": { + "line": 25, + "column": 11 + }, + "end": { + "line": 25, + "column": 21 } } - ], + }, "range": [ 685, 706 @@ -1086,26 +1064,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Prodigal Procrastinator", - "range": [ - 719, - 742 - ], - "loc": { - "start": { - "line": 26, - "column": 12 - }, - "end": { - "line": 26, - "column": 35 - } + "value": { + "type": "SvelteLiteral", + "value": "Prodigal Procrastinator", + "range": [ + 719, + 742 + ], + "loc": { + "start": { + "line": 26, + "column": 12 + }, + "end": { + "line": 26, + "column": 35 } } - ], + }, "range": [ 708, 743 @@ -1254,26 +1230,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/beethoven.mp3", - "range": [ - 839, - 892 - ], - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 31, - "column": 59 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/beethoven.mp3", + "range": [ + 839, + 892 + ], + "loc": { + "start": { + "line": 31, + "column": 6 + }, + "end": { + "line": 31, + "column": 59 } } - ], + }, "range": [ 834, 893 @@ -1310,26 +1284,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Symphony no. 5 in Cm, Op. 67 - I. Allegro con brio", - "range": [ - 902, - 952 - ], - "loc": { - "start": { - "line": 32, - "column": 8 - }, - "end": { - "line": 32, - "column": 58 - } + "value": { + "type": "SvelteLiteral", + "value": "Symphony no. 5 in Cm, Op. 67 - I. Allegro con brio", + "range": [ + 902, + 952 + ], + "loc": { + "start": { + "line": 32, + "column": 8 + }, + "end": { + "line": 32, + "column": 58 } } - ], + }, "range": [ 895, 953 @@ -1366,26 +1338,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Ludwig van Beethoven", - "range": [ - 965, - 985 - ], - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 31 - } + "value": { + "type": "SvelteLiteral", + "value": "Ludwig van Beethoven", + "range": [ + 965, + 985 + ], + "loc": { + "start": { + "line": 33, + "column": 11 + }, + "end": { + "line": 33, + "column": 31 } } - ], + }, "range": [ 955, 986 @@ -1422,26 +1392,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "European Archive", - "range": [ - 999, - 1015 - ], - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 34, - "column": 28 - } + "value": { + "type": "SvelteLiteral", + "value": "European Archive", + "range": [ + 999, + 1015 + ], + "loc": { + "start": { + "line": 34, + "column": 12 + }, + "end": { + "line": 34, + "column": 28 } } - ], + }, "range": [ 988, 1016 @@ -1590,26 +1558,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://sveltejs.github.io/assets/music/mozart.mp3", - "range": [ - 1107, - 1157 - ], - "loc": { - "start": { - "line": 39, - "column": 6 - }, - "end": { - "line": 39, - "column": 56 - } + "value": { + "type": "SvelteLiteral", + "value": "https://sveltejs.github.io/assets/music/mozart.mp3", + "range": [ + 1107, + 1157 + ], + "loc": { + "start": { + "line": 39, + "column": 6 + }, + "end": { + "line": 39, + "column": 56 } } - ], + }, "range": [ 1102, 1158 @@ -1646,26 +1612,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Requiem in D minor, K. 626 - III. Sequence - Lacrymosa", - "range": [ - 1167, - 1221 - ], - "loc": { - "start": { - "line": 40, - "column": 8 - }, - "end": { - "line": 40, - "column": 62 - } + "value": { + "type": "SvelteLiteral", + "value": "Requiem in D minor, K. 626 - III. Sequence - Lacrymosa", + "range": [ + 1167, + 1221 + ], + "loc": { + "start": { + "line": 40, + "column": 8 + }, + "end": { + "line": 40, + "column": 62 } } - ], + }, "range": [ 1160, 1222 @@ -1702,26 +1666,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Wolfgang Amadeus Mozart", - "range": [ - 1234, - 1257 - ], - "loc": { - "start": { - "line": 41, - "column": 11 - }, - "end": { - "line": 41, - "column": 34 - } + "value": { + "type": "SvelteLiteral", + "value": "Wolfgang Amadeus Mozart", + "range": [ + 1234, + 1257 + ], + "loc": { + "start": { + "line": 41, + "column": 11 + }, + "end": { + "line": 41, + "column": 34 } } - ], + }, "range": [ 1224, 1258 @@ -1758,26 +1720,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Markus Staab", - "range": [ - 1271, - 1283 - ], - "loc": { - "start": { - "line": 42, - "column": 12 - }, - "end": { - "line": 42, - "column": 24 - } + "value": { + "type": "SvelteLiteral", + "value": "Markus Staab", + "range": [ + 1271, + 1283 + ], + "loc": { + "start": { + "line": 42, + "column": 12 + }, + "end": { + "line": 42, + "column": 24 } } - ], + }, "range": [ 1260, 1284 diff --git a/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json b/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json index daff598b..4baa89f9 100644 --- a/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json +++ b/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json @@ -45,26 +45,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "module", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "module", + "range": [ + 17, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 } } - ], + }, "range": [ 8, 24 @@ -1962,7 +1960,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 645, 653 diff --git a/tests/fixtures/parser/ast/tutorial/slot-fallbacks02-output.json b/tests/fixtures/parser/ast/tutorial/slot-fallbacks02-output.json index e8d30fd0..d93df33c 100644 --- a/tests/fixtures/parser/ast/tutorial/slot-fallbacks02-output.json +++ b/tests/fixtures/parser/ast/tutorial/slot-fallbacks02-output.json @@ -155,26 +155,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "box", - "range": [ - 185, - 188 - ], - "loc": { - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 12, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "box", + "range": [ + 185, + 188 + ], + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 15 } } - ], + }, "range": [ 178, 189 diff --git a/tests/fixtures/parser/ast/tutorial/slot-props02-output.json b/tests/fixtures/parser/ast/tutorial/slot-props02-output.json index 220a1c69..59d6c9fa 100644 --- a/tests/fixtures/parser/ast/tutorial/slot-props02-output.json +++ b/tests/fixtures/parser/ast/tutorial/slot-props02-output.json @@ -657,44 +657,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "hovering", - "range": [ - 189, - 197 - ], - "loc": { - "start": { - "line": 14, - "column": 17 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "hovering", "range": [ - 188, - 198 + 189, + 197 ], "loc": { "start": { "line": 14, - "column": 16 + "column": 17 }, "end": { "line": 14, - "column": 26 + "column": 25 } } + }, + "range": [ + 188, + 198 + ], + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 26 + } } - ], + }, "range": [ 179, 198 diff --git a/tests/fixtures/parser/ast/tutorial/slots02-output.json b/tests/fixtures/parser/ast/tutorial/slots02-output.json index c8ffff41..ab8129d2 100644 --- a/tests/fixtures/parser/ast/tutorial/slots02-output.json +++ b/tests/fixtures/parser/ast/tutorial/slots02-output.json @@ -155,26 +155,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "box", - "range": [ - 185, - 188 - ], - "loc": { - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 12, - "column": 15 - } + "value": { + "type": "SvelteLiteral", + "value": "box", + "range": [ + 185, + 188 + ], + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 15 } } - ], + }, "range": [ 178, 189 diff --git a/tests/fixtures/parser/ast/tutorial/spread-props01-output.json b/tests/fixtures/parser/ast/tutorial/spread-props01-output.json index f31212c4..045edaf1 100644 --- a/tests/fixtures/parser/ast/tutorial/spread-props01-output.json +++ b/tests/fixtures/parser/ast/tutorial/spread-props01-output.json @@ -516,59 +516,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "pkg", - "range": [ - 171, - 174 - ], - "loc": { - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 12, - "column": 15 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "name", - "range": [ - 175, - 179 - ], - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 20 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "pkg", "range": [ 171, - 179 + 174 ], "loc": { "start": { "line": 12, "column": 12 }, + "end": { + "line": 12, + "column": 15 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 175, + 179 + ], + "loc": { + "start": { + "line": 12, + "column": 16 + }, "end": { "line": 12, "column": 20 @@ -576,21 +560,35 @@ } }, "range": [ - 170, - 180 + 171, + 179 ], "loc": { "start": { "line": 12, - "column": 11 + "column": 12 }, "end": { "line": 12, - "column": 21 + "column": 20 } } + }, + "range": [ + 170, + 180 + ], + "loc": { + "start": { + "line": 12, + "column": 11 + }, + "end": { + "line": 12, + "column": 21 + } } - ], + }, "range": [ 165, 180 @@ -627,59 +625,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "pkg", - "range": [ - 190, - 193 - ], - "loc": { - "start": { - "line": 12, - "column": 31 - }, - "end": { - "line": 12, - "column": 34 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "version", - "range": [ - 194, - 201 - ], - "loc": { - "start": { - "line": 12, - "column": 35 - }, - "end": { - "line": 12, - "column": 42 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "pkg", "range": [ 190, - 201 + 193 ], "loc": { "start": { "line": 12, "column": 31 }, + "end": { + "line": 12, + "column": 34 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "version", + "range": [ + 194, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 35 + }, "end": { "line": 12, "column": 42 @@ -687,21 +669,35 @@ } }, "range": [ - 189, - 202 + 190, + 201 ], "loc": { "start": { "line": 12, - "column": 30 + "column": 31 }, "end": { "line": 12, - "column": 43 + "column": 42 } } + }, + "range": [ + 189, + 202 + ], + "loc": { + "start": { + "line": 12, + "column": 30 + }, + "end": { + "line": 12, + "column": 43 + } } - ], + }, "range": [ 181, 202 @@ -738,59 +734,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "pkg", - "range": [ - 210, - 213 - ], - "loc": { - "start": { - "line": 12, - "column": 51 - }, - "end": { - "line": 12, - "column": 54 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "speed", - "range": [ - 214, - 219 - ], - "loc": { - "start": { - "line": 12, - "column": 55 - }, - "end": { - "line": 12, - "column": 60 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "pkg", "range": [ 210, - 219 + 213 ], "loc": { "start": { "line": 12, "column": 51 }, + "end": { + "line": 12, + "column": 54 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "speed", + "range": [ + 214, + 219 + ], + "loc": { + "start": { + "line": 12, + "column": 55 + }, "end": { "line": 12, "column": 60 @@ -798,21 +778,35 @@ } }, "range": [ - 209, - 220 + 210, + 219 ], "loc": { "start": { "line": 12, - "column": 50 + "column": 51 }, "end": { "line": 12, - "column": 61 + "column": 60 } } + }, + "range": [ + 209, + 220 + ], + "loc": { + "start": { + "line": 12, + "column": 50 + }, + "end": { + "line": 12, + "column": 61 + } } - ], + }, "range": [ 203, 220 @@ -849,59 +843,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "pkg", - "range": [ - 230, - 233 - ], - "loc": { - "start": { - "line": 12, - "column": 71 - }, - "end": { - "line": 12, - "column": 74 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "website", - "range": [ - 234, - 241 - ], - "loc": { - "start": { - "line": 12, - "column": 75 - }, - "end": { - "line": 12, - "column": 82 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "pkg", "range": [ 230, - 241 + 233 ], "loc": { "start": { "line": 12, "column": 71 }, + "end": { + "line": 12, + "column": 74 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "website", + "range": [ + 234, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 75 + }, "end": { "line": 12, "column": 82 @@ -909,21 +887,35 @@ } }, "range": [ - 229, - 242 + 230, + 241 ], "loc": { "start": { "line": 12, - "column": 70 + "column": 71 }, "end": { "line": 12, - "column": 83 + "column": 82 } } + }, + "range": [ + 229, + 242 + ], + "loc": { + "start": { + "line": 12, + "column": 70 + }, + "end": { + "line": 12, + "column": 83 + } } - ], + }, "range": [ 221, 242 diff --git a/tests/fixtures/parser/ast/tutorial/spread-props02-output.json b/tests/fixtures/parser/ast/tutorial/spread-props02-output.json index a5d2ff19..de5adbf9 100644 --- a/tests/fixtures/parser/ast/tutorial/spread-props02-output.json +++ b/tests/fixtures/parser/ast/tutorial/spread-props02-output.json @@ -732,62 +732,79 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.npmjs.com/package/", - "range": [ - 195, - 225 - ], - "loc": { - "start": { - "line": 10, - "column": 42 - }, - "end": { - "line": 10, - "column": 72 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "name", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.npmjs.com/package/", "range": [ - 226, - 230 + 195, + 225 ], "loc": { "start": { "line": 10, - "column": 73 + "column": 42 }, "end": { "line": 10, - "column": 77 + "column": 72 } } }, - "range": [ - 225, - 231 - ], - "loc": { - "start": { - "line": 10, - "column": 72 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "name", + "range": [ + 226, + 230 + ], + "loc": { + "start": { + "line": 10, + "column": 73 + }, + "end": { + "line": 10, + "column": 77 + } + } }, - "end": { - "line": 10, - "column": 78 + "range": [ + 225, + 231 + ], + "loc": { + "start": { + "line": 10, + "column": 72 + }, + "end": { + "line": 10, + "column": 78 + } } } + ], + "range": [ + 195, + 231 + ], + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 78 + } } - ], + }, "range": [ 189, 232 @@ -935,44 +952,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "website", - "range": [ - 255, - 262 - ], - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "website", "range": [ - 254, - 263 + 255, + 262 ], "loc": { "start": { "line": 11, - "column": 13 + "column": 14 }, "end": { "line": 11, - "column": 22 + "column": 21 } } + }, + "range": [ + 254, + 263 + ], + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 22 + } } - ], + }, "range": [ 249, 263 diff --git a/tests/fixtures/parser/ast/tutorial/spring-output.json b/tests/fixtures/parser/ast/tutorial/spring-output.json index a683a286..e85cdb65 100644 --- a/tests/fixtures/parser/ast/tutorial/spring-output.json +++ b/tests/fixtures/parser/ast/tutorial/spring-output.json @@ -812,26 +812,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "position: absolute; right: 1em;", - "range": [ - 272, - 303 - ], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 43 - } + "value": { + "type": "SvelteLiteral", + "value": "position: absolute; right: 1em;", + "range": [ + 272, + 303 + ], + "loc": { + "start": { + "line": 16, + "column": 12 + }, + "end": { + "line": 16, + "column": 43 } } - ], + }, "range": [ 265, 304 @@ -1298,26 +1296,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 402, - 407 - ], - "loc": { - "start": { - "line": 19, - "column": 45 - }, - "end": { - "line": 19, - "column": 50 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 402, + 407 + ], + "loc": { + "start": { + "line": 19, + "column": 45 + }, + "end": { + "line": 19, + "column": 50 } } - ], + }, "range": [ 396, 408 @@ -1354,26 +1350,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 414, - 415 - ], - "loc": { - "start": { - "line": 19, - "column": 57 - }, - "end": { - "line": 19, - "column": 58 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 414, + 415 + ], + "loc": { + "start": { + "line": 19, + "column": 57 + }, + "end": { + "line": 19, + "column": 58 } } - ], + }, "range": [ 409, 416 @@ -1410,26 +1404,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "1", - "range": [ - 422, - 423 - ], - "loc": { - "start": { - "line": 19, - "column": 65 - }, - "end": { - "line": 19, - "column": 66 - } + "value": { + "type": "SvelteLiteral", + "value": "1", + "range": [ + 422, + 423 + ], + "loc": { + "start": { + "line": 19, + "column": 65 + }, + "end": { + "line": 19, + "column": 66 } } - ], + }, "range": [ 417, 424 @@ -1466,26 +1458,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0.01", - "range": [ - 431, - 435 - ], - "loc": { - "start": { - "line": 19, - "column": 74 - }, - "end": { - "line": 19, - "column": 78 - } + "value": { + "type": "SvelteLiteral", + "value": "0.01", + "range": [ + 431, + 435 + ], + "loc": { + "start": { + "line": 19, + "column": 74 + }, + "end": { + "line": 19, + "column": 78 } } - ], + }, "range": [ 425, 436 @@ -2019,26 +2009,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "range", - "range": [ - 539, - 544 - ], - "loc": { - "start": { - "line": 24, - "column": 43 - }, - "end": { - "line": 24, - "column": 48 - } + "value": { + "type": "SvelteLiteral", + "value": "range", + "range": [ + 539, + 544 + ], + "loc": { + "start": { + "line": 24, + "column": 43 + }, + "end": { + "line": 24, + "column": 48 } } - ], + }, "range": [ 533, 545 @@ -2075,26 +2063,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0", - "range": [ - 551, - 552 - ], - "loc": { - "start": { - "line": 24, - "column": 55 - }, - "end": { - "line": 24, - "column": 56 - } + "value": { + "type": "SvelteLiteral", + "value": "0", + "range": [ + 551, + 552 + ], + "loc": { + "start": { + "line": 24, + "column": 55 + }, + "end": { + "line": 24, + "column": 56 } } - ], + }, "range": [ 546, 553 @@ -2131,26 +2117,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "1", - "range": [ - 559, - 560 - ], - "loc": { - "start": { - "line": 24, - "column": 63 - }, - "end": { - "line": 24, - "column": 64 - } + "value": { + "type": "SvelteLiteral", + "value": "1", + "range": [ + 559, + 560 + ], + "loc": { + "start": { + "line": 24, + "column": 63 + }, + "end": { + "line": 24, + "column": 64 } } - ], + }, "range": [ 554, 561 @@ -2187,26 +2171,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "0.01", - "range": [ - 568, - 572 - ], - "loc": { - "start": { - "line": 24, - "column": 72 - }, - "end": { - "line": 24, - "column": 76 - } + "value": { + "type": "SvelteLiteral", + "value": "0.01", + "range": [ + 568, + 572 + ], + "loc": { + "start": { + "line": 24, + "column": 72 + }, + "end": { + "line": 24, + "column": 76 } } - ], + }, "range": [ 562, 573 @@ -3198,59 +3180,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "$coords", - "range": [ - 751, - 758 - ], - "loc": { - "start": { - "line": 33, - "column": 13 - }, - "end": { - "line": 33, - "column": 20 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "x", - "range": [ - 759, - 760 - ], - "loc": { - "start": { - "line": 33, - "column": 21 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$coords", "range": [ 751, - 760 + 758 ], "loc": { "start": { "line": 33, "column": 13 }, + "end": { + "line": 33, + "column": 20 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "x", + "range": [ + 759, + 760 + ], + "loc": { + "start": { + "line": 33, + "column": 21 + }, "end": { "line": 33, "column": 22 @@ -3258,21 +3224,35 @@ } }, "range": [ - 750, - 761 + 751, + 760 ], "loc": { "start": { "line": 33, - "column": 12 + "column": 13 }, "end": { "line": 33, - "column": 23 + "column": 22 } } + }, + "range": [ + 750, + 761 + ], + "loc": { + "start": { + "line": 33, + "column": 12 + }, + "end": { + "line": 33, + "column": 23 + } } - ], + }, "range": [ 747, 761 @@ -3309,59 +3289,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "$coords", - "range": [ - 766, - 773 - ], - "loc": { - "start": { - "line": 33, - "column": 28 - }, - "end": { - "line": 33, - "column": 35 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "y", - "range": [ - 774, - 775 - ], - "loc": { - "start": { - "line": 33, - "column": 36 - }, - "end": { - "line": 33, - "column": 37 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "$coords", "range": [ 766, - 775 + 773 ], "loc": { "start": { "line": 33, "column": 28 }, + "end": { + "line": 33, + "column": 35 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "y", + "range": [ + 774, + 775 + ], + "loc": { + "start": { + "line": 33, + "column": 36 + }, "end": { "line": 33, "column": 37 @@ -3369,21 +3333,35 @@ } }, "range": [ - 765, - 776 + 766, + 775 ], "loc": { "start": { "line": 33, - "column": 27 + "column": 28 }, "end": { "line": 33, - "column": 38 + "column": 37 } } + }, + "range": [ + 765, + 776 + ], + "loc": { + "start": { + "line": 33, + "column": 27 + }, + "end": { + "line": 33, + "column": 38 + } } - ], + }, "range": [ 762, 776 @@ -3420,44 +3398,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "$size", - "range": [ - 780, - 785 - ], - "loc": { - "start": { - "line": 33, - "column": 42 - }, - "end": { - "line": 33, - "column": 47 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "$size", "range": [ - 779, - 786 + 780, + 785 ], "loc": { "start": { "line": 33, - "column": 41 + "column": 42 }, "end": { "line": 33, - "column": 48 + "column": 47 } } + }, + "range": [ + 779, + 786 + ], + "loc": { + "start": { + "line": 33, + "column": 41 + }, + "end": { + "line": 33, + "column": 48 + } } - ], + }, "range": [ 777, 786 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-body-output.json b/tests/fixtures/parser/ast/tutorial/svelte-body-output.json index ef83418c..ab621f49 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-body-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-body-output.json @@ -913,26 +913,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Kitten wants to know what's going on", - "range": [ - 638, - 674 - ], - "loc": { - "start": { - "line": 35, - "column": 6 - }, - "end": { - "line": 35, - "column": 42 - } + "value": { + "type": "SvelteLiteral", + "value": "Kitten wants to know what's going on", + "range": [ + 638, + 674 + ], + "loc": { + "start": { + "line": 35, + "column": 6 + }, + "end": { + "line": 35, + "column": 42 } } - ], + }, "range": [ 633, 675 @@ -969,26 +967,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "tutorial/kitten.png", - "range": [ - 682, - 701 - ], - "loc": { - "start": { - "line": 36, - "column": 6 - }, - "end": { - "line": 36, - "column": 25 - } + "value": { + "type": "SvelteLiteral", + "value": "tutorial/kitten.png", + "range": [ + 682, + 701 + ], + "loc": { + "start": { + "line": 36, + "column": 6 + }, + "end": { + "line": 36, + "column": 25 } } - ], + }, "range": [ 677, 702 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-component-output.json b/tests/fixtures/parser/ast/tutorial/svelte-component-output.json index 39c82d44..9582b9cc 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-component-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-component-output.json @@ -1117,44 +1117,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "option", - "range": [ - 418, - 424 - ], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "option", "range": [ - 417, - 425 + 418, + 424 ], "loc": { "start": { "line": 17, - "column": 16 + "column": 17 }, "end": { "line": 17, - "column": 24 + "column": 23 } } + }, + "range": [ + 417, + 425 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 24 + } } - ], + }, "range": [ 411, 425 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-component-scope-output.json b/tests/fixtures/parser/ast/tutorial/svelte-component-scope-output.json index a3748aef..0be353f9 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-component-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-component-scope-output.json @@ -1773,44 +1773,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "option", - "range": [ - 418, - 424 - ], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "option", "range": [ - 417, - 425 + 418, + 424 ], "loc": { "start": { "line": 17, - "column": 16 + "column": 17 }, "end": { "line": 17, - "column": 24 + "column": 23 } } + }, + "range": [ + 417, + 425 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 24 + } } - ], + }, "range": [ 411, 425 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-element-output.json b/tests/fixtures/parser/ast/tutorial/svelte-element-output.json index fa459ba7..3f4bc52c 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-element-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-element-output.json @@ -553,44 +553,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "option", - "range": [ - 159, - 165 - ], - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 23 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "option", "range": [ - 158, - 166 + 159, + 165 ], "loc": { "start": { "line": 8, - "column": 16 + "column": 17 }, "end": { "line": 8, - "column": 24 + "column": 23 } } + }, + "range": [ + 158, + 166 + ], + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 24 + } } - ], + }, "range": [ 152, 166 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-element-scope-output.json b/tests/fixtures/parser/ast/tutorial/svelte-element-scope-output.json index 1ffb9b82..a5515e84 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-element-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-element-scope-output.json @@ -1019,44 +1019,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "option", - "range": [ - 159, - 165 - ], - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 23 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "option", "range": [ - 158, - 166 + 159, + 165 ], "loc": { "start": { "line": 8, - "column": 16 + "column": 17 }, "end": { "line": 8, - "column": 24 + "column": 23 } } + }, + "range": [ + 158, + 166 + ], + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 24 + } } - ], + }, "range": [ 152, 166 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-fragment-output.json b/tests/fixtures/parser/ast/tutorial/svelte-fragment-output.json index 0090fb32..d7ee2f67 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-fragment-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-fragment-output.json @@ -269,26 +269,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "footer", - "range": [ - 82, - 88 - ], - "loc": { - "start": { - "line": 6, - "column": 24 - }, - "end": { - "line": 6, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "footer", + "range": [ + 82, + 88 + ], + "loc": { + "start": { + "line": 6, + "column": 24 + }, + "end": { + "line": 6, + "column": 30 } } - ], + }, "range": [ 76, 89 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-head-output.json b/tests/fixtures/parser/ast/tutorial/svelte-head-output.json index 5f31c0a8..858bd3b4 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-head-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-head-output.json @@ -105,26 +105,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "stylesheet", - "range": [ - 26, - 36 - ], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "stylesheet", + "range": [ + 26, + 36 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 22 } } - ], + }, "range": [ 21, 37 @@ -161,26 +159,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "tutorial/dark-theme.css", - "range": [ - 44, - 67 - ], - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 53 - } + "value": { + "type": "SvelteLiteral", + "value": "tutorial/dark-theme.css", + "range": [ + 44, + 67 + ], + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 53 } } - ], + }, "range": [ 38, 68 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json b/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json index f76bbbf5..e648622d 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json @@ -46,45 +46,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Literal", - "raw": "true", - "value": true, - "range": [ - 27, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "true", + "value": true, "range": [ - 26, - 32 + 27, + 31 ], "loc": { "start": { "line": 1, - "column": 26 + "column": 27 }, "end": { "line": 1, - "column": 32 + "column": 31 } } + }, + "range": [ + 26, + 32 + ], + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } } - ], + }, "range": [ 16, 32 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json b/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json index a94c5a1d..26836ace 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json @@ -46,7 +46,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 16, 25 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-self01-output.json b/tests/fixtures/parser/ast/tutorial/svelte-self01-output.json index 31fc3cca..897dae5e 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-self01-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-self01-output.json @@ -2271,26 +2271,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "Home", - "range": [ - 806, - 810 - ], - "loc": { - "start": { - "line": 41, - "column": 14 - }, - "end": { - "line": 41, - "column": 18 - } + "value": { + "type": "SvelteLiteral", + "value": "Home", + "range": [ + 806, + 810 + ], + "loc": { + "start": { + "line": 41, + "column": 14 + }, + "end": { + "line": 41, + "column": 18 } } - ], + }, "range": [ 800, 811 @@ -2327,44 +2325,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "root", - "range": [ - 819, - 823 - ], - "loc": { - "start": { - "line": 41, - "column": 27 - }, - "end": { - "line": 41, - "column": 31 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "root", "range": [ - 818, - 824 + 819, + 823 ], "loc": { "start": { "line": 41, - "column": 26 + "column": 27 }, "end": { "line": 41, - "column": 32 + "column": 31 } } + }, + "range": [ + 818, + 824 + ], + "loc": { + "start": { + "line": 41, + "column": 26 + }, + "end": { + "line": 41, + "column": 32 + } } - ], + }, "range": [ 812, 824 @@ -2401,7 +2397,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 825, 833 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-self02-output.json b/tests/fixtures/parser/ast/tutorial/svelte-self02-output.json index 6a906ec3..85051932 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-self02-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-self02-output.json @@ -615,80 +615,97 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "background-image: url(tutorial/icons/", - "range": [ - 215, - 252 - ], - "loc": { - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 14, - "column": 50 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "type", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "background-image: url(tutorial/icons/", "range": [ - 253, - 257 + 215, + 252 ], "loc": { "start": { "line": 14, - "column": 51 + "column": 13 }, "end": { "line": 14, - "column": 55 + "column": 50 } } }, - "range": [ - 252, - 258 - ], - "loc": { - "start": { - "line": 14, - "column": 50 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "type", + "range": [ + 253, + 257 + ], + "loc": { + "start": { + "line": 14, + "column": 51 + }, + "end": { + "line": 14, + "column": 55 + } + } }, - "end": { - "line": 14, - "column": 56 + "range": [ + 252, + 258 + ], + "loc": { + "start": { + "line": 14, + "column": 50 + }, + "end": { + "line": 14, + "column": 56 + } } - } - }, - { - "type": "SvelteLiteral", - "value": ".svg)", - "range": [ - 258, - 263 - ], - "loc": { - "start": { - "line": 14, - "column": 56 - }, - "end": { - "line": 14, - "column": 61 + }, + { + "type": "SvelteLiteral", + "value": ".svg)", + "range": [ + 258, + 263 + ], + "loc": { + "start": { + "line": 14, + "column": 56 + }, + "end": { + "line": 14, + "column": 61 + } } } + ], + "range": [ + 215, + 263 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 61 + } } - ], + }, "range": [ 208, 264 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-output.json b/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-output.json index 9a6c12cf..4c4de6b8 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-output.json @@ -587,26 +587,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "parallax-container", - "range": [ - 119, - 137 - ], - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 28 - } + "value": { + "type": "SvelteLiteral", + "value": "parallax-container", + "range": [ + 119, + 137 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 28 } } - ], + }, "range": [ 112, 138 @@ -643,26 +641,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.firewatchgame.com", - "range": [ - 145, - 174 - ], - "loc": { - "start": { - "line": 9, - "column": 36 - }, - "end": { - "line": 9, - "column": 65 - } + "value": { + "type": "SvelteLiteral", + "value": "https://www.firewatchgame.com", + "range": [ + 145, + 174 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 65 } } - ], + }, "range": [ 139, 175 @@ -800,45 +796,64 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "transform: translate(0,", - "range": [ - 219, - 242 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 33 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "transform: translate(0,", + "range": [ + 219, + 242 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 33 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "BinaryExpression", - "left": { + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { "type": "BinaryExpression", "left": { - "type": "UnaryExpression", - "argument": { - "type": "Identifier", - "name": "y", + "type": "BinaryExpression", + "left": { + "type": "UnaryExpression", + "argument": { + "type": "Identifier", + "name": "y", + "range": [ + 244, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 35 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "operator": "-", + "prefix": true, "range": [ - 244, + 243, 245 ], "loc": { "start": { "line": 12, - "column": 35 + "column": 34 }, "end": { "line": 12, @@ -846,11 +861,28 @@ } } }, - "operator": "-", - "prefix": true, + "operator": "*", + "right": { + "type": "Identifier", + "name": "layer", + "range": [ + 248, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 39 + }, + "end": { + "line": 12, + "column": 44 + } + } + }, "range": [ 243, - 245 + 253 ], "loc": { "start": { @@ -859,56 +891,56 @@ }, "end": { "line": 12, - "column": 36 + "column": 44 } } }, - "operator": "*", + "operator": "/", "right": { - "type": "Identifier", - "name": "layer", - "range": [ - 248, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 39 + "type": "BinaryExpression", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "layers", + "range": [ + 257, + 263 + ], + "loc": { + "start": { + "line": 12, + "column": 48 + }, + "end": { + "line": 12, + "column": 54 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "length", + "range": [ + 264, + 270 + ], + "loc": { + "start": { + "line": 12, + "column": 55 + }, + "end": { + "line": 12, + "column": 61 + } + } }, - "end": { - "line": 12, - "column": 44 - } - } - }, - "range": [ - 243, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 34 - }, - "end": { - "line": 12, - "column": 44 - } - } - }, - "operator": "/", - "right": { - "type": "BinaryExpression", - "left": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "layers", "range": [ 257, - 263 + 270 ], "loc": { "start": { @@ -917,57 +949,38 @@ }, "end": { "line": 12, - "column": 54 + "column": 61 } } }, - "optional": false, - "property": { - "type": "Identifier", - "name": "length", + "operator": "-", + "right": { + "type": "Literal", + "raw": "1", + "value": 1, "range": [ - 264, - 270 + 273, + 274 ], "loc": { "start": { "line": 12, - "column": 55 + "column": 64 }, "end": { "line": 12, - "column": 61 + "column": 65 } } }, "range": [ 257, - 270 - ], - "loc": { - "start": { - "line": 12, - "column": 48 - }, - "end": { - "line": 12, - "column": 61 - } - } - }, - "operator": "-", - "right": { - "type": "Literal", - "raw": "1", - "value": 1, - "range": [ - 273, 274 ], "loc": { "start": { "line": 12, - "column": 64 + "column": 48 }, "end": { "line": 12, @@ -976,69 +989,69 @@ } }, "range": [ - 257, - 274 + 243, + 275 ], "loc": { "start": { "line": 12, - "column": 48 + "column": 34 }, "end": { "line": 12, - "column": 65 + "column": 66 } } }, "range": [ - 243, - 275 + 242, + 276 ], "loc": { "start": { "line": 12, - "column": 34 + "column": 33 }, "end": { "line": 12, - "column": 66 + "column": 67 } } }, - "range": [ - 242, - 276 - ], - "loc": { - "start": { - "line": 12, - "column": 33 - }, - "end": { - "line": 12, - "column": 67 + { + "type": "SvelteLiteral", + "value": "px)", + "range": [ + 276, + 279 + ], + "loc": { + "start": { + "line": 12, + "column": 67 + }, + "end": { + "line": 12, + "column": 70 + } } } - }, - { - "type": "SvelteLiteral", - "value": "px)", - "range": [ - 276, - 279 - ], - "loc": { - "start": { - "line": 12, - "column": 67 - }, - "end": { - "line": 12, - "column": 70 - } + ], + "range": [ + 219, + 279 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 70 } } - ], + }, "range": [ 212, 280 @@ -1075,80 +1088,97 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.firewatchgame.com/images/parallax/parallax", - "range": [ - 289, - 343 - ], - "loc": { - "start": { - "line": 13, - "column": 8 - }, - "end": { - "line": 13, - "column": 62 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "layer", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.firewatchgame.com/images/parallax/parallax", "range": [ - 344, - 349 + 289, + 343 ], "loc": { "start": { "line": 13, - "column": 63 + "column": 8 }, "end": { "line": 13, - "column": 68 + "column": 62 } } }, - "range": [ - 343, - 350 - ], - "loc": { - "start": { - "line": 13, - "column": 62 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "layer", + "range": [ + 344, + 349 + ], + "loc": { + "start": { + "line": 13, + "column": 63 + }, + "end": { + "line": 13, + "column": 68 + } + } }, - "end": { - "line": 13, - "column": 69 + "range": [ + 343, + 350 + ], + "loc": { + "start": { + "line": 13, + "column": 62 + }, + "end": { + "line": 13, + "column": 69 + } } - } - }, - { - "type": "SvelteLiteral", - "value": ".png", - "range": [ - 350, - 354 - ], - "loc": { - "start": { - "line": 13, - "column": 69 - }, - "end": { - "line": 13, - "column": 73 + }, + { + "type": "SvelteLiteral", + "value": ".png", + "range": [ + 350, + 354 + ], + "loc": { + "start": { + "line": 13, + "column": 69 + }, + "end": { + "line": 13, + "column": 73 + } } } + ], + "range": [ + 289, + 354 + ], + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 73 + } } - ], + }, "range": [ 284, 355 @@ -1185,62 +1215,79 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "parallax layer ", - "range": [ - 364, - 379 - ], - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 23 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "layer", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "parallax layer ", "range": [ - 380, - 385 + 364, + 379 ], "loc": { "start": { "line": 14, - "column": 24 + "column": 8 }, "end": { "line": 14, - "column": 29 + "column": 23 } } }, - "range": [ - 379, - 386 - ], - "loc": { - "start": { - "line": 14, - "column": 23 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "layer", + "range": [ + 380, + 385 + ], + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 29 + } + } }, - "end": { - "line": 14, - "column": 30 + "range": [ + 379, + 386 + ], + "loc": { + "start": { + "line": 14, + "column": 23 + }, + "end": { + "line": 14, + "column": 30 + } } } + ], + "range": [ + 364, + 386 + ], + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 30 + } } - ], + }, "range": [ 359, 387 @@ -1421,26 +1468,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "text", - "range": [ - 419, - 423 - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "text", + "range": [ + 419, + 423 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 16 } } - ], + }, "range": [ 412, 424 @@ -1537,161 +1582,178 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "opacity: ", - "range": [ - 440, - 449 - ], - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 23 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "opacity: ", + "range": [ + 440, + 449 + ], + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 23 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "raw": "1", - "value": 1, - "range": [ - 450, - 451 - ], - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 25 + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "BinaryExpression", + "left": { + "type": "Literal", + "raw": "1", + "value": 1, + "range": [ + 450, + 451 + ], + "loc": { + "start": { + "line": 20, + "column": 24 + }, + "end": { + "line": 20, + "column": 25 + } } - } - }, - "operator": "-", - "right": { - "type": "CallExpression", - "arguments": [ - { - "type": "Literal", - "raw": "0", - "value": 0, - "range": [ - 463, - 464 - ], - "loc": { - "start": { - "line": 20, - "column": 37 + }, + "operator": "-", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "0", + "value": 0, + "range": [ + 463, + 464 + ], + "loc": { + "start": { + "line": 20, + "column": 37 + }, + "end": { + "line": 20, + "column": 38 + } + } + }, + { + "type": "BinaryExpression", + "left": { + "type": "Identifier", + "name": "y", + "range": [ + 466, + 467 + ], + "loc": { + "start": { + "line": 20, + "column": 40 + }, + "end": { + "line": 20, + "column": 41 + } + } }, - "end": { - "line": 20, - "column": 38 + "operator": "/", + "right": { + "type": "Literal", + "raw": "40", + "value": 40, + "range": [ + 470, + 472 + ], + "loc": { + "start": { + "line": 20, + "column": 44 + }, + "end": { + "line": 20, + "column": 46 + } + } + }, + "range": [ + 466, + 472 + ], + "loc": { + "start": { + "line": 20, + "column": 40 + }, + "end": { + "line": 20, + "column": 46 + } } } - }, - { - "type": "BinaryExpression", - "left": { + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { "type": "Identifier", - "name": "y", + "name": "Math", "range": [ - 466, - 467 + 454, + 458 ], "loc": { "start": { "line": 20, - "column": 40 + "column": 28 }, "end": { "line": 20, - "column": 41 + "column": 32 } } }, - "operator": "/", - "right": { - "type": "Literal", - "raw": "40", - "value": 40, + "optional": false, + "property": { + "type": "Identifier", + "name": "max", "range": [ - 470, - 472 + 459, + 462 ], "loc": { "start": { "line": 20, - "column": 44 + "column": 33 }, "end": { "line": 20, - "column": 46 + "column": 36 } } }, - "range": [ - 466, - 472 - ], - "loc": { - "start": { - "line": 20, - "column": 40 - }, - "end": { - "line": 20, - "column": 46 - } - } - } - ], - "callee": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "Math", "range": [ 454, - 458 - ], - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "max", - "range": [ - 459, 462 ], "loc": { "start": { "line": 20, - "column": 33 + "column": 28 }, "end": { "line": 20, @@ -1699,9 +1761,10 @@ } } }, + "optional": false, "range": [ 454, - 462 + 473 ], "loc": { "start": { @@ -1710,19 +1773,18 @@ }, "end": { "line": 20, - "column": 36 + "column": 47 } } }, - "optional": false, "range": [ - 454, + 450, 473 ], "loc": { "start": { "line": 20, - "column": 28 + "column": 24 }, "end": { "line": 20, @@ -1731,36 +1793,36 @@ } }, "range": [ - 450, - 473 + 449, + 474 ], "loc": { "start": { "line": 20, - "column": 24 + "column": 23 }, "end": { "line": 20, - "column": 47 + "column": 48 } } + } + ], + "range": [ + 440, + 474 + ], + "loc": { + "start": { + "line": 20, + "column": 14 }, - "range": [ - 449, - 474 - ], - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 48 - } + "end": { + "line": 20, + "column": 48 } } - ], + }, "range": [ 433, 475 @@ -1908,26 +1970,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "foreground", - "range": [ - 514, - 524 - ], - "loc": { - "start": { - "line": 24, - "column": 13 - }, - "end": { - "line": 24, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "foreground", + "range": [ + 514, + 524 + ], + "loc": { + "start": { + "line": 24, + "column": 13 + }, + "end": { + "line": 24, + "column": 23 } } - ], + }, "range": [ 507, 525 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-scope-output.json b/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-scope-output.json index 9f544b73..b55d4769 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-scope-output.json @@ -1021,45 +1021,64 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "transform: translate(0,", - "range": [ - 219, - 242 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 33 + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "transform: translate(0,", + "range": [ + 219, + 242 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 33 + } } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "BinaryExpression", - "left": { + }, + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { "type": "BinaryExpression", "left": { - "type": "UnaryExpression", - "argument": { - "type": "Identifier", - "name": "y", + "type": "BinaryExpression", + "left": { + "type": "UnaryExpression", + "argument": { + "type": "Identifier", + "name": "y", + "range": [ + 244, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 35 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "operator": "-", + "prefix": true, "range": [ - 244, + 243, 245 ], "loc": { "start": { "line": 12, - "column": 35 + "column": 34 }, "end": { "line": 12, @@ -1067,11 +1086,28 @@ } } }, - "operator": "-", - "prefix": true, + "operator": "*", + "right": { + "type": "Identifier", + "name": "layer", + "range": [ + 248, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 39 + }, + "end": { + "line": 12, + "column": 44 + } + } + }, "range": [ 243, - 245 + 253 ], "loc": { "start": { @@ -1080,56 +1116,56 @@ }, "end": { "line": 12, - "column": 36 + "column": 44 } } }, - "operator": "*", + "operator": "/", "right": { - "type": "Identifier", - "name": "layer", - "range": [ - 248, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 39 + "type": "BinaryExpression", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "layers", + "range": [ + 257, + 263 + ], + "loc": { + "start": { + "line": 12, + "column": 48 + }, + "end": { + "line": 12, + "column": 54 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "length", + "range": [ + 264, + 270 + ], + "loc": { + "start": { + "line": 12, + "column": 55 + }, + "end": { + "line": 12, + "column": 61 + } + } }, - "end": { - "line": 12, - "column": 44 - } - } - }, - "range": [ - 243, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 34 - }, - "end": { - "line": 12, - "column": 44 - } - } - }, - "operator": "/", - "right": { - "type": "BinaryExpression", - "left": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "layers", "range": [ 257, - 263 + 270 ], "loc": { "start": { @@ -1138,57 +1174,38 @@ }, "end": { "line": 12, - "column": 54 + "column": 61 } } }, - "optional": false, - "property": { - "type": "Identifier", - "name": "length", + "operator": "-", + "right": { + "type": "Literal", + "raw": "1", + "value": 1, "range": [ - 264, - 270 + 273, + 274 ], "loc": { "start": { "line": 12, - "column": 55 + "column": 64 }, "end": { "line": 12, - "column": 61 + "column": 65 } } }, "range": [ 257, - 270 - ], - "loc": { - "start": { - "line": 12, - "column": 48 - }, - "end": { - "line": 12, - "column": 61 - } - } - }, - "operator": "-", - "right": { - "type": "Literal", - "raw": "1", - "value": 1, - "range": [ - 273, 274 ], "loc": { "start": { "line": 12, - "column": 64 + "column": 48 }, "end": { "line": 12, @@ -1197,69 +1214,69 @@ } }, "range": [ - 257, - 274 + 243, + 275 ], "loc": { "start": { "line": 12, - "column": 48 + "column": 34 }, "end": { "line": 12, - "column": 65 + "column": 66 } } }, "range": [ - 243, - 275 + 242, + 276 ], "loc": { "start": { "line": 12, - "column": 34 + "column": 33 }, "end": { "line": 12, - "column": 66 + "column": 67 } } }, - "range": [ - 242, - 276 - ], - "loc": { - "start": { - "line": 12, - "column": 33 - }, - "end": { - "line": 12, - "column": 67 + { + "type": "SvelteLiteral", + "value": "px)", + "range": [ + 276, + 279 + ], + "loc": { + "start": { + "line": 12, + "column": 67 + }, + "end": { + "line": 12, + "column": 70 + } } } - }, - { - "type": "SvelteLiteral", - "value": "px)", - "range": [ - 276, - 279 - ], - "loc": { - "start": { - "line": 12, - "column": 67 - }, - "end": { - "line": 12, - "column": 70 - } + ], + "range": [ + 219, + 279 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 70 } } - ], + }, "range": [ 212, 280 @@ -1296,80 +1313,97 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "https://www.firewatchgame.com/images/parallax/parallax", - "range": [ - 289, - 343 - ], - "loc": { - "start": { - "line": 13, - "column": 8 - }, - "end": { - "line": 13, - "column": 62 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "layer", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "https://www.firewatchgame.com/images/parallax/parallax", "range": [ - 344, - 349 + 289, + 343 ], "loc": { "start": { "line": 13, - "column": 63 + "column": 8 }, "end": { "line": 13, - "column": 68 + "column": 62 } } }, - "range": [ - 343, - 350 - ], - "loc": { - "start": { - "line": 13, - "column": 62 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "layer", + "range": [ + 344, + 349 + ], + "loc": { + "start": { + "line": 13, + "column": 63 + }, + "end": { + "line": 13, + "column": 68 + } + } }, - "end": { - "line": 13, - "column": 69 + "range": [ + 343, + 350 + ], + "loc": { + "start": { + "line": 13, + "column": 62 + }, + "end": { + "line": 13, + "column": 69 + } } - } - }, - { - "type": "SvelteLiteral", - "value": ".png", - "range": [ - 350, - 354 - ], - "loc": { - "start": { - "line": 13, - "column": 69 - }, - "end": { - "line": 13, - "column": 73 + }, + { + "type": "SvelteLiteral", + "value": ".png", + "range": [ + 350, + 354 + ], + "loc": { + "start": { + "line": 13, + "column": 69 + }, + "end": { + "line": 13, + "column": 73 + } } } + ], + "range": [ + 289, + 354 + ], + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 73 + } } - ], + }, "range": [ 284, 355 @@ -1406,62 +1440,79 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "parallax layer ", - "range": [ - 364, - 379 - ], - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 23 - } - } - }, - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "layer", + "value": { + "type": "SvelteAttributeTemplateValue", + "values": [ + { + "type": "SvelteLiteral", + "value": "parallax layer ", "range": [ - 380, - 385 + 364, + 379 ], "loc": { "start": { "line": 14, - "column": 24 + "column": 8 }, "end": { "line": 14, - "column": 29 + "column": 23 } } }, - "range": [ - 379, - 386 - ], - "loc": { - "start": { - "line": 14, - "column": 23 + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "layer", + "range": [ + 380, + 385 + ], + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 29 + } + } }, - "end": { - "line": 14, - "column": 30 + "range": [ + 379, + 386 + ], + "loc": { + "start": { + "line": 14, + "column": 23 + }, + "end": { + "line": 14, + "column": 30 + } } } + ], + "range": [ + 364, + 386 + ], + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 30 + } } - ], + }, "range": [ 359, 387 diff --git a/tests/fixtures/parser/ast/tutorial/svelte-window-output.json b/tests/fixtures/parser/ast/tutorial/svelte-window-output.json index bf736c37..9cfc86c9 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-window-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-window-output.json @@ -799,26 +799,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "text-align: center", - "range": [ - 619, - 637 - ], - "loc": { - "start": { - "line": 35, - "column": 12 - }, - "end": { - "line": 35, - "column": 30 - } + "value": { + "type": "SvelteLiteral", + "value": "text-align: center", + "range": [ + 619, + 637 + ], + "loc": { + "start": { + "line": 35, + "column": 12 + }, + "end": { + "line": 35, + "column": 30 } } - ], + }, "range": [ 612, 638 diff --git a/tests/fixtures/parser/ast/tutorial/text-inputs02-output.json b/tests/fixtures/parser/ast/tutorial/text-inputs02-output.json index e06e70f6..fc3b4be2 100644 --- a/tests/fixtures/parser/ast/tutorial/text-inputs02-output.json +++ b/tests/fixtures/parser/ast/tutorial/text-inputs02-output.json @@ -211,44 +211,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "name", - "range": [ - 55, - 59 - ], - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 18 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "name", "range": [ - 54, - 60 + 55, + 59 ], "loc": { "start": { "line": 5, - "column": 13 + "column": 14 }, "end": { "line": 5, - "column": 19 + "column": 18 } } + }, + "range": [ + 54, + 60 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 19 + } } - ], + }, "range": [ 48, 60 diff --git a/tests/fixtures/parser/ast/tutorial/tick-output.json b/tests/fixtures/parser/ast/tutorial/tick-output.json index bae8ab01..84c9340d 100644 --- a/tests/fixtures/parser/ast/tutorial/tick-output.json +++ b/tests/fixtures/parser/ast/tutorial/tick-output.json @@ -2055,44 +2055,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "text", - "range": [ - 789, - 793 - ], - "loc": { - "start": { - "line": 37, - "column": 17 - }, - "end": { - "line": 37, - "column": 21 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "text", "range": [ - 788, - 794 + 789, + 793 ], "loc": { "start": { "line": 37, - "column": 16 + "column": 17 }, "end": { "line": 37, - "column": 22 + "column": 21 } } + }, + "range": [ + 788, + 794 + ], + "loc": { + "start": { + "line": 37, + "column": 16 + }, + "end": { + "line": 37, + "column": 22 + } } - ], + }, "range": [ 782, 794 diff --git a/tests/fixtures/parser/ast/tutorial/transition-events-output.json b/tests/fixtures/parser/ast/tutorial/transition-events-output.json index a7c4a10f..92ca50b9 100644 --- a/tests/fixtures/parser/ast/tutorial/transition-events-output.json +++ b/tests/fixtures/parser/ast/tutorial/transition-events-output.json @@ -581,26 +581,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 159, - 167 - ], - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 159, + 167 + ], + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 22 } } - ], + }, "range": [ 153, 168 diff --git a/tests/fixtures/parser/ast/tutorial/transition-output.json b/tests/fixtures/parser/ast/tutorial/transition-output.json index 0a1619a4..077e8609 100644 --- a/tests/fixtures/parser/ast/tutorial/transition-output.json +++ b/tests/fixtures/parser/ast/tutorial/transition-output.json @@ -361,26 +361,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "checkbox", - "range": [ - 106, - 114 - ], - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 22 - } + "value": { + "type": "SvelteLiteral", + "value": "checkbox", + "range": [ + 106, + 114 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 22 } } - ], + }, "range": [ 100, 115 diff --git a/tests/fixtures/parser/ast/tutorial/tweened-output.json b/tests/fixtures/parser/ast/tutorial/tweened-output.json index 0df375db..2ff9bfd4 100644 --- a/tests/fixtures/parser/ast/tutorial/tweened-output.json +++ b/tests/fixtures/parser/ast/tutorial/tweened-output.json @@ -674,44 +674,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "$progress", - "range": [ - 261, - 270 - ], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "$progress", "range": [ - 260, - 271 + 261, + 270 ], "loc": { "start": { "line": 18, - "column": 16 + "column": 17 }, "end": { "line": 18, - "column": 27 + "column": 26 } } + }, + "range": [ + 260, + 271 + ], + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 27 + } } - ], + }, "range": [ 254, 271 diff --git a/tests/fixtures/parser/ast/tutorial/update-output.json b/tests/fixtures/parser/ast/tutorial/update-output.json index a0141a2f..7895921e 100644 --- a/tests/fixtures/parser/ast/tutorial/update-output.json +++ b/tests/fixtures/parser/ast/tutorial/update-output.json @@ -3876,26 +3876,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "chat", - "range": [ - 1592, - 1596 - ], - "loc": { - "start": { - "line": 95, - "column": 12 - }, - "end": { - "line": 95, - "column": 16 - } + "value": { + "type": "SvelteLiteral", + "value": "chat", + "range": [ + 1592, + 1596 + ], + "loc": { + "start": { + "line": 95, + "column": 12 + }, + "end": { + "line": 95, + "column": 16 } } - ], + }, "range": [ 1585, 1597 @@ -4102,26 +4100,24 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "scrollable", - "range": [ - 1629, - 1639 - ], - "loc": { - "start": { - "line": 98, - "column": 13 - }, - "end": { - "line": 98, - "column": 23 - } + "value": { + "type": "SvelteLiteral", + "value": "scrollable", + "range": [ + 1629, + 1639 + ], + "loc": { + "start": { + "line": 98, + "column": 13 + }, + "end": { + "line": 98, + "column": 23 } } - ], + }, "range": [ 1622, 1640 @@ -4332,59 +4328,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "comment", - "range": [ - 1707, - 1714 - ], - "loc": { - "start": { - "line": 100, - "column": 19 - }, - "end": { - "line": 100, - "column": 26 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "author", - "range": [ - 1715, - 1721 - ], - "loc": { - "start": { - "line": 100, - "column": 27 - }, - "end": { - "line": 100, - "column": 33 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "comment", "range": [ 1707, - 1721 + 1714 ], "loc": { "start": { "line": 100, "column": 19 }, + "end": { + "line": 100, + "column": 26 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "author", + "range": [ + 1715, + 1721 + ], + "loc": { + "start": { + "line": 100, + "column": 27 + }, "end": { "line": 100, "column": 33 @@ -4392,21 +4372,35 @@ } }, "range": [ - 1706, - 1722 + 1707, + 1721 ], "loc": { "start": { "line": 100, - "column": 18 + "column": 19 }, "end": { "line": 100, - "column": 34 + "column": 33 } } + }, + "range": [ + 1706, + 1722 + ], + "loc": { + "start": { + "line": 100, + "column": 18 + }, + "end": { + "line": 100, + "column": 34 + } } - ], + }, "range": [ 1700, 1722 diff --git a/tests/fixtures/parser/ast/tutorial/update-scope-output.json b/tests/fixtures/parser/ast/tutorial/update-scope-output.json index 279f54e3..3dd6788f 100644 --- a/tests/fixtures/parser/ast/tutorial/update-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/update-scope-output.json @@ -10482,59 +10482,43 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "comment", - "range": [ - 1707, - 1714 - ], - "loc": { - "start": { - "line": 100, - "column": 19 - }, - "end": { - "line": 100, - "column": 26 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "author", - "range": [ - 1715, - 1721 - ], - "loc": { - "start": { - "line": 100, - "column": 27 - }, - "end": { - "line": 100, - "column": 33 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "comment", "range": [ 1707, - 1721 + 1714 ], "loc": { "start": { "line": 100, "column": 19 }, + "end": { + "line": 100, + "column": 26 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "author", + "range": [ + 1715, + 1721 + ], + "loc": { + "start": { + "line": 100, + "column": 27 + }, "end": { "line": 100, "column": 33 @@ -10542,21 +10526,35 @@ } }, "range": [ - 1706, - 1722 + 1707, + 1721 ], "loc": { "start": { "line": 100, - "column": 18 + "column": 19 }, "end": { "line": 100, - "column": 34 + "column": 33 } } + }, + "range": [ + 1706, + 1722 + ], + "loc": { + "start": { + "line": 100, + "column": 18 + }, + "end": { + "line": 100, + "column": 34 + } } - ], + }, "range": [ 1700, 1722 diff --git a/tests/fixtures/parser/ast/unknown-directive01-output.json b/tests/fixtures/parser/ast/unknown-directive01-output.json index 965dcf9c..e3fc144b 100644 --- a/tests/fixtures/parser/ast/unknown-directive01-output.json +++ b/tests/fixtures/parser/ast/unknown-directive01-output.json @@ -285,44 +285,42 @@ } }, "boolean": false, - "value": [ - { - "type": "SvelteMustacheTag", - "kind": "text", - "expression": { - "type": "Identifier", - "name": "bar", - "range": [ - 69, - 72 - ], - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 17 - } - } - }, + "value": { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Identifier", + "name": "bar", "range": [ - 68, - 73 + 69, + 72 ], "loc": { "start": { "line": 5, - "column": 13 + "column": 14 }, "end": { "line": 5, - "column": 18 + "column": 17 } } + }, + "range": [ + 68, + 73 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 18 + } } - ], + }, "range": [ 60, 73 @@ -451,7 +449,7 @@ } }, "boolean": true, - "value": [], + "value": null, "range": [ 86, 93