diff --git a/src/ast.ts b/src/ast.ts index 31f82c5b..b2c392cf 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -72,6 +72,8 @@ export type SvelteNode = | SvelteSpreadAttribute | SvelteDirective | SvelteSpecialDirective + | SvelteDirectiveKey + | SvelteSpecialDirectiveKey | SvelteHTMLComment | SvelteReactiveStatement @@ -409,10 +411,16 @@ export type SvelteDirective = | SvelteLetDirective | SvelteRefDirective | SvelteTransitionDirective -interface BaseSvelteDirective extends BaseNode { - type: "SvelteDirective" +export interface SvelteDirectiveKey extends BaseNode { + type: "SvelteDirectiveKey" name: ESTree.Identifier modifiers: string[] + parent: SvelteDirective +} + +interface BaseSvelteDirective extends BaseNode { + type: "SvelteDirective" + key: SvelteDirectiveKey parent: SvelteStartTag } @@ -450,9 +458,14 @@ export interface SvelteTransitionDirective extends BaseSvelteDirective { outro: boolean expression: null | ESTree.Expression } +export interface SvelteSpecialDirectiveKey extends BaseNode { + type: "SvelteSpecialDirectiveKey" + parent: SvelteSpecialDirective +} export interface SvelteSpecialDirective extends BaseNode { type: "SvelteSpecialDirective" kind: "this" + key: SvelteSpecialDirectiveKey expression: ESTree.Expression parent: SvelteStartTag /* & { parent: SvelteSpecialElement } */ } diff --git a/src/parser/converts/attr.ts b/src/parser/converts/attr.ts index f75cf1a9..aef86589 100644 --- a/src/parser/converts/attr.ts +++ b/src/parser/converts/attr.ts @@ -193,8 +193,7 @@ function convertBindingDirective( const directive: SvelteBindingDirective = { type: "SvelteDirective", kind: "Binding", - name: null as any, - modifiers: node.modifiers, + key: null as any, expression: null, parent, ...ctx.getConvertLocation(node), @@ -233,8 +232,7 @@ function convertEventHandlerDirective( const directive: SvelteEventHandlerDirective = { type: "SvelteDirective", kind: "EventHandler", - name: null as any, - modifiers: node.modifiers, + key: null as any, expression: null, parent, ...ctx.getConvertLocation(node), @@ -266,8 +264,7 @@ function convertClassDirective( const directive: SvelteClassDirective = { type: "SvelteDirective", kind: "Class", - name: null as any, - modifiers: node.modifiers, + key: null as any, expression: null, parent, ...ctx.getConvertLocation(node), @@ -292,8 +289,7 @@ function convertTransitionDirective( kind: "Transition", intro: node.intro, outro: node.outro, - name: null as any, - modifiers: node.modifiers, + key: null as any, expression: null, parent, ...ctx.getConvertLocation(node), @@ -303,7 +299,7 @@ function convertTransitionDirective( directive, ctx, buildProcessExpressionForExpression(directive, ctx, null), - (name) => ctx.scriptLet.addExpression(name, directive), + (name) => ctx.scriptLet.addExpression(name, directive.key), ) return directive } @@ -317,8 +313,7 @@ function convertAnimationDirective( const directive: SvelteAnimationDirective = { type: "SvelteDirective", kind: "Animation", - name: null as any, - modifiers: node.modifiers, + key: null as any, expression: null, parent, ...ctx.getConvertLocation(node), @@ -328,7 +323,7 @@ function convertAnimationDirective( directive, ctx, buildProcessExpressionForExpression(directive, ctx, null), - (name) => ctx.scriptLet.addExpression(name, directive), + (name) => ctx.scriptLet.addExpression(name, directive.key), ) return directive } @@ -342,8 +337,7 @@ function convertActionDirective( const directive: SvelteActionDirective = { type: "SvelteDirective", kind: "Action", - name: null as any, - modifiers: node.modifiers, + key: null as any, expression: null, parent, ...ctx.getConvertLocation(node), @@ -353,7 +347,7 @@ function convertActionDirective( directive, ctx, buildProcessExpressionForExpression(directive, ctx, null), - (name) => ctx.scriptLet.addExpression(name, directive), + (name) => ctx.scriptLet.addExpression(name, directive.key), ) return directive } @@ -367,8 +361,7 @@ function convertLetDirective( const directive: SvelteLetDirective = { type: "SvelteDirective", kind: "Let", - name: null as any, - modifiers: node.modifiers, + key: null as any, expression: null, parent, ...ctx.getConvertLocation(node), @@ -422,12 +415,15 @@ function processDirective< end: nameIndex + node.name.length, } + let keyEndIndex = nameRange.end + // modifiers if (ctx.code[nameRange.end] === "|") { let nextStart = nameRange.end + 1 let nextEnd = indexOf( ctx.code, - (c) => c === "=" || c === ">" || c === "|" || !c.trim(), + (c) => + c === "=" || c === ">" || c === "/" || c === "|" || !c.trim(), nextStart, ) ctx.addToken("HTMLIdentifier", { start: nextStart, end: nextEnd }) @@ -435,11 +431,17 @@ function processDirective< nextStart = nextEnd + 1 nextEnd = indexOf( ctx.code, - (c) => c === "=" || c === ">" || c === "|" || !c.trim(), + (c) => + c === "=" || + c === ">" || + c === "/" || + c === "|" || + !c.trim(), nextStart, ) ctx.addToken("HTMLIdentifier", { start: nextStart, end: nextEnd }) } + keyEndIndex = nextEnd } let isShorthand = false @@ -455,18 +457,25 @@ function processDirective< }) } + const key = (directive.key = { + type: "SvelteDirectiveKey", + name: null as any, + modifiers: node.modifiers, + parent: directive, + ...ctx.getConvertLocation({ start: node.start, end: keyEndIndex }), + }) + // put name - directive.name = { + key.name = { type: "Identifier", name: node.name, - // @ts-expect-error -- ignore - parent: directive, + parent: key, ...ctx.getConvertLocation(nameRange), } if (!isShorthand) { if (processName) { - processName(directive.name).push((es) => { - directive.name = es + processName(key.name).push((es) => { + key.name = es }) } else { ctx.addToken("HTMLIdentifier", nameRange) diff --git a/src/parser/converts/element.ts b/src/parser/converts/element.ts index b9722801..b13ffa2c 100644 --- a/src/parser/converts/element.ts +++ b/src/parser/converts/element.ts @@ -318,10 +318,16 @@ function convertSpecialElement( const thisAttr: SvelteSpecialDirective = { type: "SvelteSpecialDirective", kind: "this", + key: null as any, expression: null as any, parent: element.startTag, ...ctx.getConvertLocation({ start: startIndex, end: endIndex }), } + thisAttr.key = { + type: "SvelteSpecialDirectiveKey", + parent: thisAttr, + ...ctx.getConvertLocation({ start: startIndex, end: eqIndex }), + } ctx.addToken("HTMLIdentifier", { start: startIndex, end: eqIndex, diff --git a/src/visitor-keys.ts b/src/visitor-keys.ts index e26ae6e9..21bed06f 100644 --- a/src/visitor-keys.ts +++ b/src/visitor-keys.ts @@ -38,8 +38,10 @@ const svelteKeys: SvelteKeysType = { SvelteAttribute: ["key", "value"], SvelteShorthandAttribute: ["key", "value"], SvelteSpreadAttribute: ["argument"], - SvelteDirective: ["expression"], - SvelteSpecialDirective: ["expression"], + SvelteDirective: ["key", "expression"], + SvelteSpecialDirective: ["key", "expression"], + SvelteDirectiveKey: ["name"], + SvelteSpecialDirectiveKey: [], SvelteText: [], SvelteHTMLComment: [], SvelteReactiveStatement: ["label", "body"], 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 4b9707f6..79d20617 100644 --- a/tests/fixtures/parser/ast/blog/write-less-code01-output.json +++ b/tests/fixtures/parser/ast/blog/write-less-code01-output.json @@ -323,17 +323,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 70, + 75 + ], + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "modifiers": [], "range": [ - 70, + 65, 75 ], "loc": { "start": { "line": 6, - "column": 26 + "column": 21 }, "end": { "line": 6, @@ -341,7 +359,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "a", @@ -510,17 +527,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 107, + 112 + ], + "loc": { + "start": { + "line": 7, + "column": 26 + }, + "end": { + "line": 7, + "column": 31 + } + } + }, + "modifiers": [], "range": [ - 107, + 102, 112 ], "loc": { "start": { "line": 7, - "column": 26 + "column": 21 }, "end": { "line": 7, @@ -528,7 +563,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "b", diff --git a/tests/fixtures/parser/ast/class-directive01-output.json b/tests/fixtures/parser/ast/class-directive01-output.json index 40e80c5c..3b47ede3 100644 --- a/tests/fixtures/parser/ast/class-directive01-output.json +++ b/tests/fixtures/parser/ast/class-directive01-output.json @@ -267,17 +267,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "bar", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "bar", + "range": [ + 66, + 69 + ], + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 66, + 60, 69 ], "loc": { "start": { "line": 5, - "column": 11 + "column": 5 }, "end": { "line": 5, @@ -285,7 +303,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "bar", @@ -414,17 +431,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "foo", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "foo", + "range": [ + 94, + 97 + ], + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 94, + 88, 97 ], "loc": { "start": { "line": 6, - "column": 11 + "column": 5 }, "end": { "line": 6, @@ -432,7 +467,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "foo", diff --git a/tests/fixtures/parser/ast/docs/component-format/01-script/03-$-marks-a-statement-as-reactive/02-output.json b/tests/fixtures/parser/ast/docs/component-format/01-script/03-$-marks-a-statement-as-reactive/02-output.json index dc49e0c8..7e035a9c 100644 --- a/tests/fixtures/parser/ast/docs/component-format/01-script/03-$-marks-a-statement-as-reactive/02-output.json +++ b/tests/fixtures/parser/ast/docs/component-format/01-script/03-$-marks-a-statement-as-reactive/02-output.json @@ -613,17 +613,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 154, + 159 + ], + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 154, + 151, 159 ], "loc": { "start": { "line": 13, - "column": 11 + "column": 8 }, "end": { "line": 13, @@ -631,7 +649,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -820,17 +837,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 208, + 213 + ], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 208, + 205, 213 ], "loc": { "start": { "line": 17, - "column": 11 + "column": 8 }, "end": { "line": 17, @@ -838,7 +873,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, 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 65b4fe9b..7918930b 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 @@ -64,17 +64,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 50, + 55 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 50, + 45, 55 ], "loc": { "start": { "line": 2, - "column": 12 + "column": 7 }, "end": { "line": 2, @@ -82,7 +100,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "name", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/08-hash-key/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/08-hash-key/02-output.json index d959465d..69e902d1 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/08-hash-key/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/08-hash-key/02-output.json @@ -49,17 +49,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 30, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 30, + 19, 34 ], "loc": { "start": { "line": 2, - "column": 17 + "column": 6 }, "end": { "line": 2, @@ -67,7 +85,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/01-output.json index b117ac48..413f2b53 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "eventname", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "eventname", + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 8, + 5, 17 ], "loc": { "start": { "line": 1, - "column": 8 + "column": 5 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handler", @@ -159,27 +176,44 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "eventname", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "eventname", + "range": [ + 39, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + "modifiers": [ + "modifiers" + ], "range": [ - 39, - 48 + 36, + 58 ], "loc": { "start": { "line": 2, - "column": 8 + "column": 5 }, "end": { "line": 2, - "column": 17 + "column": 27 } } }, - "modifiers": [ - "modifiers" - ], "expression": { "type": "Identifier", "name": "handler", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/02-output.json index ac71efcc..8c97d0be 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/02-output.json @@ -342,17 +342,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 96, + 101 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 96, + 93, 101 ], "loc": { "start": { "line": 9, - "column": 11 + "column": 8 }, "end": { "line": 9, @@ -360,7 +378,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/03-output.json index d91a8320..dad000e9 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/03-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 11, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 11, + 8, 16 ], "loc": { "start": { "line": 1, - "column": 11 + "column": 8 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/04-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/04-output.json index 17c2bdcd..eca2c183 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/04-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/04-output.json @@ -28,27 +28,44 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "submit", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "submit", + "range": [ + 9, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + "modifiers": [ + "preventDefault" + ], "range": [ - 9, - 15 + 6, + 30 ], "loc": { "start": { "line": 1, - "column": 9 + "column": 6 }, "end": { "line": 1, - "column": 15 + "column": 30 } } }, - "modifiers": [ - "preventDefault" - ], "expression": { "type": "Identifier", "name": "handleSubmit", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/05-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/05-output.json index 1ef6147a..c5977e6f 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/05-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/05-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 11, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 11, + 8, 16 ], "loc": { "start": { "line": 1, - "column": 11 + "column": 8 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 8, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/06-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/06-output.json index f5a0d98d..2de577ac 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/06-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/01-on-eventname/06-output.json @@ -509,17 +509,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 150, + 155 + ], + "loc": { + "start": { + "line": 12, + "column": 11 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 150, + 147, 155 ], "loc": { "start": { "line": 12, - "column": 11 + "column": 8 }, "end": { "line": 12, @@ -527,7 +545,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "increment", @@ -564,17 +581,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 171, + 176 + ], + "loc": { + "start": { + "line": 12, + "column": 32 + }, + "end": { + "line": 12, + "column": 37 + } + } + }, + "modifiers": [], "range": [ - 171, + 168, 176 ], "loc": { "start": { "line": 12, - "column": 32 + "column": 29 }, "end": { "line": 12, @@ -582,7 +617,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "track", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/01-output.json index cb67d5ef..d3975d36 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "property", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "property", + "range": [ + 10, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 10, + 5, 18 ], "loc": { "start": { "line": 1, - "column": 10 + "column": 5 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "variable", 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 b189a0c3..ea8113c7 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 @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 12, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 12, + 7, 17 ], "loc": { "start": { "line": 1, - "column": 12 + "column": 7 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "name", @@ -159,17 +176,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 41, + 46 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 41, + 36, 46 ], "loc": { "start": { "line": 2, - "column": 15 + "column": 10 }, "end": { "line": 2, @@ -177,7 +212,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "text", @@ -362,17 +396,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 95, + 102 + ], + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 35 + } + } + }, + "modifiers": [], "range": [ - 95, + 90, 102 ], "loc": { "start": { "line": 4, - "column": 28 + "column": 23 }, "end": { "line": 4, @@ -380,7 +432,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "yes", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/03-output.json index a94f4e58..4da4c979 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/03-output.json @@ -64,17 +64,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 42, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 42, + 37, 47 ], "loc": { "start": { "line": 2, - "column": 12 + "column": 7 }, "end": { "line": 2, @@ -82,7 +100,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "value", @@ -195,17 +212,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 69, + 74 + ], + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 69, + 64, 74 ], "loc": { "start": { "line": 3, - "column": 12 + "column": 7 }, "end": { "line": 3, @@ -213,7 +248,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "value", 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 afa8af1d..43272fff 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 @@ -84,17 +84,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 26, + 31 + ], + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + } + }, + "modifiers": [], "range": [ - 26, + 21, 31 ], "loc": { "start": { "line": 1, - "column": 26 + "column": 21 }, "end": { "line": 1, @@ -102,7 +120,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "num", @@ -271,17 +288,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 64, + 69 + ], + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 64, + 59, 69 ], "loc": { "start": { "line": 2, - "column": 25 + "column": 20 }, "end": { "line": 2, @@ -289,7 +324,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "num", 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 c8dbdbb8..e9b483f3 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 @@ -251,17 +251,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "files", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "files", + "range": [ + 91, + 96 + ], + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 91, + 86, 96 ], "loc": { "start": { "line": 4, - "column": 6 + "column": 1 }, "end": { "line": 4, @@ -269,7 +287,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "files", 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 d57d1a40..604361e0 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 @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 13, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 13, + 8, 18 ], "loc": { "start": { "line": 1, - "column": 13 + "column": 8 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "selected", 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 64e2a5bd..e5d4709c 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 @@ -65,17 +65,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 22, + 27 + ], + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + } + }, + "modifiers": [], "range": [ - 22, + 17, 27 ], "loc": { "start": { "line": 1, - "column": 22 + "column": 17 }, "end": { "line": 1, @@ -83,7 +101,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "fillings", 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 dfae6d9c..5029aeb0 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 @@ -65,17 +65,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 22, + 27 + ], + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + } + }, + "modifiers": [], "range": [ - 22, + 17, 27 ], "loc": { "start": { "line": 1, - "column": 22 + "column": 17 }, "end": { "line": 1, @@ -83,7 +101,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "fillings", 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 3808af34..254bed46 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 @@ -84,17 +84,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "innerHTML", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "innerHTML", + "range": [ + 33, + 42 + ], + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + } + } + }, + "modifiers": [], "range": [ - 33, + 28, 42 ], "loc": { "start": { "line": 1, - "column": 33 + "column": 28 }, "end": { "line": 1, @@ -102,7 +120,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "html", 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 a8ce86cf..47d30f48 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 @@ -102,17 +102,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "duration", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "duration", + "range": [ + 25, + 33 + ], + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 25, + 20, 33 ], "loc": { "start": { "line": 3, - "column": 6 + "column": 1 }, "end": { "line": 3, @@ -120,7 +138,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "duration", @@ -157,17 +174,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "buffered", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "buffered", + "range": [ + 40, + 48 + ], + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 40, + 35, 48 ], "loc": { "start": { "line": 4, - "column": 6 + "column": 1 }, "end": { "line": 4, @@ -175,7 +210,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "buffered", @@ -212,17 +246,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "played", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "played", + "range": [ + 55, + 61 + ], + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 55, + 50, 61 ], "loc": { "start": { "line": 5, - "column": 6 + "column": 1 }, "end": { "line": 5, @@ -230,7 +282,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "played", @@ -267,17 +318,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "seekable", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "seekable", + "range": [ + 68, + 76 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 68, + 63, 76 ], "loc": { "start": { "line": 6, - "column": 6 + "column": 1 }, "end": { "line": 6, @@ -285,7 +354,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "seekable", @@ -322,17 +390,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "seeking", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "seeking", + "range": [ + 83, + 90 + ], + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 83, + 78, 90 ], "loc": { "start": { "line": 7, - "column": 6 + "column": 1 }, "end": { "line": 7, @@ -340,7 +426,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "seeking", @@ -377,17 +462,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "ended", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "ended", + "range": [ + 97, + 102 + ], + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 97, + 92, 102 ], "loc": { "start": { "line": 8, - "column": 6 + "column": 1 }, "end": { "line": 8, @@ -395,7 +498,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "ended", @@ -432,17 +534,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "currentTime", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "currentTime", + "range": [ + 109, + 120 + ], + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 109, + 104, 120 ], "loc": { "start": { "line": 9, - "column": 6 + "column": 1 }, "end": { "line": 9, @@ -450,7 +570,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "currentTime", @@ -487,17 +606,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "playbackRate", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "playbackRate", + "range": [ + 127, + 139 + ], + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 127, + 122, 139 ], "loc": { "start": { "line": 10, - "column": 6 + "column": 1 }, "end": { "line": 10, @@ -505,7 +642,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "playbackRate", @@ -542,17 +678,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "paused", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "paused", + "range": [ + 146, + 152 + ], + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 146, + 141, 152 ], "loc": { "start": { "line": 11, - "column": 6 + "column": 1 }, "end": { "line": 11, @@ -560,7 +714,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "paused", @@ -597,17 +750,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "volume", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "volume", + "range": [ + 159, + 165 + ], + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 159, + 154, 165 ], "loc": { "start": { "line": 12, - "column": 6 + "column": 1 }, "end": { "line": 12, @@ -615,7 +786,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "volume", @@ -652,17 +822,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "muted", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "muted", + "range": [ + 172, + 177 + ], + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 172, + 167, 177 ], "loc": { "start": { "line": 13, - "column": 6 + "column": 1 }, "end": { "line": 13, @@ -670,7 +858,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "muted", @@ -707,17 +894,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "videoWidth", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "videoWidth", + "range": [ + 184, + 194 + ], + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 184, + 179, 194 ], "loc": { "start": { "line": 14, - "column": 6 + "column": 1 }, "end": { "line": 14, @@ -725,7 +930,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "videoWidth", @@ -762,17 +966,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "videoHeight", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "videoHeight", + "range": [ + 201, + 212 + ], + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 201, + 196, 212 ], "loc": { "start": { "line": 15, - "column": 6 + "column": 1 }, "end": { "line": 15, @@ -780,7 +1002,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "videoHeight", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/11-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/11-output.json index b4112e94..4819a9c0 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/11-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/02-bind-property/11-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "offsetWidth", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "offsetWidth", + "range": [ + 11, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 11, + 6, 22 ], "loc": { "start": { "line": 2, - "column": 6 + "column": 1 }, "end": { "line": 2, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "width", @@ -83,17 +100,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "offsetHeight", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "offsetHeight", + "range": [ + 37, + 49 + ], + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 37, + 32, 49 ], "loc": { "start": { "line": 3, - "column": 6 + "column": 1 }, "end": { "line": 3, @@ -101,7 +136,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "height", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/01-output.json index e61f61df..375f0e67 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/03-bind-group/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 12, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 12, + 7, 17 ], "loc": { "start": { "line": 1, - "column": 12 + "column": 7 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "variable", 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 81adfe44..be4da873 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 @@ -358,17 +358,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 143, + 148 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 143, + 138, 148 ], "loc": { "start": { "line": 7, - "column": 25 + "column": 20 }, "end": { "line": 7, @@ -376,7 +394,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "tortilla", @@ -601,17 +618,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 200, + 205 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 200, + 195, 205 ], "loc": { "start": { "line": 8, - "column": 25 + "column": 20 }, "end": { "line": 8, @@ -619,7 +654,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "tortilla", @@ -844,17 +878,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 263, + 268 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 263, + 258, 268 ], "loc": { "start": { "line": 9, - "column": 25 + "column": 20 }, "end": { "line": 9, @@ -862,7 +914,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "tortilla", @@ -1123,17 +1174,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 377, + 382 + ], + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 33 + } + } + }, + "modifiers": [], "range": [ - 377, + 372, 382 ], "loc": { "start": { "line": 12, - "column": 28 + "column": 23 }, "end": { "line": 12, @@ -1141,7 +1210,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "fillings", @@ -1366,17 +1434,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 436, + 441 + ], + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "modifiers": [], "range": [ - 436, + 431, 441 ], "loc": { "start": { "line": 13, - "column": 28 + "column": 23 }, "end": { "line": 13, @@ -1384,7 +1470,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "fillings", @@ -1609,17 +1694,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 496, + 501 + ], + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 33 + } + } + }, + "modifiers": [], "range": [ - 496, + 491, 501 ], "loc": { "start": { "line": 14, - "column": 28 + "column": 23 }, "end": { "line": 14, @@ -1627,7 +1730,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "fillings", @@ -1852,17 +1954,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 557, + 562 + ], + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 33 + } + } + }, + "modifiers": [], "range": [ - 557, + 552, 562 ], "loc": { "start": { "line": 15, - "column": 28 + "column": 23 }, "end": { "line": 15, @@ -1870,7 +1990,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "fillings", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/01-output.json index 0a64ad3c..4d55f040 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 10, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 10, + 5, 14 ], "loc": { "start": { "line": 1, - "column": 10 + "column": 5 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "dom_node", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/02-output.json index 01bbee79..e386382c 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/04-bind-this/02-output.json @@ -584,17 +584,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 176, + 180 + ], + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 176, + 171, 180 ], "loc": { "start": { "line": 12, - "column": 13 + "column": 8 }, "end": { "line": 12, @@ -602,7 +620,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "canvasElement", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/01-output.json index 01bec2e1..d1bd2c2d 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/05-class-name/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "name", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "name", + "range": [ + 11, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 11, + 5, 15 ], "loc": { "start": { "line": 1, - "column": 11 + "column": 5 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "value", @@ -159,17 +176,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "name", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "name", + "range": [ + 37, + 41 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 37, + 31, 41 ], "loc": { "start": { "line": 2, - "column": 11 + "column": 5 }, "end": { "line": 2, @@ -177,7 +212,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "name", 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 90ec769a..a8c84ac4 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 @@ -304,17 +304,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "active", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "active", + "range": [ + 89, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 89, + 83, 95 ], "loc": { "start": { "line": 3, - "column": 11 + "column": 5 }, "end": { "line": 3, @@ -322,7 +340,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "active", @@ -506,17 +523,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "active", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "active", + "range": [ + 177, + 183 + ], + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 177, + 171, 183 ], "loc": { "start": { "line": 6, - "column": 11 + "column": 5 }, "end": { "line": 6, @@ -524,7 +559,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "active", @@ -708,17 +742,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "active", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "active", + "range": [ + 254, + 260 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 254, + 248, 260 ], "loc": { "start": { "line": 9, - "column": 11 + "column": 5 }, "end": { "line": 9, @@ -726,7 +778,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "active", @@ -763,17 +814,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "inactive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "inactive", + "range": [ + 267, + 275 + ], + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + "modifiers": [], "range": [ - 267, + 261, 275 ], "loc": { "start": { "line": 9, - "column": 24 + "column": 18 }, "end": { "line": 9, @@ -781,7 +850,6 @@ } } }, - "modifiers": [], "expression": { "type": "UnaryExpression", "argument": { @@ -837,17 +905,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "isAdmin", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "isAdmin", + "range": [ + 292, + 299 + ], + "loc": { + "start": { + "line": 9, + "column": 49 + }, + "end": { + "line": 9, + "column": 56 + } + } + }, + "modifiers": [], "range": [ - 292, + 286, 299 ], "loc": { "start": { "line": 9, - "column": 49 + "column": 43 }, "end": { "line": 9, @@ -855,7 +941,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "isAdmin", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/01-output.json index ce7a09c2..590145bf 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/01-output.json @@ -429,17 +429,35 @@ { "type": "SvelteDirective", "kind": "Action", - "name": { - "type": "Identifier", - "name": "action", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "action", + "range": [ + 139, + 145 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 139, + 135, 145 ], "loc": { "start": { "line": 8, - "column": 9 + "column": 5 }, "end": { "line": 8, @@ -447,7 +465,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 135, @@ -543,17 +560,35 @@ { "type": "SvelteDirective", "kind": "Action", - "name": { - "type": "Identifier", - "name": "action", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "action", + "range": [ + 157, + 163 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 157, + 153, 163 ], "loc": { "start": { "line": 9, - "column": 9 + "column": 5 }, "end": { "line": 9, @@ -561,7 +596,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "parameters", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/02-output.json index 078ac36f..0b3ac972 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/02-output.json @@ -311,17 +311,35 @@ { "type": "SvelteDirective", "kind": "Action", - "name": { - "type": "Identifier", - "name": "foo", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "foo", + "range": [ + 179, + 182 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 179, + 175, 182 ], "loc": { "start": { "line": 13, - "column": 9 + "column": 5 }, "end": { "line": 13, @@ -329,7 +347,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 175, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/03-output.json index 15bbf500..6cd898b2 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/06-use-action/03-output.json @@ -502,17 +502,35 @@ { "type": "SvelteDirective", "kind": "Action", - "name": { - "type": "Identifier", - "name": "foo", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "foo", + "range": [ + 264, + 267 + ], + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 264, + 260, 267 ], "loc": { "start": { "line": 19, - "column": 9 + "column": 5 }, "end": { "line": 19, @@ -520,7 +538,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "bar", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/01-output.json index 879dc7ec..02fb063d 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/01-output.json @@ -700,17 +700,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 165, + 167 + ], + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 165, + 154, 167 ], "loc": { "start": { "line": 10, - "column": 16 + "column": 5 }, "end": { "line": 10, @@ -718,7 +736,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": null, @@ -816,17 +833,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 186, + 188 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 186, + 175, 188 ], "loc": { "start": { "line": 11, - "column": 16 + "column": 5 }, "end": { "line": 11, @@ -834,7 +869,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": { @@ -949,27 +983,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 216, + 218 + ], + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 18 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 216, - 218 + 205, + 224 ], "loc": { "start": { "line": 12, - "column": 16 + "column": 5 }, "end": { "line": 12, - "column": 18 + "column": 24 } } }, - "modifiers": [ - "local" - ], "intro": true, "outro": true, "expression": null, @@ -1067,27 +1118,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 243, + 245 + ], + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 18 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 243, - 245 + 232, + 251 ], "loc": { "start": { "line": 13, - "column": 16 + "column": 5 }, "end": { "line": 13, - "column": 18 + "column": 24 } } }, - "modifiers": [ - "local" - ], "intro": true, "outro": true, "expression": { @@ -2657,16 +2725,34 @@ }, { "type": "HTMLIdentifier", - "value": "local/", + "value": "local", "range": [ 219, - 225 + 224 ], "loc": { "start": { "line": 12, "column": 19 }, + "end": { + "line": 12, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 224, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 24 + }, "end": { "line": 12, "column": 25 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/02-output.json index 2ad7c538..ad616055 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/02-output.json @@ -50,17 +50,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 31, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 31, + 20, 35 ], "loc": { "start": { "line": 2, - "column": 17 + "column": 6 }, "end": { "line": 2, @@ -68,7 +86,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/03-output.json index e6877046..496b9d75 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/03-output.json @@ -50,17 +50,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 31, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 31, + 20, 35 ], "loc": { "start": { "line": 2, - "column": 17 + "column": 6 }, "end": { "line": 2, @@ -68,7 +86,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": { diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/04-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/04-output.json index 03f4605f..32263fcb 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/04-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/04-output.json @@ -1294,17 +1294,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "whoosh", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whoosh", + "range": [ + 416, + 422 + ], + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 416, + 413, 422 ], "loc": { "start": { "line": 19, - "column": 9 + "column": 6 }, "end": { "line": 19, @@ -1312,7 +1330,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": null, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-output.json index 9b86c76e..b3e5f61a 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/05-output.json @@ -1770,17 +1770,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "typewriter", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "typewriter", + "range": [ + 459, + 469 + ], + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 459, + 456, 469 ], "loc": { "start": { "line": 26, - "column": 7 + "column": 4 }, "end": { "line": 26, @@ -1788,7 +1806,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { 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 20e91c08..54b4fa9b 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 @@ -1999,17 +1999,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "typewriter", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "typewriter", + "range": [ + 505, + 515 + ], + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 505, + 502, 515 ], "loc": { "start": { "line": 26, - "column": 7 + "column": 4 }, "end": { "line": 26, @@ -2017,7 +2035,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/06-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/06-output.json index 8755dfdb..9295db51 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/06-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/06-output.json @@ -50,17 +50,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fly", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fly", + "range": [ + 31, + 34 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 31, + 20, 34 ], "loc": { "start": { "line": 3, - "column": 13 + "column": 2 }, "end": { "line": 3, @@ -68,7 +86,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": { @@ -224,17 +241,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "introstart", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "introstart", + "range": [ + 71, + 81 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 71, + 68, 81 ], "loc": { "start": { "line": 4, - "column": 5 + "column": 2 }, "end": { "line": 4, @@ -242,7 +277,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -338,17 +372,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "outrostart", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "outrostart", + "range": [ + 122, + 132 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 122, + 119, 132 ], "loc": { "start": { "line": 5, - "column": 5 + "column": 2 }, "end": { "line": 5, @@ -356,7 +408,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -452,17 +503,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "introend", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "introend", + "range": [ + 173, + 181 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 173, + 170, 181 ], "loc": { "start": { "line": 6, - "column": 5 + "column": 2 }, "end": { "line": 6, @@ -470,7 +539,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -566,17 +634,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "outroend", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "outroend", + "range": [ + 220, + 228 + ], + "loc": { + "start": { + "line": 7, + "column": 5 + }, + "end": { + "line": 7, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 220, + 217, 228 ], "loc": { "start": { "line": 7, - "column": 5 + "column": 2 }, "end": { "line": 7, @@ -584,7 +670,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/07-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/07-output.json index c2a8f3e4..5a8e429d 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/07-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/07-transition-fn/07-output.json @@ -72,17 +72,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 33, + 37 + ], + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 33, + 22, 37 ], "loc": { "start": { "line": 3, - "column": 16 + "column": 5 }, "end": { "line": 3, @@ -90,7 +108,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": null, @@ -223,27 +240,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 102, + 106 + ], + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 20 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 102, - 106 + 91, + 112 ], "loc": { "start": { "line": 7, - "column": 16 + "column": 5 }, "end": { "line": 7, - "column": 20 + "column": 26 } } }, - "modifiers": [ - "local" - ], "intro": true, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/01-output.json index 072eb9b3..123bf73f 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 8, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + "modifiers": [], "range": [ - 8, + 5, 10 ], "loc": { "start": { "line": 1, - "column": 8 + "column": 5 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": null, @@ -144,17 +161,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 21, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 10 + } + } + }, + "modifiers": [], "range": [ - 21, + 18, 23 ], "loc": { "start": { "line": 2, - "column": 8 + "column": 5 }, "end": { "line": 2, @@ -162,7 +197,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -277,27 +311,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 43, + 45 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 10 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 43, - 45 + 40, + 51 ], "loc": { "start": { "line": 3, - "column": 8 + "column": 5 }, "end": { "line": 3, - "column": 10 + "column": 16 } } }, - "modifiers": [ - "local" - ], "intro": true, "outro": false, "expression": null, @@ -395,27 +446,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 62, + 64 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 62, - 64 + 59, + 70 ], "loc": { "start": { "line": 4, - "column": 8 + "column": 5 }, "end": { "line": 4, - "column": 10 + "column": 16 } } }, - "modifiers": [ - "local" - ], "intro": true, "outro": false, "expression": { @@ -530,17 +598,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 91, + 93 + ], + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 91, + 87, 93 ], "loc": { "start": { "line": 5, - "column": 9 + "column": 5 }, "end": { "line": 5, @@ -548,7 +634,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": null, @@ -646,17 +731,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 105, + 107 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 105, + 101, 107 ], "loc": { "start": { "line": 6, - "column": 9 + "column": 5 }, "end": { "line": 6, @@ -664,7 +767,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -779,27 +881,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 128, + 130 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 128, - 130 + 124, + 136 ], "loc": { "start": { "line": 7, - "column": 9 + "column": 5 }, "end": { "line": 7, - "column": 11 + "column": 17 } } }, - "modifiers": [ - "local" - ], "intro": false, "outro": true, "expression": null, @@ -897,27 +1016,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fn", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fn", + "range": [ + 148, + 150 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 11 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 148, - 150 + 144, + 156 ], "loc": { "start": { "line": 8, - "column": 9 + "column": 5 }, "end": { "line": 8, - "column": 11 + "column": 17 } } }, - "modifiers": [ - "local" - ], "intro": false, "outro": true, "expression": { @@ -1461,16 +1597,34 @@ }, { "type": "HTMLIdentifier", - "value": "local/", + "value": "local", "range": [ 46, - 52 + 51 ], "loc": { "start": { "line": 3, "column": 11 }, + "end": { + "line": 3, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 51, + 52 + ], + "loc": { + "start": { + "line": 3, + "column": 16 + }, "end": { "line": 3, "column": 17 @@ -2235,16 +2389,34 @@ }, { "type": "HTMLIdentifier", - "value": "local/", + "value": "local", "range": [ 131, - 137 + 136 ], "loc": { "start": { "line": 7, "column": 12 }, + "end": { + "line": 7, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 136, + 137 + ], + "loc": { + "start": { + "line": 7, + "column": 17 + }, "end": { "line": 7, "column": 18 diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/02-output.json index 73640135..69d141ba 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/08-in-fn-out-fn/02-output.json @@ -50,17 +50,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fly", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fly", + "range": [ + 23, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 23, + 20, 26 ], "loc": { "start": { "line": 2, - "column": 9 + "column": 6 }, "end": { "line": 2, @@ -68,7 +86,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": null, @@ -90,17 +107,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 31, + 35 + ], + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 31, + 27, 35 ], "loc": { "start": { "line": 2, - "column": 17 + "column": 13 }, "end": { "line": 2, @@ -108,7 +143,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/01-output.json index 97d6bd93..52f2ac60 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/01-output.json @@ -833,17 +833,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "name", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "name", + "range": [ + 227, + 231 + ], + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 227, + 219, 231 ], "loc": { "start": { "line": 10, - "column": 13 + "column": 5 }, "end": { "line": 10, @@ -851,7 +869,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 219, @@ -947,17 +964,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "name", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "name", + "range": [ + 247, + 251 + ], + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 247, + 239, 251 ], "loc": { "start": { "line": 11, - "column": 13 + "column": 5 }, "end": { "line": 11, @@ -965,7 +1000,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "params", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-output.json index b2ebbb31..b8165042 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-output.json @@ -139,17 +139,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 104, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 104, + 96, 108 ], "loc": { "start": { "line": 3, - "column": 13 + "column": 5 }, "end": { "line": 3, @@ -157,7 +175,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 96, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-scope-output.json index b450af57..5605059a 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-scope-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/02-scope-output.json @@ -199,17 +199,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 104, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 104, + 96, 108 ], "loc": { "start": { "line": 3, - "column": 13 + "column": 5 }, "end": { "line": 3, @@ -217,7 +235,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 96, @@ -568,17 +585,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 104, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 104, + 96, 108 ], "loc": { "start": { "line": 3, - "column": 13 + "column": 5 }, "end": { "line": 3, @@ -586,7 +621,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 96, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-output.json index 7237545c..06e4dcf3 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-output.json @@ -103,17 +103,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 48, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 48, + 40, 52 ], "loc": { "start": { "line": 2, - "column": 13 + "column": 5 }, "end": { "line": 2, @@ -121,7 +139,6 @@ } } }, - "modifiers": [], "expression": { "type": "ObjectExpression", "properties": [ diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-scope-output.json index f78eff52..fbbb5e42 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-scope-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/03-scope-output.json @@ -199,17 +199,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 48, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 48, + 40, 52 ], "loc": { "start": { "line": 2, - "column": 13 + "column": 5 }, "end": { "line": 2, @@ -217,7 +235,6 @@ } } }, - "modifiers": [], "expression": { "type": "ObjectExpression", "properties": [ @@ -644,17 +661,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 48, + 52 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 48, + 40, 52 ], "loc": { "start": { "line": 2, - "column": 13 + "column": 5 }, "end": { "line": 2, @@ -662,7 +697,6 @@ } } }, - "modifiers": [], "expression": { "type": "ObjectExpression", "properties": [ diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-output.json index a0ccfca9..800699bb 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-output.json @@ -1825,17 +1825,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "whizz", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whizz", + "range": [ + 448, + 453 + ], + "loc": { + "start": { + "line": 22, + "column": 14 + }, + "end": { + "line": 22, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 448, + 440, 453 ], "loc": { "start": { "line": 22, - "column": 14 + "column": 6 }, "end": { "line": 22, @@ -1843,7 +1861,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 440, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-scope-output.json index 0a6a58be..381c2ca8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-scope-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/04-scope-output.json @@ -11422,17 +11422,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "whizz", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whizz", + "range": [ + 448, + 453 + ], + "loc": { + "start": { + "line": 22, + "column": 14 + }, + "end": { + "line": 22, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 448, + 440, 453 ], "loc": { "start": { "line": 22, - "column": 14 + "column": 6 }, "end": { "line": 22, @@ -11440,7 +11458,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 440, @@ -11791,17 +11808,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "whizz", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whizz", + "range": [ + 448, + 453 + ], + "loc": { + "start": { + "line": 22, + "column": 14 + }, + "end": { + "line": 22, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 448, + 440, 453 ], "loc": { "start": { "line": 22, - "column": 14 + "column": 6 }, "end": { "line": 22, @@ -11809,7 +11844,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 440, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-output.json index b2e9bd8d..a851374a 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-output.json @@ -1851,17 +1851,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "whizz", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whizz", + "range": [ + 444, + 449 + ], + "loc": { + "start": { + "line": 24, + "column": 14 + }, + "end": { + "line": 24, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 444, + 436, 449 ], "loc": { "start": { "line": 24, - "column": 14 + "column": 6 }, "end": { "line": 24, @@ -1869,7 +1887,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 436, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-scope-output.json b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-scope-output.json index a7af86e6..7141aab6 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-scope-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/11-element-directives/09-animate-fn/05-scope-output.json @@ -11393,17 +11393,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "whizz", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whizz", + "range": [ + 444, + 449 + ], + "loc": { + "start": { + "line": 24, + "column": 14 + }, + "end": { + "line": 24, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 444, + 436, 449 ], "loc": { "start": { "line": 24, - "column": 14 + "column": 6 }, "end": { "line": 24, @@ -11411,7 +11429,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 436, @@ -11762,17 +11779,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "whizz", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whizz", + "range": [ + 444, + 449 + ], + "loc": { + "start": { + "line": 24, + "column": 14 + }, + "end": { + "line": 24, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 444, + 436, 449 ], "loc": { "start": { "line": 24, - "column": 14 + "column": 6 }, "end": { "line": 24, @@ -11780,7 +11815,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 436, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/01-output.json index baed096e..c18a88b8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "eventname", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "eventname", + "range": [ + 11, + 20 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 11, + 8, 20 ], "loc": { "start": { "line": 1, - "column": 11 + "column": 8 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handler", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/02-output.json index 3fd14ea3..d7ab6657 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/02-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "whatever", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whatever", + "range": [ + 18, + 26 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 18, + 15, 26 ], "loc": { "start": { "line": 1, - "column": 18 + "column": 15 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handler", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/03-output.json index 90839328..a3d912ac 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/01-on-eventname/03-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "whatever", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "whatever", + "range": [ + 18, + 26 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 18, + 15, 26 ], "loc": { "start": { "line": 1, - "column": 18 + "column": 15 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 15, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/01-output.json index 5159ebc3..d5920788 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "property", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "property", + "range": [ + 13, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 13, + 8, 21 ], "loc": { "start": { "line": 1, - "column": 13 + "column": 8 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "variable", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/02-output.json index a9e5844b..814f741b 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/02-bind-property/02-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 13, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 13, + 8, 18 ], "loc": { "start": { "line": 1, - "column": 13 + "column": 8 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "pin", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/01-output.json index f4cd720c..054dc6b8 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 13, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 13, + 8, 17 ], "loc": { "start": { "line": 1, - "column": 13 + "column": 8 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "component_instance", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/02-output.json index e80ee297..7deb0d6f 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/12-component-directives/03-bind-this/02-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 19, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + } + }, + "modifiers": [], "range": [ - 19, + 14, 23 ], "loc": { "start": { "line": 1, - "column": 19 + "column": 14 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "cart", @@ -159,17 +176,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 45, + 50 + ], + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 45, + 42, 50 ], "loc": { "start": { "line": 3, - "column": 11 + "column": 8 }, "end": { "line": 3, @@ -177,7 +212,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, 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 628ba381..59a8e9fe 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 @@ -654,17 +654,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "prop", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "prop", + "range": [ + 171, + 175 + ], + "loc": { + "start": { + "line": 11, + "column": 23 + }, + "end": { + "line": 11, + "column": 27 + } + } + }, + "modifiers": [], "range": [ - 171, + 167, 175 ], "loc": { "start": { "line": 11, - "column": 23 + "column": 19 }, "end": { "line": 11, @@ -672,7 +690,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "thing", 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 48f359cb..0d6a61dd 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 @@ -733,17 +733,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "prop", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "prop", + "range": [ + 171, + 175 + ], + "loc": { + "start": { + "line": 11, + "column": 23 + }, + "end": { + "line": 11, + "column": 27 + } + } + }, + "modifiers": [], "range": [ - 171, + 167, 175 ], "loc": { "start": { "line": 11, - "column": 23 + "column": 19 }, "end": { "line": 11, @@ -751,7 +769,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "thing", 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 7117601f..dc9bc6fe 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 @@ -953,17 +953,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 226, + 230 + ], + "loc": { + "start": { + "line": 14, + "column": 22 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 226, + 222, 230 ], "loc": { "start": { "line": 14, - "column": 22 + "column": 18 }, "end": { "line": 14, @@ -971,7 +989,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item", 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 335fbb5c..2a81cd02 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 @@ -771,17 +771,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 226, + 230 + ], + "loc": { + "start": { + "line": 14, + "column": 22 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 226, + 222, 230 ], "loc": { "start": { "line": 14, - "column": 22 + "column": 18 }, "end": { "line": 14, @@ -789,7 +807,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/01-output.json index e8620f99..96b60897 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/01-output.json @@ -28,6 +28,23 @@ { "type": "SvelteSpecialDirective", "kind": "this", + "key": { + "type": "SvelteSpecialDirectiveKey", + "range": [ + 18, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + } + }, "expression": { "type": "Identifier", "name": "expression", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/02-output.json index 28da340f..53a22c04 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/15-svelte-component/02-output.json @@ -102,6 +102,23 @@ { "type": "SvelteSpecialDirective", "kind": "this", + "key": { + "type": "SvelteSpecialDirectiveKey", + "range": [ + 18, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + } + }, "expression": { "type": "MemberExpression", "computed": false, diff --git a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/01-output.json index 9bfc3e6e..0456cd98 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "event", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "event", + "range": [ + 18, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + } + }, + "modifiers": [], "range": [ - 18, + 15, 23 ], "loc": { "start": { "line": 1, - "column": 18 + "column": 15 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handler", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/02-output.json index 69e478e3..01de0576 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/02-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "prop", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "prop", + "range": [ + 20, + 24 + ], + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 24 + } + } + }, + "modifiers": [], "range": [ - 20, + 15, 24 ], "loc": { "start": { "line": 1, - "column": 20 + "column": 15 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "value", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/03-output.json b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/03-output.json index 465f946a..f4a2f015 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/03-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/03-output.json @@ -371,17 +371,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "keydown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "keydown", + "range": [ + 115, + 122 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 25 + } + } + }, + "modifiers": [], "range": [ - 115, + 112, 122 ], "loc": { "start": { "line": 7, - "column": 18 + "column": 15 }, "end": { "line": 7, @@ -389,7 +407,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleKeydown", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/04-output.json b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/04-output.json index 6e2d9298..06014f53 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/04-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/16-svelte-window/04-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "scrollY", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "scrollY", + "range": [ + 20, + 27 + ], + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + } + }, + "modifiers": [], "range": [ - 20, + 15, 27 ], "loc": { "start": { "line": 1, - "column": 20 + "column": 15 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "y", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/01-output.json b/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/01-output.json index 28e36f78..3d795a1e 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/01-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/01-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "event", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "event", + "range": [ + 16, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 16, + 13, 21 ], "loc": { "start": { "line": 1, - "column": 16 + "column": 13 }, "end": { "line": 1, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handler", diff --git a/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/02-output.json b/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/02-output.json index 21ae5c81..f4210841 100644 --- a/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/02-output.json +++ b/tests/fixtures/parser/ast/docs/template-syntax/17-svelte-body/02-output.json @@ -28,17 +28,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseenter", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseenter", + "range": [ + 17, + 27 + ], + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 17, + 14, 27 ], "loc": { "start": { "line": 2, - "column": 4 + "column": 1 }, "end": { "line": 2, @@ -46,7 +64,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMouseenter", @@ -83,17 +100,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseleave", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseleave", + "range": [ + 51, + 61 + ], + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 51, + 48, 61 ], "loc": { "start": { "line": 3, - "column": 4 + "column": 1 }, "end": { "line": 3, @@ -101,7 +136,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMouseleave", diff --git a/tests/fixtures/parser/ast/hello/hello-world04-output.json b/tests/fixtures/parser/ast/hello/hello-world04-output.json index 8833a1ef..ddc8e7e2 100644 --- a/tests/fixtures/parser/ast/hello/hello-world04-output.json +++ b/tests/fixtures/parser/ast/hello/hello-world04-output.json @@ -323,17 +323,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 91, + 96 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 91, + 88, 96 ], "loc": { "start": { "line": 9, - "column": 11 + "column": 8 }, "end": { "line": 9, @@ -341,7 +359,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/hello/hello-world05-output.json b/tests/fixtures/parser/ast/hello/hello-world05-output.json index 1e2192a5..98591970 100644 --- a/tests/fixtures/parser/ast/hello/hello-world05-output.json +++ b/tests/fixtures/parser/ast/hello/hello-world05-output.json @@ -1019,17 +1019,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 735, + 739 + ], + "loc": { + "start": { + "line": 46, + "column": 9 + }, + "end": { + "line": 46, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 735, + 731, 739 ], "loc": { "start": { "line": 46, - "column": 9 + "column": 5 }, "end": { "line": 46, @@ -1037,7 +1055,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -1251,17 +1268,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "expand", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "expand", + "range": [ + 789, + 795 + ], + "loc": { + "start": { + "line": 48, + "column": 7 + }, + "end": { + "line": 48, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 789, + 786, 795 ], "loc": { "start": { "line": 48, - "column": 7 + "column": 4 }, "end": { "line": 48, @@ -1269,7 +1304,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -1688,17 +1722,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "draw", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "draw", + "range": [ + 945, + 949 + ], + "loc": { + "start": { + "line": 53, + "column": 7 + }, + "end": { + "line": 53, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 945, + 942, 949 ], "loc": { "start": { "line": 53, - "column": 7 + "column": 4 }, "end": { "line": 53, @@ -1706,7 +1758,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -2168,17 +2219,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fly", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fly", + "range": [ + 1080, + 1083 + ], + "loc": { + "start": { + "line": 60, + "column": 27 + }, + "end": { + "line": 60, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 1080, + 1076, 1083 ], "loc": { "start": { "line": 60, - "column": 27 + "column": 23 }, "end": { "line": 60, @@ -2186,7 +2255,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -2480,17 +2548,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 1159, + 1163 + ], + "loc": { + "start": { + "line": 63, + "column": 7 + }, + "end": { + "line": 63, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 1159, + 1156, 1163 ], "loc": { "start": { "line": 63, - "column": 7 + "column": 4 }, "end": { "line": 63, @@ -2498,7 +2584,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -3056,17 +3141,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 1287, + 1294 + ], + "loc": { + "start": { + "line": 70, + "column": 29 + }, + "end": { + "line": 70, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 1287, + 1282, 1294 ], "loc": { "start": { "line": 70, - "column": 29 + "column": 24 }, "end": { "line": 70, @@ -3074,7 +3177,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", diff --git a/tests/fixtures/parser/ast/hello/hello-world05-scope-output.json b/tests/fixtures/parser/ast/hello/hello-world05-scope-output.json index 47f9ca2f..894f218b 100644 --- a/tests/fixtures/parser/ast/hello/hello-world05-scope-output.json +++ b/tests/fixtures/parser/ast/hello/hello-world05-scope-output.json @@ -1816,17 +1816,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 1159, + 1163 + ], + "loc": { + "start": { + "line": 63, + "column": 7 + }, + "end": { + "line": 63, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 1159, + 1156, 1163 ], "loc": { "start": { "line": 63, - "column": 7 + "column": 4 }, "end": { "line": 63, @@ -1834,7 +1852,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -2338,17 +2355,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 1159, + 1163 + ], + "loc": { + "start": { + "line": 63, + "column": 7 + }, + "end": { + "line": 63, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 1159, + 1156, 1163 ], "loc": { "start": { "line": 63, - "column": 7 + "column": 4 }, "end": { "line": 63, @@ -2356,7 +2391,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { diff --git a/tests/fixtures/parser/ast/label01-output.json b/tests/fixtures/parser/ast/label01-output.json index cd3c22a2..5790f295 100644 --- a/tests/fixtures/parser/ast/label01-output.json +++ b/tests/fixtures/parser/ast/label01-output.json @@ -609,17 +609,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 143, + 148 + ], + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 143, + 140, 148 ], "loc": { "start": { "line": 11, - "column": 11 + "column": 8 }, "end": { "line": 11, @@ -627,7 +645,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/let-directive01-output.json b/tests/fixtures/parser/ast/let-directive01-output.json index a0db1332..c6210d0f 100644 --- a/tests/fixtures/parser/ast/let-directive01-output.json +++ b/tests/fixtures/parser/ast/let-directive01-output.json @@ -192,17 +192,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "foo", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "foo", + "range": [ + 63, + 66 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 63, + 59, 66 ], "loc": { "start": { "line": 4, - "column": 15 + "column": 11 }, "end": { "line": 4, @@ -210,7 +228,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "data", @@ -417,17 +434,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 105, + 109 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 105, + 101, 109 ], "loc": { "start": { "line": 6, - "column": 22 + "column": 18 }, "end": { "line": 6, @@ -435,7 +470,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item", @@ -472,17 +506,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item2", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item2", + "range": [ + 114, + 119 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 114, + 110, 119 ], "loc": { "start": { "line": 6, - "column": 31 + "column": 27 }, "end": { "line": 6, @@ -490,7 +542,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item2", @@ -527,17 +578,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item3", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item3", + "range": [ + 124, + 129 + ], + "loc": { + "start": { + "line": 6, + "column": 41 + }, + "end": { + "line": 6, + "column": 46 + } + } + }, + "modifiers": [], "range": [ - 124, + 120, 129 ], "loc": { "start": { "line": 6, - "column": 41 + "column": 37 }, "end": { "line": 6, @@ -545,7 +614,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "bar", diff --git a/tests/fixtures/parser/ast/let-directive01-scope-output.json b/tests/fixtures/parser/ast/let-directive01-scope-output.json index 29290c63..32621e84 100644 --- a/tests/fixtures/parser/ast/let-directive01-scope-output.json +++ b/tests/fixtures/parser/ast/let-directive01-scope-output.json @@ -288,17 +288,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "foo", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "foo", + "range": [ + 63, + 66 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 63, + 59, 66 ], "loc": { "start": { "line": 4, - "column": 15 + "column": 11 }, "end": { "line": 4, @@ -306,7 +324,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "data", @@ -513,17 +530,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 105, + 109 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 105, + 101, 109 ], "loc": { "start": { "line": 6, - "column": 22 + "column": 18 }, "end": { "line": 6, @@ -531,7 +566,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item", @@ -568,17 +602,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item2", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item2", + "range": [ + 114, + 119 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 114, + 110, 119 ], "loc": { "start": { "line": 6, - "column": 31 + "column": 27 }, "end": { "line": 6, @@ -586,7 +638,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item2", @@ -623,17 +674,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item3", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item3", + "range": [ + 124, + 129 + ], + "loc": { + "start": { + "line": 6, + "column": 41 + }, + "end": { + "line": 6, + "column": 46 + } + } + }, + "modifiers": [], "range": [ - 124, + 120, 129 ], "loc": { "start": { "line": 6, - "column": 41 + "column": 37 }, "end": { "line": 6, @@ -641,7 +710,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "bar", @@ -1181,17 +1249,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 105, + 109 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 105, + 101, 109 ], "loc": { "start": { "line": 6, - "column": 22 + "column": 18 }, "end": { "line": 6, @@ -1199,7 +1285,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item", @@ -1236,17 +1321,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item2", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item2", + "range": [ + 114, + 119 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 114, + 110, 119 ], "loc": { "start": { "line": 6, - "column": 31 + "column": 27 }, "end": { "line": 6, @@ -1254,7 +1357,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item2", @@ -1291,17 +1393,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item3", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item3", + "range": [ + 124, + 129 + ], + "loc": { + "start": { + "line": 6, + "column": 41 + }, + "end": { + "line": 6, + "column": 46 + } + } + }, + "modifiers": [], "range": [ - 124, + 120, 129 ], "loc": { "start": { "line": 6, - "column": 41 + "column": 37 }, "end": { "line": 6, @@ -1309,7 +1429,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "bar", @@ -1674,17 +1793,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 105, + 109 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 105, + 101, 109 ], "loc": { "start": { "line": 6, - "column": 22 + "column": 18 }, "end": { "line": 6, @@ -1692,7 +1829,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item", @@ -1729,17 +1865,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item2", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item2", + "range": [ + 114, + 119 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 114, + 110, 119 ], "loc": { "start": { "line": 6, - "column": 31 + "column": 27 }, "end": { "line": 6, @@ -1747,7 +1901,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item2", @@ -1784,17 +1937,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item3", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item3", + "range": [ + 124, + 129 + ], + "loc": { + "start": { + "line": 6, + "column": 41 + }, + "end": { + "line": 6, + "column": 46 + } + } + }, + "modifiers": [], "range": [ - 124, + 120, 129 ], "loc": { "start": { "line": 6, - "column": 41 + "column": 37 }, "end": { "line": 6, @@ -1802,7 +1973,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "bar", @@ -2126,17 +2296,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item", + "range": [ + 105, + 109 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 26 + } + } + }, + "modifiers": [], "range": [ - 105, + 101, 109 ], "loc": { "start": { "line": 6, - "column": 22 + "column": 18 }, "end": { "line": 6, @@ -2144,7 +2332,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item", @@ -2181,17 +2368,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item2", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item2", + "range": [ + 114, + 119 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 114, + 110, 119 ], "loc": { "start": { "line": 6, - "column": 31 + "column": 27 }, "end": { "line": 6, @@ -2199,7 +2404,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "item2", @@ -2236,17 +2440,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "item3", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "item3", + "range": [ + 124, + 129 + ], + "loc": { + "start": { + "line": 6, + "column": 41 + }, + "end": { + "line": 6, + "column": 46 + } + } + }, + "modifiers": [], "range": [ - 124, + 120, 129 ], "loc": { "start": { "line": 6, - "column": 41 + "column": 37 }, "end": { "line": 6, @@ -2254,7 +2476,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "bar", diff --git a/tests/fixtures/parser/ast/store-bindings-output.json b/tests/fixtures/parser/ast/store-bindings-output.json index 9a807e7c..3dc06b72 100644 --- a/tests/fixtures/parser/ast/store-bindings-output.json +++ b/tests/fixtures/parser/ast/store-bindings-output.json @@ -391,17 +391,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 100, + 105 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 100, + 95, 105 ], "loc": { "start": { "line": 6, - "column": 12 + "column": 7 }, "end": { "line": 6, @@ -409,7 +427,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "$name", @@ -522,17 +539,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 127, + 132 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 127, + 124, 132 ], "loc": { "start": { "line": 8, - "column": 11 + "column": 8 }, "end": { "line": 8, @@ -540,7 +575,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/ts-event01-output.json b/tests/fixtures/parser/ast/ts-event01-output.json index 53a2b94f..bd359e5e 100644 --- a/tests/fixtures/parser/ast/ts-event01-output.json +++ b/tests/fixtures/parser/ast/ts-event01-output.json @@ -250,17 +250,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 79, + 84 + ], + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 79, + 76, 84 ], "loc": { "start": { "line": 4, - "column": 11 + "column": 8 }, "end": { "line": 4, @@ -268,7 +286,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -438,17 +455,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 119, + 124 + ], + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 119, + 116, 124 ], "loc": { "start": { "line": 5, - "column": 14 + "column": 11 }, "end": { "line": 5, @@ -456,7 +491,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/ts-event02-output.json b/tests/fixtures/parser/ast/ts-event02-output.json index e46c2c19..10f7ba7e 100644 --- a/tests/fixtures/parser/ast/ts-event02-output.json +++ b/tests/fixtures/parser/ast/ts-event02-output.json @@ -250,17 +250,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 87, + 92 + ], + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 87, + 84, 92 ], "loc": { "start": { "line": 4, - "column": 11 + "column": 8 }, "end": { "line": 4, @@ -268,7 +286,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -438,17 +455,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 127, + 132 + ], + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 127, + 124, 132 ], "loc": { "start": { "line": 5, - "column": 14 + "column": 11 }, "end": { "line": 5, @@ -456,7 +491,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/actions-output.json b/tests/fixtures/parser/ast/tutorial/actions-output.json index b378dfba..c998791d 100644 --- a/tests/fixtures/parser/ast/tutorial/actions-output.json +++ b/tests/fixtures/parser/ast/tutorial/actions-output.json @@ -2228,17 +2228,35 @@ { "type": "SvelteDirective", "kind": "Action", - "name": { - "type": "Identifier", - "name": "pannable", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "pannable", + "range": [ + 818, + 826 + ], + "loc": { + "start": { + "line": 44, + "column": 5 + }, + "end": { + "line": 44, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 818, + 814, 826 ], "loc": { "start": { "line": 44, - "column": 5 + "column": 1 }, "end": { "line": 44, @@ -2246,7 +2264,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 814, @@ -2266,17 +2283,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "panstart", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "panstart", + "range": [ + 831, + 839 + ], + "loc": { + "start": { + "line": 45, + "column": 4 + }, + "end": { + "line": 45, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 831, + 828, 839 ], "loc": { "start": { "line": 45, - "column": 4 + "column": 1 }, "end": { "line": 45, @@ -2284,7 +2319,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handlePanStart", @@ -2321,17 +2355,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "panmove", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "panmove", + "range": [ + 861, + 868 + ], + "loc": { + "start": { + "line": 46, + "column": 4 + }, + "end": { + "line": 46, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 861, + 858, 868 ], "loc": { "start": { "line": 46, - "column": 4 + "column": 1 }, "end": { "line": 46, @@ -2339,7 +2391,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handlePanMove", @@ -2376,17 +2427,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "panend", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "panend", + "range": [ + 889, + 895 + ], + "loc": { + "start": { + "line": 47, + "column": 4 + }, + "end": { + "line": 47, + "column": 10 + } + } + }, + "modifiers": [], "range": [ - 889, + 886, 895 ], "loc": { "start": { "line": 47, - "column": 4 + "column": 1 }, "end": { "line": 47, @@ -2394,7 +2463,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handlePanEnd", 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 51618edd..69a80a15 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 @@ -473,17 +473,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 142, + 147 + ], + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 142, + 137, 147 ], "loc": { "start": { "line": 9, - "column": 24 + "column": 19 }, "end": { "line": 9, @@ -491,7 +509,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "duration", @@ -859,17 +876,35 @@ { "type": "SvelteDirective", "kind": "Action", - "name": { - "type": "Identifier", - "name": "longpress", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "longpress", + "range": [ + 218, + 227 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 218, + 214, 227 ], "loc": { "start": { "line": 13, - "column": 12 + "column": 8 }, "end": { "line": 13, @@ -877,7 +912,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "duration", @@ -914,17 +948,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "longpress", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "longpress", + "range": [ + 243, + 252 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 243, + 240, 252 ], "loc": { "start": { "line": 14, - "column": 4 + "column": 1 }, "end": { "line": 14, @@ -932,7 +984,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1028,17 +1079,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseenter", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseenter", + "range": [ + 282, + 292 + ], + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 282, + 279, 292 ], "loc": { "start": { "line": 15, - "column": 4 + "column": 1 }, "end": { "line": 15, @@ -1046,7 +1115,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, 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 070c4a4e..b1d8b3c2 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 @@ -399,17 +399,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 120, + 127 + ], + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 120, + 115, 127 ], "loc": { "start": { "line": 7, - "column": 29 + "column": 24 }, "end": { "line": 7, @@ -417,7 +435,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", @@ -603,17 +620,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fly", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fly", + "range": [ + 187, + 190 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 187, + 176, 190 ], "loc": { "start": { "line": 12, - "column": 15 + "column": 4 }, "end": { "line": 12, @@ -621,7 +656,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": { diff --git a/tests/fixtures/parser/ast/tutorial/animate-output.json b/tests/fixtures/parser/ast/tutorial/animate-output.json index 0584d941..7bd216ad 100644 --- a/tests/fixtures/parser/ast/tutorial/animate-output.json +++ b/tests/fixtures/parser/ast/tutorial/animate-output.json @@ -4532,17 +4532,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "keydown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "keydown", + "range": [ + 1324, + 1331 + ], + "loc": { + "start": { + "line": 60, + "column": 5 + }, + "end": { + "line": 60, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1324, + 1321, 1331 ], "loc": { "start": { "line": 60, - "column": 5 + "column": 2 }, "end": { "line": 60, @@ -4550,7 +4568,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -5382,17 +5399,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1486, + 1493 + ], + "loc": { + "start": { + "line": 67, + "column": 7 + }, + "end": { + "line": 67, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1486, + 1483, 1493 ], "loc": { "start": { "line": 67, - "column": 7 + "column": 4 }, "end": { "line": 67, @@ -5400,7 +5435,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -5534,17 +5568,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1521, + 1525 + ], + "loc": { + "start": { + "line": 68, + "column": 8 + }, + "end": { + "line": 68, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1521, + 1517, 1525 ], "loc": { "start": { "line": 68, - "column": 8 + "column": 4 }, "end": { "line": 68, @@ -5552,7 +5604,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -5686,17 +5737,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 1557, + 1561 + ], + "loc": { + "start": { + "line": 69, + "column": 12 + }, + "end": { + "line": 69, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 1557, + 1549, 1561 ], "loc": { "start": { "line": 69, - "column": 12 + "column": 4 }, "end": { "line": 69, @@ -5704,7 +5773,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 1549, @@ -5840,17 +5908,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 1595, + 1601 + ], + "loc": { + "start": { + "line": 71, + "column": 28 + }, + "end": { + "line": 71, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 1595, + 1592, 1601 ], "loc": { "start": { "line": 71, - "column": 28 + "column": 25 }, "end": { "line": 71, @@ -5858,7 +5944,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -6141,17 +6226,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 1666, + 1671 + ], + "loc": { + "start": { + "line": 73, + "column": 15 + }, + "end": { + "line": 73, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 1666, + 1663, 1671 ], "loc": { "start": { "line": 73, - "column": 15 + "column": 12 }, "end": { "line": 73, @@ -6159,7 +6262,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -7016,17 +7118,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1867, + 1874 + ], + "loc": { + "start": { + "line": 83, + "column": 7 + }, + "end": { + "line": 83, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1867, + 1864, 1874 ], "loc": { "start": { "line": 83, - "column": 7 + "column": 4 }, "end": { "line": 83, @@ -7034,7 +7154,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -7168,17 +7287,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1902, + 1906 + ], + "loc": { + "start": { + "line": 84, + "column": 8 + }, + "end": { + "line": 84, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1902, + 1898, 1906 ], "loc": { "start": { "line": 84, - "column": 8 + "column": 4 }, "end": { "line": 84, @@ -7186,7 +7323,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -7320,17 +7456,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 1938, + 1942 + ], + "loc": { + "start": { + "line": 85, + "column": 12 + }, + "end": { + "line": 85, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 1938, + 1930, 1942 ], "loc": { "start": { "line": 85, - "column": 12 + "column": 4 }, "end": { "line": 85, @@ -7338,7 +7492,6 @@ } } }, - "modifiers": [], "expression": { "type": "ObjectExpression", "properties": [ @@ -7587,17 +7740,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 2004, + 2010 + ], + "loc": { + "start": { + "line": 87, + "column": 36 + }, + "end": { + "line": 87, + "column": 42 + } + } + }, + "modifiers": [], "range": [ - 2004, + 2001, 2010 ], "loc": { "start": { "line": 87, - "column": 36 + "column": 33 }, "end": { "line": 87, @@ -7605,7 +7776,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -7888,17 +8058,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 2076, + 2081 + ], + "loc": { + "start": { + "line": 89, + "column": 15 + }, + "end": { + "line": 89, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 2076, + 2073, 2081 ], "loc": { "start": { "line": 89, - "column": 15 + "column": 12 }, "end": { "line": 89, @@ -7906,7 +8094,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/animate-scope-output.json b/tests/fixtures/parser/ast/tutorial/animate-scope-output.json index 830f2c47..2ec1349b 100644 --- a/tests/fixtures/parser/ast/tutorial/animate-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/animate-scope-output.json @@ -16292,17 +16292,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1486, + 1493 + ], + "loc": { + "start": { + "line": 67, + "column": 7 + }, + "end": { + "line": 67, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1486, + 1483, 1493 ], "loc": { "start": { "line": 67, - "column": 7 + "column": 4 }, "end": { "line": 67, @@ -16310,7 +16328,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -16444,17 +16461,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1521, + 1525 + ], + "loc": { + "start": { + "line": 68, + "column": 8 + }, + "end": { + "line": 68, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1521, + 1517, 1525 ], "loc": { "start": { "line": 68, - "column": 8 + "column": 4 }, "end": { "line": 68, @@ -16462,7 +16497,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -16596,17 +16630,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 1557, + 1561 + ], + "loc": { + "start": { + "line": 69, + "column": 12 + }, + "end": { + "line": 69, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 1557, + 1549, 1561 ], "loc": { "start": { "line": 69, - "column": 12 + "column": 4 }, "end": { "line": 69, @@ -16614,7 +16666,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 1549, @@ -16750,17 +16801,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 1595, + 1601 + ], + "loc": { + "start": { + "line": 71, + "column": 28 + }, + "end": { + "line": 71, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 1595, + 1592, 1601 ], "loc": { "start": { "line": 71, - "column": 28 + "column": 25 }, "end": { "line": 71, @@ -16768,7 +16837,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -17051,17 +17119,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 1666, + 1671 + ], + "loc": { + "start": { + "line": 73, + "column": 15 + }, + "end": { + "line": 73, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 1666, + 1663, 1671 ], "loc": { "start": { "line": 73, - "column": 15 + "column": 12 }, "end": { "line": 73, @@ -17069,7 +17155,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -18981,17 +19066,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1867, + 1874 + ], + "loc": { + "start": { + "line": 83, + "column": 7 + }, + "end": { + "line": 83, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1867, + 1864, 1874 ], "loc": { "start": { "line": 83, - "column": 7 + "column": 4 }, "end": { "line": 83, @@ -18999,7 +19102,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -19133,17 +19235,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1902, + 1906 + ], + "loc": { + "start": { + "line": 84, + "column": 8 + }, + "end": { + "line": 84, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1902, + 1898, 1906 ], "loc": { "start": { "line": 84, - "column": 8 + "column": 4 }, "end": { "line": 84, @@ -19151,7 +19271,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -19285,17 +19404,35 @@ { "type": "SvelteDirective", "kind": "Animation", - "name": { - "type": "Identifier", - "name": "flip", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "flip", + "range": [ + 1938, + 1942 + ], + "loc": { + "start": { + "line": 85, + "column": 12 + }, + "end": { + "line": 85, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 1938, + 1930, 1942 ], "loc": { "start": { "line": 85, - "column": 12 + "column": 4 }, "end": { "line": 85, @@ -19303,7 +19440,6 @@ } } }, - "modifiers": [], "expression": { "type": "ObjectExpression", "properties": [ @@ -19552,17 +19688,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 2004, + 2010 + ], + "loc": { + "start": { + "line": 87, + "column": 36 + }, + "end": { + "line": 87, + "column": 42 + } + } + }, + "modifiers": [], "range": [ - 2004, + 2001, 2010 ], "loc": { "start": { "line": 87, - "column": 36 + "column": 33 }, "end": { "line": 87, @@ -19570,7 +19724,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -19853,17 +20006,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 2076, + 2081 + ], + "loc": { + "start": { + "line": 89, + "column": 15 + }, + "end": { + "line": 89, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 2076, + 2073, 2081 ], "loc": { "start": { "line": 89, - "column": 15 + "column": 12 }, "end": { "line": 89, @@ -19871,7 +20042,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/await-blocks-output.json b/tests/fixtures/parser/ast/tutorial/await-blocks-output.json index ff41229f..16c138b7 100644 --- a/tests/fixtures/parser/ast/tutorial/await-blocks-output.json +++ b/tests/fixtures/parser/ast/tutorial/await-blocks-output.json @@ -932,17 +932,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 326, + 331 + ], + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 326, + 323, 331 ], "loc": { "start": { "line": 20, - "column": 11 + "column": 8 }, "end": { "line": 20, @@ -950,7 +968,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/tutorial/bind-this-output.json b/tests/fixtures/parser/ast/tutorial/bind-this-output.json index e38e3e69..2ce62c37 100644 --- a/tests/fixtures/parser/ast/tutorial/bind-this-output.json +++ b/tests/fixtures/parser/ast/tutorial/bind-this-output.json @@ -3819,17 +3819,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 1073, + 1077 + ], + "loc": { + "start": { + "line": 50, + "column": 6 + }, + "end": { + "line": 50, + "column": 10 + } + } + }, + "modifiers": [], "range": [ - 1073, + 1068, 1077 ], "loc": { "start": { "line": 50, - "column": 6 + "column": 1 }, "end": { "line": 50, @@ -3837,7 +3855,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "canvas", diff --git a/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json b/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json index 084bbeed..24b404d9 100644 --- a/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json +++ b/tests/fixtures/parser/ast/tutorial/checkbox-inputs-output.json @@ -308,17 +308,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 73, + 80 + ], + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 73, + 68, 80 ], "loc": { "start": { "line": 6, - "column": 27 + "column": 22 }, "end": { "line": 6, @@ -326,7 +344,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "yes", diff --git a/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json b/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json index 50a4e130..3b909bb0 100644 --- a/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json +++ b/tests/fixtures/parser/ast/tutorial/class-shorthand-output.json @@ -417,17 +417,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 120, + 127 + ], + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 120, + 115, 127 ], "loc": { "start": { "line": 12, - "column": 27 + "column": 22 }, "end": { "line": 12, @@ -435,7 +453,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "big", @@ -599,17 +616,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "big", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "big", + "range": [ + 161, + 164 + ], + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 161, + 155, 164 ], "loc": { "start": { "line": 16, - "column": 11 + "column": 5 }, "end": { "line": 16, @@ -617,7 +652,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "big", diff --git a/tests/fixtures/parser/ast/tutorial/classes-output.json b/tests/fixtures/parser/ast/tutorial/classes-output.json index dc43f536..cc6d203c 100644 --- a/tests/fixtures/parser/ast/tutorial/classes-output.json +++ b/tests/fixtures/parser/ast/tutorial/classes-output.json @@ -302,17 +302,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "selected", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "selected", + "range": [ + 168, + 176 + ], + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 168, + 162, 176 ], "loc": { "start": { "line": 17, - "column": 7 + "column": 1 }, "end": { "line": 17, @@ -320,7 +338,6 @@ } } }, - "modifiers": [], "expression": { "type": "BinaryExpression", "left": { @@ -394,17 +411,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 203, + 208 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "modifiers": [], "range": [ - 203, + 200, 208 ], "loc": { "start": { "line": 18, - "column": 4 + "column": 1 }, "end": { "line": 18, @@ -412,7 +447,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -619,17 +653,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "selected", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "selected", + "range": [ + 265, + 273 + ], + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 265, + 259, 273 ], "loc": { "start": { "line": 22, - "column": 7 + "column": 1 }, "end": { "line": 22, @@ -637,7 +689,6 @@ } } }, - "modifiers": [], "expression": { "type": "BinaryExpression", "left": { @@ -711,17 +762,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 300, + 305 + ], + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 9 + } + } + }, + "modifiers": [], "range": [ - 300, + 297, 305 ], "loc": { "start": { "line": 23, - "column": 4 + "column": 1 }, "end": { "line": 23, @@ -729,7 +798,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1102,17 +1170,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 406, + 411 + ], + "loc": { + "start": { + "line": 28, + "column": 4 + }, + "end": { + "line": 28, + "column": 9 + } + } + }, + "modifiers": [], "range": [ - 406, + 403, 411 ], "loc": { "start": { "line": 28, - "column": 4 + "column": 1 }, "end": { "line": 28, @@ -1120,7 +1206,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json b/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json index c3278468..b229eeae 100644 --- a/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json +++ b/tests/fixtures/parser/ast/tutorial/component-bindings01-output.json @@ -979,17 +979,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 265, + 270 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 265, + 260, 270 ], "loc": { "start": { "line": 14, - "column": 13 + "column": 8 }, "end": { "line": 14, @@ -997,7 +1015,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "pin", @@ -1034,17 +1051,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "submit", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "submit", + "range": [ + 280, + 286 + ], + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 280, + 277, 286 ], "loc": { "start": { "line": 14, - "column": 28 + "column": 25 }, "end": { "line": 14, @@ -1052,7 +1087,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleSubmit", diff --git a/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json b/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json index 1f4a02f6..80cef36b 100644 --- a/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json +++ b/tests/fixtures/parser/ast/tutorial/component-bindings02-output.json @@ -1058,17 +1058,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 463, + 468 + ], + "loc": { + "start": { + "line": 27, + "column": 12 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 463, + 460, 468 ], "loc": { "start": { "line": 27, - "column": 12 + "column": 9 }, "end": { "line": 27, @@ -1076,7 +1094,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -1263,17 +1280,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 504, + 509 + ], + "loc": { + "start": { + "line": 28, + "column": 12 + }, + "end": { + "line": 28, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 504, + 501, 509 ], "loc": { "start": { "line": 28, - "column": 12 + "column": 9 }, "end": { "line": 28, @@ -1281,7 +1316,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -1468,17 +1502,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 545, + 550 + ], + "loc": { + "start": { + "line": 29, + "column": 12 + }, + "end": { + "line": 29, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 545, + 542, 550 ], "loc": { "start": { "line": 29, - "column": 12 + "column": 9 }, "end": { "line": 29, @@ -1486,7 +1538,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -1673,17 +1724,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 586, + 591 + ], + "loc": { + "start": { + "line": 30, + "column": 12 + }, + "end": { + "line": 30, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 586, + 583, 591 ], "loc": { "start": { "line": 30, - "column": 12 + "column": 9 }, "end": { "line": 30, @@ -1691,7 +1760,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -1878,17 +1946,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 627, + 632 + ], + "loc": { + "start": { + "line": 31, + "column": 12 + }, + "end": { + "line": 31, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 627, + 624, 632 ], "loc": { "start": { "line": 31, - "column": 12 + "column": 9 }, "end": { "line": 31, @@ -1896,7 +1982,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -2083,17 +2168,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 668, + 673 + ], + "loc": { + "start": { + "line": 32, + "column": 12 + }, + "end": { + "line": 32, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 668, + 665, 673 ], "loc": { "start": { "line": 32, - "column": 12 + "column": 9 }, "end": { "line": 32, @@ -2101,7 +2204,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -2288,17 +2390,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 709, + 714 + ], + "loc": { + "start": { + "line": 33, + "column": 12 + }, + "end": { + "line": 33, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 709, + 706, 714 ], "loc": { "start": { "line": 33, - "column": 12 + "column": 9 }, "end": { "line": 33, @@ -2306,7 +2426,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -2493,17 +2612,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 750, + 755 + ], + "loc": { + "start": { + "line": 34, + "column": 12 + }, + "end": { + "line": 34, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 750, + 747, 755 ], "loc": { "start": { "line": 34, - "column": 12 + "column": 9 }, "end": { "line": 34, @@ -2511,7 +2648,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -2698,17 +2834,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 791, + 796 + ], + "loc": { + "start": { + "line": 35, + "column": 12 + }, + "end": { + "line": 35, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 791, + 788, 796 ], "loc": { "start": { "line": 35, - "column": 12 + "column": 9 }, "end": { "line": 35, @@ -2716,7 +2870,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -2996,17 +3149,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 851, + 856 + ], + "loc": { + "start": { + "line": 37, + "column": 30 + }, + "end": { + "line": 37, + "column": 35 + } + } + }, + "modifiers": [], "range": [ - 851, + 848, 856 ], "loc": { "start": { "line": 37, - "column": 30 + "column": 27 }, "end": { "line": 37, @@ -3014,7 +3185,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "clear", @@ -3162,17 +3332,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 892, + 897 + ], + "loc": { + "start": { + "line": 38, + "column": 12 + }, + "end": { + "line": 38, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 892, + 889, 897 ], "loc": { "start": { "line": 38, - "column": 12 + "column": 9 }, "end": { "line": 38, @@ -3180,7 +3368,6 @@ } } }, - "modifiers": [], "expression": { "type": "CallExpression", "arguments": [ @@ -3460,17 +3647,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 951, + 956 + ], + "loc": { + "start": { + "line": 39, + "column": 30 + }, + "end": { + "line": 39, + "column": 35 + } + } + }, + "modifiers": [], "range": [ - 951, + 948, 956 ], "loc": { "start": { "line": 39, - "column": 30 + "column": 27 }, "end": { "line": 39, @@ -3478,7 +3683,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "submit", diff --git a/tests/fixtures/parser/ast/tutorial/component-events01-output.json b/tests/fixtures/parser/ast/tutorial/component-events01-output.json index cc70c122..5a87a3e9 100644 --- a/tests/fixtures/parser/ast/tutorial/component-events01-output.json +++ b/tests/fixtures/parser/ast/tutorial/component-events01-output.json @@ -416,17 +416,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "message", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "message", + "range": [ + 132, + 139 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 132, + 129, 139 ], "loc": { "start": { "line": 9, - "column": 10 + "column": 7 }, "end": { "line": 9, @@ -434,7 +452,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMessage", diff --git a/tests/fixtures/parser/ast/tutorial/component-events02-output.json b/tests/fixtures/parser/ast/tutorial/component-events02-output.json index 2b62a6fa..d126ab62 100644 --- a/tests/fixtures/parser/ast/tutorial/component-events02-output.json +++ b/tests/fixtures/parser/ast/tutorial/component-events02-output.json @@ -511,17 +511,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 199, + 204 + ], + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 199, + 196, 204 ], "loc": { "start": { "line": 13, - "column": 11 + "column": 8 }, "end": { "line": 13, @@ -529,7 +547,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "sayHello", diff --git a/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json b/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json index abc11af5..c7e170e8 100644 --- a/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/contenteditable-bindings-output.json @@ -249,17 +249,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "innerHTML", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "innerHTML", + "range": [ + 92, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 33 + }, + "end": { + "line": 5, + "column": 42 + } + } + }, + "modifiers": [], "range": [ - 92, + 87, 101 ], "loc": { "start": { "line": 5, - "column": 33 + "column": 28 }, "end": { "line": 5, @@ -267,7 +285,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "html", diff --git a/tests/fixtures/parser/ast/tutorial/context-api02-output.json b/tests/fixtures/parser/ast/tutorial/context-api02-output.json index 0e1b19cb..b2dd3669 100644 --- a/tests/fixtures/parser/ast/tutorial/context-api02-output.json +++ b/tests/fixtures/parser/ast/tutorial/context-api02-output.json @@ -2473,17 +2473,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 739, + 743 + ], + "loc": { + "start": { + "line": 46, + "column": 10 + }, + "end": { + "line": 46, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 739, + 734, 743 ], "loc": { "start": { "line": 46, - "column": 10 + "column": 5 }, "end": { "line": 46, @@ -2491,7 +2509,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "container", 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 123b5a38..c70219ce 100644 --- a/tests/fixtures/parser/ast/tutorial/custom-css-transitions01-output.json +++ b/tests/fixtures/parser/ast/tutorial/custom-css-transitions01-output.json @@ -1583,17 +1583,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 548, + 555 + ], + "loc": { + "start": { + "line": 41, + "column": 29 + }, + "end": { + "line": 41, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 548, + 543, 555 ], "loc": { "start": { "line": 41, - "column": 29 + "column": 24 }, "end": { "line": 41, @@ -1601,7 +1619,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", @@ -1843,17 +1860,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "spin", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "spin", + "range": [ + 626, + 630 + ], + "loc": { + "start": { + "line": 46, + "column": 26 + }, + "end": { + "line": 46, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 626, + 623, 630 ], "loc": { "start": { "line": 46, - "column": 26 + "column": 23 }, "end": { "line": 46, @@ -1861,7 +1896,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -1959,17 +1993,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 656, + 660 + ], + "loc": { + "start": { + "line": 46, + "column": 56 + }, + "end": { + "line": 46, + "column": 60 + } + } + }, + "modifiers": [], "range": [ - 656, + 652, 660 ], "loc": { "start": { "line": 46, - "column": 56 + "column": 52 }, "end": { "line": 46, @@ -1977,7 +2029,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": null, 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 a820ec75..dc5825f3 100644 --- a/tests/fixtures/parser/ast/tutorial/custom-css-transitions02-output.json +++ b/tests/fixtures/parser/ast/tutorial/custom-css-transitions02-output.json @@ -1763,17 +1763,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 695, + 702 + ], + "loc": { + "start": { + "line": 41, + "column": 29 + }, + "end": { + "line": 41, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 695, + 690, 702 ], "loc": { "start": { "line": 41, - "column": 29 + "column": 24 }, "end": { "line": 41, @@ -1781,7 +1799,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", @@ -2023,17 +2040,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "spin", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "spin", + "range": [ + 773, + 777 + ], + "loc": { + "start": { + "line": 46, + "column": 26 + }, + "end": { + "line": 46, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 773, + 770, 777 ], "loc": { "start": { "line": 46, - "column": 26 + "column": 23 }, "end": { "line": 46, @@ -2041,7 +2076,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -2139,17 +2173,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 803, + 807 + ], + "loc": { + "start": { + "line": 46, + "column": 56 + }, + "end": { + "line": 46, + "column": 60 + } + } + }, + "modifiers": [], "range": [ - 803, + 799, 807 ], "loc": { "start": { "line": 46, - "column": 56 + "column": 52 }, "end": { "line": 46, @@ -2157,7 +2209,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": null, 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 0033e005..b81f4aa4 100644 --- a/tests/fixtures/parser/ast/tutorial/custom-js-transitions-output.json +++ b/tests/fixtures/parser/ast/tutorial/custom-js-transitions-output.json @@ -1906,17 +1906,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 550, + 557 + ], + "loc": { + "start": { + "line": 28, + "column": 29 + }, + "end": { + "line": 28, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 550, + 545, 557 ], "loc": { "start": { "line": 28, - "column": 29 + "column": 24 }, "end": { "line": 28, @@ -1924,7 +1942,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", @@ -2110,17 +2127,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "typewriter", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "typewriter", + "range": [ + 609, + 619 + ], + "loc": { + "start": { + "line": 33, + "column": 7 + }, + "end": { + "line": 33, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 609, + 606, 619 ], "loc": { "start": { "line": 33, - "column": 7 + "column": 4 }, "end": { "line": 33, @@ -2128,7 +2163,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": null, diff --git a/tests/fixtures/parser/ast/tutorial/custom-stores-output.json b/tests/fixtures/parser/ast/tutorial/custom-stores-output.json index 4bd87da9..8332df3e 100644 --- a/tests/fixtures/parser/ast/tutorial/custom-stores-output.json +++ b/tests/fixtures/parser/ast/tutorial/custom-stores-output.json @@ -356,17 +356,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 101, + 106 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 101, + 98, 106 ], "loc": { "start": { "line": 7, - "column": 11 + "column": 8 }, "end": { "line": 7, @@ -374,7 +392,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -559,17 +576,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 147, + 152 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 147, + 144, 152 ], "loc": { "start": { "line": 8, - "column": 11 + "column": 8 }, "end": { "line": 8, @@ -577,7 +612,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -762,17 +796,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 193, + 198 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 193, + 190, 198 ], "loc": { "start": { "line": 9, - "column": 11 + "column": 8 }, "end": { "line": 9, @@ -780,7 +832,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, diff --git a/tests/fixtures/parser/ast/tutorial/debug01-output.json b/tests/fixtures/parser/ast/tutorial/debug01-output.json index b447cc3d..2d683957 100644 --- a/tests/fixtures/parser/ast/tutorial/debug01-output.json +++ b/tests/fixtures/parser/ast/tutorial/debug01-output.json @@ -309,17 +309,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 93, + 98 + ], + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 93, + 88, 98 ], "loc": { "start": { "line": 8, - "column": 12 + "column": 7 }, "end": { "line": 8, @@ -327,7 +345,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -477,17 +494,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 129, + 134 + ], + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 129, + 124, 134 ], "loc": { "start": { "line": 9, - "column": 12 + "column": 7 }, "end": { "line": 9, @@ -495,7 +530,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, diff --git a/tests/fixtures/parser/ast/tutorial/debug02-output.json b/tests/fixtures/parser/ast/tutorial/debug02-output.json index 49ba8674..a2950522 100644 --- a/tests/fixtures/parser/ast/tutorial/debug02-output.json +++ b/tests/fixtures/parser/ast/tutorial/debug02-output.json @@ -309,17 +309,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 93, + 98 + ], + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 93, + 88, 98 ], "loc": { "start": { "line": 8, - "column": 12 + "column": 7 }, "end": { "line": 8, @@ -327,7 +345,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -477,17 +494,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 129, + 134 + ], + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 129, + 124, 134 ], "loc": { "start": { "line": 9, - "column": 12 + "column": 7 }, "end": { "line": 9, @@ -495,7 +530,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, diff --git a/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json b/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json index ce44bc9c..e9488c46 100644 --- a/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json +++ b/tests/fixtures/parser/ast/tutorial/deferred-transitions-output.json @@ -4441,17 +4441,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "keydown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "keydown", + "range": [ + 1284, + 1291 + ], + "loc": { + "start": { + "line": 59, + "column": 5 + }, + "end": { + "line": 59, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1284, + 1281, 1291 ], "loc": { "start": { "line": 59, - "column": 5 + "column": 2 }, "end": { "line": 59, @@ -4459,7 +4477,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -5291,17 +5308,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1446, + 1453 + ], + "loc": { + "start": { + "line": 66, + "column": 7 + }, + "end": { + "line": 66, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1446, + 1443, 1453 ], "loc": { "start": { "line": 66, - "column": 7 + "column": 4 }, "end": { "line": 66, @@ -5309,7 +5344,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -5443,17 +5477,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1481, + 1485 + ], + "loc": { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 67, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1481, + 1477, 1485 ], "loc": { "start": { "line": 67, - "column": 8 + "column": 4 }, "end": { "line": 67, @@ -5461,7 +5513,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -5711,17 +5762,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 1538, + 1544 + ], + "loc": { + "start": { + "line": 69, + "column": 28 + }, + "end": { + "line": 69, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 1538, + 1535, 1544 ], "loc": { "start": { "line": 69, - "column": 28 + "column": 25 }, "end": { "line": 69, @@ -5729,7 +5798,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -6012,17 +6080,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 1609, + 1614 + ], + "loc": { + "start": { + "line": 71, + "column": 15 + }, + "end": { + "line": 71, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 1609, + 1606, 1614 ], "loc": { "start": { "line": 71, - "column": 15 + "column": 12 }, "end": { "line": 71, @@ -6030,7 +6116,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -6887,17 +6972,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1806, + 1813 + ], + "loc": { + "start": { + "line": 80, + "column": 7 + }, + "end": { + "line": 80, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1806, + 1803, 1813 ], "loc": { "start": { "line": 80, - "column": 7 + "column": 4 }, "end": { "line": 80, @@ -6905,7 +7008,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -7039,17 +7141,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1841, + 1845 + ], + "loc": { + "start": { + "line": 81, + "column": 8 + }, + "end": { + "line": 81, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1841, + 1837, 1845 ], "loc": { "start": { "line": 81, - "column": 8 + "column": 4 }, "end": { "line": 81, @@ -7057,7 +7177,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -7344,17 +7463,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 1902, + 1908 + ], + "loc": { + "start": { + "line": 82, + "column": 36 + }, + "end": { + "line": 82, + "column": 42 + } + } + }, + "modifiers": [], "range": [ - 1902, + 1899, 1908 ], "loc": { "start": { "line": 82, - "column": 36 + "column": 33 }, "end": { "line": 82, @@ -7362,7 +7499,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -7645,17 +7781,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 1974, + 1979 + ], + "loc": { + "start": { + "line": 84, + "column": 15 + }, + "end": { + "line": 84, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 1974, + 1971, 1979 ], "loc": { "start": { "line": 84, - "column": 15 + "column": 12 }, "end": { "line": 84, @@ -7663,7 +7817,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, 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 f2d00138..dbe099fb 100644 --- a/tests/fixtures/parser/ast/tutorial/deferred-transitions-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/deferred-transitions-scope-output.json @@ -16111,17 +16111,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1446, + 1453 + ], + "loc": { + "start": { + "line": 66, + "column": 7 + }, + "end": { + "line": 66, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1446, + 1443, 1453 ], "loc": { "start": { "line": 66, - "column": 7 + "column": 4 }, "end": { "line": 66, @@ -16129,7 +16147,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -16263,17 +16280,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1481, + 1485 + ], + "loc": { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 67, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1481, + 1477, 1485 ], "loc": { "start": { "line": 67, - "column": 8 + "column": 4 }, "end": { "line": 67, @@ -16281,7 +16316,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -16531,17 +16565,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 1538, + 1544 + ], + "loc": { + "start": { + "line": 69, + "column": 28 + }, + "end": { + "line": 69, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 1538, + 1535, 1544 ], "loc": { "start": { "line": 69, - "column": 28 + "column": 25 }, "end": { "line": 69, @@ -16549,7 +16601,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -16832,17 +16883,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 1609, + 1614 + ], + "loc": { + "start": { + "line": 71, + "column": 15 + }, + "end": { + "line": 71, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 1609, + 1606, 1614 ], "loc": { "start": { "line": 71, - "column": 15 + "column": 12 }, "end": { "line": 71, @@ -16850,7 +16919,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -18682,17 +18750,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "receive", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "receive", + "range": [ + 1806, + 1813 + ], + "loc": { + "start": { + "line": 80, + "column": 7 + }, + "end": { + "line": 80, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 1806, + 1803, 1813 ], "loc": { "start": { "line": 80, - "column": 7 + "column": 4 }, "end": { "line": 80, @@ -18700,7 +18786,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -18834,17 +18919,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "send", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "send", + "range": [ + 1841, + 1845 + ], + "loc": { + "start": { + "line": 81, + "column": 8 + }, + "end": { + "line": 81, + "column": 12 + } + } + }, + "modifiers": [], "range": [ - 1841, + 1837, 1845 ], "loc": { "start": { "line": 81, - "column": 8 + "column": 4 }, "end": { "line": 81, @@ -18852,7 +18955,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": { @@ -19139,17 +19241,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 1902, + 1908 + ], + "loc": { + "start": { + "line": 82, + "column": 36 + }, + "end": { + "line": 82, + "column": 42 + } + } + }, + "modifiers": [], "range": [ - 1902, + 1899, 1908 ], "loc": { "start": { "line": 82, - "column": 36 + "column": 33 }, "end": { "line": 82, @@ -19157,7 +19277,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -19440,17 +19559,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 1974, + 1979 + ], + "loc": { + "start": { + "line": 84, + "column": 15 + }, + "end": { + "line": 84, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 1974, + 1971, 1979 ], "loc": { "start": { "line": 84, - "column": 15 + "column": 12 }, "end": { "line": 84, @@ -19458,7 +19595,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/dimensions-output.json b/tests/fixtures/parser/ast/tutorial/dimensions-output.json index b6b065b3..cbb187f6 100644 --- a/tests/fixtures/parser/ast/tutorial/dimensions-output.json +++ b/tests/fixtures/parser/ast/tutorial/dimensions-output.json @@ -544,17 +544,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 208, + 213 + ], + "loc": { + "start": { + "line": 14, + "column": 23 + }, + "end": { + "line": 14, + "column": 28 + } + } + }, + "modifiers": [], "range": [ - 208, + 203, 213 ], "loc": { "start": { "line": 14, - "column": 23 + "column": 18 }, "end": { "line": 14, @@ -562,7 +580,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "size", @@ -675,17 +692,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 234, + 239 + ], + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 234, + 229, 239 ], "loc": { "start": { "line": 15, - "column": 12 + "column": 7 }, "end": { "line": 15, @@ -693,7 +728,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "text", @@ -1024,17 +1058,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "clientWidth", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "clientWidth", + "range": [ + 287, + 298 + ], + "loc": { + "start": { + "line": 19, + "column": 10 + }, + "end": { + "line": 19, + "column": 21 + } + } + }, + "modifiers": [], "range": [ - 287, + 282, 298 ], "loc": { "start": { "line": 19, - "column": 10 + "column": 5 }, "end": { "line": 19, @@ -1042,7 +1094,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "w", @@ -1079,17 +1130,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "clientHeight", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "clientHeight", + "range": [ + 308, + 320 + ], + "loc": { + "start": { + "line": 19, + "column": 31 + }, + "end": { + "line": 19, + "column": 43 + } + } + }, + "modifiers": [], "range": [ - 308, + 303, 320 ], "loc": { "start": { "line": 19, - "column": 31 + "column": 26 }, "end": { "line": 19, @@ -1097,7 +1166,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "h", diff --git a/tests/fixtures/parser/ast/tutorial/dom-event-forwarding01-output.json b/tests/fixtures/parser/ast/tutorial/dom-event-forwarding01-output.json index 758ea3db..5c761aa6 100644 --- a/tests/fixtures/parser/ast/tutorial/dom-event-forwarding01-output.json +++ b/tests/fixtures/parser/ast/tutorial/dom-event-forwarding01-output.json @@ -324,17 +324,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 138, + 143 + ], + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + } + }, + "modifiers": [], "range": [ - 138, + 135, 143 ], "loc": { "start": { "line": 9, - "column": 17 + "column": 14 }, "end": { "line": 9, @@ -342,7 +360,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/tutorial/dom-event-forwarding02-output.json b/tests/fixtures/parser/ast/tutorial/dom-event-forwarding02-output.json index f7c7dbbc..e4586052 100644 --- a/tests/fixtures/parser/ast/tutorial/dom-event-forwarding02-output.json +++ b/tests/fixtures/parser/ast/tutorial/dom-event-forwarding02-output.json @@ -137,17 +137,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 396, + 401 + ], + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 396, + 393, 401 ], "loc": { "start": { "line": 20, - "column": 11 + "column": 8 }, "end": { "line": 20, @@ -155,7 +173,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 393, diff --git a/tests/fixtures/parser/ast/tutorial/dom-events-output.json b/tests/fixtures/parser/ast/tutorial/dom-events-output.json index decdd293..e7c5c293 100644 --- a/tests/fixtures/parser/ast/tutorial/dom-events-output.json +++ b/tests/fixtures/parser/ast/tutorial/dom-events-output.json @@ -785,17 +785,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mousemove", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mousemove", + "range": [ + 192, + 201 + ], + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 192, + 189, 201 ], "loc": { "start": { "line": 14, - "column": 8 + "column": 5 }, "end": { "line": 14, @@ -803,7 +821,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMousemove", 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 7f39b472..d8144fdd 100644 --- a/tests/fixtures/parser/ast/tutorial/each-block-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/each-block-bindings-output.json @@ -1795,17 +1795,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "done", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "done", + "range": [ + 458, + 462 + ], + "loc": { + "start": { + "line": 28, + "column": 12 + }, + "end": { + "line": 28, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 458, + 452, 462 ], "loc": { "start": { "line": 28, - "column": 12 + "column": 6 }, "end": { "line": 28, @@ -1813,7 +1831,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -2003,17 +2020,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 510, + 517 + ], + "loc": { + "start": { + "line": 31, + "column": 8 + }, + "end": { + "line": 31, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 510, + 505, 517 ], "loc": { "start": { "line": 31, - "column": 8 + "column": 3 }, "end": { "line": 31, @@ -2021,7 +2056,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -2227,17 +2261,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 592, + 597 + ], + "loc": { + "start": { + "line": 36, + "column": 8 + }, + "end": { + "line": 36, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 592, + 587, 597 ], "loc": { "start": { "line": 36, - "column": 8 + "column": 3 }, "end": { "line": 36, @@ -2245,7 +2297,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -2609,17 +2660,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 672, + 677 + ], + "loc": { + "start": { + "line": 43, + "column": 11 + }, + "end": { + "line": 43, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 672, + 669, 677 ], "loc": { "start": { "line": 43, - "column": 11 + "column": 8 }, "end": { "line": 43, @@ -2627,7 +2696,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "add", @@ -2775,17 +2843,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 716, + 721 + ], + "loc": { + "start": { + "line": 47, + "column": 11 + }, + "end": { + "line": 47, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 716, + 713, 721 ], "loc": { "start": { "line": 47, - "column": 11 + "column": 8 }, "end": { "line": 47, @@ -2793,7 +2879,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "clear", 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 a42074e2..9f2ff246 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 @@ -3216,17 +3216,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "done", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "done", + "range": [ + 458, + 462 + ], + "loc": { + "start": { + "line": 28, + "column": 12 + }, + "end": { + "line": 28, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 458, + 452, 462 ], "loc": { "start": { "line": 28, - "column": 12 + "column": 6 }, "end": { "line": 28, @@ -3234,7 +3252,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -3424,17 +3441,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 510, + 517 + ], + "loc": { + "start": { + "line": 31, + "column": 8 + }, + "end": { + "line": 31, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 510, + 505, 517 ], "loc": { "start": { "line": 31, - "column": 8 + "column": 3 }, "end": { "line": 31, @@ -3442,7 +3477,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -3648,17 +3682,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 592, + 597 + ], + "loc": { + "start": { + "line": 36, + "column": 8 + }, + "end": { + "line": 36, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 592, + 587, 597 ], "loc": { "start": { "line": 36, - "column": 8 + "column": 3 }, "end": { "line": 36, @@ -3666,7 +3718,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, diff --git a/tests/fixtures/parser/ast/tutorial/else-blocks-output.json b/tests/fixtures/parser/ast/tutorial/else-blocks-output.json index 201831e4..8a97a419 100644 --- a/tests/fixtures/parser/ast/tutorial/else-blocks-output.json +++ b/tests/fixtures/parser/ast/tutorial/else-blocks-output.json @@ -532,17 +532,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 144, + 149 + ], + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 144, + 141, 149 ], "loc": { "start": { "line": 10, - "column": 12 + "column": 9 }, "end": { "line": 10, @@ -550,7 +568,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "toggle", @@ -684,17 +701,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 201, + 206 + ], + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 201, + 198, 206 ], "loc": { "start": { "line": 14, - "column": 12 + "column": 9 }, "end": { "line": 14, @@ -702,7 +737,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "toggle", diff --git a/tests/fixtures/parser/ast/tutorial/event-forwarding01-output.json b/tests/fixtures/parser/ast/tutorial/event-forwarding01-output.json index 9dce557f..ad601817 100644 --- a/tests/fixtures/parser/ast/tutorial/event-forwarding01-output.json +++ b/tests/fixtures/parser/ast/tutorial/event-forwarding01-output.json @@ -416,17 +416,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "message", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "message", + "range": [ + 132, + 139 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 132, + 129, 139 ], "loc": { "start": { "line": 9, - "column": 10 + "column": 7 }, "end": { "line": 9, @@ -434,7 +452,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMessage", diff --git a/tests/fixtures/parser/ast/tutorial/event-forwarding02-output.json b/tests/fixtures/parser/ast/tutorial/event-forwarding02-output.json index 2b62a6fa..d126ab62 100644 --- a/tests/fixtures/parser/ast/tutorial/event-forwarding02-output.json +++ b/tests/fixtures/parser/ast/tutorial/event-forwarding02-output.json @@ -511,17 +511,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 199, + 204 + ], + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 199, + 196, 204 ], "loc": { "start": { "line": 13, - "column": 11 + "column": 8 }, "end": { "line": 13, @@ -529,7 +547,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "sayHello", diff --git a/tests/fixtures/parser/ast/tutorial/event-forwarding03-output.json b/tests/fixtures/parser/ast/tutorial/event-forwarding03-output.json index 59a3561f..64c89770 100644 --- a/tests/fixtures/parser/ast/tutorial/event-forwarding03-output.json +++ b/tests/fixtures/parser/ast/tutorial/event-forwarding03-output.json @@ -581,17 +581,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "message", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "message", + "range": [ + 228, + 235 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 228, + 225, 235 ], "loc": { "start": { "line": 12, - "column": 10 + "column": 7 }, "end": { "line": 12, @@ -599,7 +617,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "forward", diff --git a/tests/fixtures/parser/ast/tutorial/event-forwarding04-output.json b/tests/fixtures/parser/ast/tutorial/event-forwarding04-output.json index c2899c4f..4a27341d 100644 --- a/tests/fixtures/parser/ast/tutorial/event-forwarding04-output.json +++ b/tests/fixtures/parser/ast/tutorial/event-forwarding04-output.json @@ -192,17 +192,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "message", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "message", + "range": [ + 67, + 74 + ], + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 67, + 64, 74 ], "loc": { "start": { "line": 5, - "column": 10 + "column": 7 }, "end": { "line": 5, @@ -210,7 +228,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 64, diff --git a/tests/fixtures/parser/ast/tutorial/event-modifiers-output.json b/tests/fixtures/parser/ast/tutorial/event-modifiers-output.json index 94a17d67..54b16e0a 100644 --- a/tests/fixtures/parser/ast/tutorial/event-modifiers-output.json +++ b/tests/fixtures/parser/ast/tutorial/event-modifiers-output.json @@ -251,27 +251,44 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 86, + 91 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 16 + } + } + }, + "modifiers": [ + "once" + ], "range": [ - 86, - 91 + 83, + 96 ], "loc": { "start": { "line": 7, - "column": 11 + "column": 8 }, "end": { "line": 7, - "column": 16 + "column": 21 } } }, - "modifiers": [ - "once" - ], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/tutorial/group-inputs-output.json b/tests/fixtures/parser/ast/tutorial/group-inputs-output.json index f7801e8e..444e0d64 100644 --- a/tests/fixtures/parser/ast/tutorial/group-inputs-output.json +++ b/tests/fixtures/parser/ast/tutorial/group-inputs-output.json @@ -1343,17 +1343,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 367, + 372 + ], + "loc": { + "start": { + "line": 19, + "column": 24 + }, + "end": { + "line": 19, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 367, + 362, 372 ], "loc": { "start": { "line": 19, - "column": 24 + "column": 19 }, "end": { "line": 19, @@ -1361,7 +1379,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "scoops", @@ -1715,17 +1732,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 446, + 451 + ], + "loc": { + "start": { + "line": 24, + "column": 24 + }, + "end": { + "line": 24, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 446, + 441, 451 ], "loc": { "start": { "line": 24, - "column": 24 + "column": 19 }, "end": { "line": 24, @@ -1733,7 +1768,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "scoops", @@ -2087,17 +2121,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 526, + 531 + ], + "loc": { + "start": { + "line": 29, + "column": 24 + }, + "end": { + "line": 29, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 526, + 521, 531 ], "loc": { "start": { "line": 29, - "column": 24 + "column": 19 }, "end": { "line": 29, @@ -2105,7 +2157,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "scoops", @@ -2610,17 +2661,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 656, + 661 + ], + "loc": { + "start": { + "line": 37, + "column": 28 + }, + "end": { + "line": 37, + "column": 33 + } + } + }, + "modifiers": [], "range": [ - 656, + 651, 661 ], "loc": { "start": { "line": 37, - "column": 28 + "column": 23 }, "end": { "line": 37, @@ -2628,7 +2697,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "flavours", 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 7aec0ab3..6d7ed4a3 100644 --- a/tests/fixtures/parser/ast/tutorial/group-inputs-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/group-inputs-scope-output.json @@ -3553,17 +3553,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 656, + 661 + ], + "loc": { + "start": { + "line": 37, + "column": 28 + }, + "end": { + "line": 37, + "column": 33 + } + } + }, + "modifiers": [], "range": [ - 656, + 651, 661 ], "loc": { "start": { "line": 37, - "column": 28 + "column": 23 }, "end": { "line": 37, @@ -3571,7 +3589,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "flavours", diff --git a/tests/fixtures/parser/ast/tutorial/if-blocks-output.json b/tests/fixtures/parser/ast/tutorial/if-blocks-output.json index 34d69ad1..4604cea2 100644 --- a/tests/fixtures/parser/ast/tutorial/if-blocks-output.json +++ b/tests/fixtures/parser/ast/tutorial/if-blocks-output.json @@ -532,17 +532,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 144, + 149 + ], + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 144, + 141, 149 ], "loc": { "start": { "line": 10, - "column": 12 + "column": 9 }, "end": { "line": 10, @@ -550,7 +568,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "toggle", @@ -793,17 +810,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 221, + 226 + ], + "loc": { + "start": { + "line": 16, + "column": 12 + }, + "end": { + "line": 16, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 221, + 218, 226 ], "loc": { "start": { "line": 16, - "column": 12 + "column": 9 }, "end": { "line": 16, @@ -811,7 +846,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "toggle", 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 252c7c2f..b3b0effe 100644 --- a/tests/fixtures/parser/ast/tutorial/in-and-out-output.json +++ b/tests/fixtures/parser/ast/tutorial/in-and-out-output.json @@ -452,17 +452,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 126, + 133 + ], + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 126, + 121, 133 ], "loc": { "start": { "line": 7, - "column": 29 + "column": 24 }, "end": { "line": 7, @@ -470,7 +488,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", @@ -656,17 +673,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fly", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fly", + "range": [ + 185, + 188 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 10 + } + } + }, + "modifiers": [], "range": [ - 185, + 182, 188 ], "loc": { "start": { "line": 12, - "column": 7 + "column": 4 }, "end": { "line": 12, @@ -674,7 +709,6 @@ } } }, - "modifiers": [], "intro": true, "outro": false, "expression": { @@ -830,17 +864,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 224, + 228 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "modifiers": [], "range": [ - 224, + 220, 228 ], "loc": { "start": { "line": 12, - "column": 46 + "column": 42 }, "end": { "line": 12, @@ -848,7 +900,6 @@ } } }, - "modifiers": [], "intro": false, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/tutorial/inline-handlers-output.json b/tests/fixtures/parser/ast/tutorial/inline-handlers-output.json index 29638791..3d6ffc5d 100644 --- a/tests/fixtures/parser/ast/tutorial/inline-handlers-output.json +++ b/tests/fixtures/parser/ast/tutorial/inline-handlers-output.json @@ -785,17 +785,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mousemove", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mousemove", + "range": [ + 192, + 201 + ], + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 192, + 189, 201 ], "loc": { "start": { "line": 14, - "column": 8 + "column": 5 }, "end": { "line": 14, @@ -803,7 +821,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, 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 c932d866..752e070c 100644 --- a/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-output.json +++ b/tests/fixtures/parser/ast/tutorial/keyed-each-blocks-output.json @@ -1146,17 +1146,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 298, + 303 + ], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 298, + 295, 303 ], "loc": { "start": { "line": 17, - "column": 11 + "column": 8 }, "end": { "line": 17, @@ -1164,7 +1182,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/tutorial/local-transitions-output.json b/tests/fixtures/parser/ast/tutorial/local-transitions-output.json index 014c10ad..0fdd5a84 100644 --- a/tests/fixtures/parser/ast/tutorial/local-transitions-output.json +++ b/tests/fixtures/parser/ast/tutorial/local-transitions-output.json @@ -846,17 +846,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 309, + 316 + ], + "loc": { + "start": { + "line": 17, + "column": 29 + }, + "end": { + "line": 17, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 309, + 304, 316 ], "loc": { "start": { "line": 17, - "column": 29 + "column": 24 }, "end": { "line": 17, @@ -864,7 +882,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "showItems", @@ -1143,17 +1160,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 385, + 390 + ], + "loc": { + "start": { + "line": 22, + "column": 26 + }, + "end": { + "line": 22, + "column": 31 + } + } + }, + "modifiers": [], "range": [ - 385, + 380, 390 ], "loc": { "start": { "line": 22, - "column": 26 + "column": 21 }, "end": { "line": 22, @@ -1161,7 +1196,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "i", @@ -1538,27 +1572,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "slide", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "slide", + "range": [ + 483, + 488 + ], + "loc": { + "start": { + "line": 28, + "column": 18 + }, + "end": { + "line": 28, + "column": 23 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 483, - 488 + 472, + 494 ], "loc": { "start": { "line": 28, - "column": 18 + "column": 7 }, "end": { "line": 28, - "column": 23 + "column": 29 } } }, - "modifiers": [ - "local" - ], "intro": true, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/tutorial/local-transitions-scope-output.json b/tests/fixtures/parser/ast/tutorial/local-transitions-scope-output.json index acc58930..af378fb0 100644 --- a/tests/fixtures/parser/ast/tutorial/local-transitions-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/local-transitions-scope-output.json @@ -1520,27 +1520,44 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "slide", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "slide", + "range": [ + 483, + 488 + ], + "loc": { + "start": { + "line": 28, + "column": 18 + }, + "end": { + "line": 28, + "column": 23 + } + } + }, + "modifiers": [ + "local" + ], "range": [ - 483, - 488 + 472, + 494 ], "loc": { "start": { "line": 28, - "column": 18 + "column": 7 }, "end": { "line": 28, - "column": 23 + "column": 29 } } }, - "modifiers": [ - "local" - ], "intro": true, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/tutorial/media-elements-output.json b/tests/fixtures/parser/ast/tutorial/media-elements-output.json index 645a138f..a510263e 100644 --- a/tests/fixtures/parser/ast/tutorial/media-elements-output.json +++ b/tests/fixtures/parser/ast/tutorial/media-elements-output.json @@ -4082,17 +4082,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mousemove", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mousemove", + "range": [ + 2287, + 2296 + ], + "loc": { + "start": { + "line": 114, + "column": 5 + }, + "end": { + "line": 114, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 2287, + 2284, 2296 ], "loc": { "start": { "line": 114, - "column": 5 + "column": 2 }, "end": { "line": 114, @@ -4100,7 +4118,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMousemove", @@ -4137,17 +4154,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mousedown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mousedown", + "range": [ + 2320, + 2329 + ], + "loc": { + "start": { + "line": 115, + "column": 5 + }, + "end": { + "line": 115, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 2320, + 2317, 2329 ], "loc": { "start": { "line": 115, - "column": 5 + "column": 2 }, "end": { "line": 115, @@ -4155,7 +4190,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMousedown", @@ -4192,17 +4226,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "currentTime", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "currentTime", + "range": [ + 2355, + 2366 + ], + "loc": { + "start": { + "line": 116, + "column": 7 + }, + "end": { + "line": 116, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 2355, + 2350, 2366 ], "loc": { "start": { "line": 116, - "column": 7 + "column": 2 }, "end": { "line": 116, @@ -4210,7 +4262,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "time", @@ -4247,17 +4298,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "duration", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "duration", + "range": [ + 2381, + 2389 + ], + "loc": { + "start": { + "line": 117, + "column": 7 + }, + "end": { + "line": 117, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 2381, + 2376, 2389 ], "loc": { "start": { "line": 117, - "column": 7 + "column": 2 }, "end": { "line": 117, @@ -4265,7 +4334,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "duration", @@ -4302,17 +4370,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "paused", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "paused", + "range": [ + 2397, + 2403 + ], + "loc": { + "start": { + "line": 118, + "column": 7 + }, + "end": { + "line": 118, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 2397, + 2392, 2403 ], "loc": { "start": { "line": 118, - "column": 7 + "column": 2 }, "end": { "line": 118, @@ -4320,7 +4406,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "paused", diff --git a/tests/fixtures/parser/ast/tutorial/module-exports01-output.json b/tests/fixtures/parser/ast/tutorial/module-exports01-output.json index 1fd4491d..1b4d3557 100644 --- a/tests/fixtures/parser/ast/tutorial/module-exports01-output.json +++ b/tests/fixtures/parser/ast/tutorial/module-exports01-output.json @@ -245,17 +245,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 93, + 98 + ], + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 93, + 90, 98 ], "loc": { "start": { "line": 5, - "column": 11 + "column": 8 }, "end": { "line": 5, @@ -263,7 +281,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "stopAll", diff --git a/tests/fixtures/parser/ast/tutorial/module-exports02-output.json b/tests/fixtures/parser/ast/tutorial/module-exports02-output.json index 00e92230..e6d666d6 100644 --- a/tests/fixtures/parser/ast/tutorial/module-exports02-output.json +++ b/tests/fixtures/parser/ast/tutorial/module-exports02-output.json @@ -2019,17 +2019,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "playing", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "playing", + "range": [ + 713, + 720 + ], + "loc": { + "start": { + "line": 41, + "column": 15 + }, + "end": { + "line": 41, + "column": 22 + } + } + }, + "modifiers": [], "range": [ - 713, + 707, 720 ], "loc": { "start": { "line": 41, - "column": 15 + "column": 9 }, "end": { "line": 41, @@ -2037,7 +2055,6 @@ } } }, - "modifiers": [], "expression": { "type": "UnaryExpression", "argument": { @@ -2537,17 +2554,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 829, + 833 + ], + "loc": { + "start": { + "line": 46, + "column": 7 + }, + "end": { + "line": 46, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 829, + 824, 833 ], "loc": { "start": { "line": 46, - "column": 7 + "column": 2 }, "end": { "line": 46, @@ -2555,7 +2590,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "audio", @@ -2592,17 +2626,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "paused", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "paused", + "range": [ + 849, + 855 + ], + "loc": { + "start": { + "line": 47, + "column": 7 + }, + "end": { + "line": 47, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 849, + 844, 855 ], "loc": { "start": { "line": 47, - "column": 7 + "column": 2 }, "end": { "line": 47, @@ -2610,7 +2662,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "paused", @@ -2647,17 +2698,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "play", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "play", + "range": [ + 861, + 865 + ], + "loc": { + "start": { + "line": 48, + "column": 5 + }, + "end": { + "line": 48, + "column": 9 + } + } + }, + "modifiers": [], "range": [ - 861, + 858, 865 ], "loc": { "start": { "line": 48, - "column": 5 + "column": 2 }, "end": { "line": 48, @@ -2665,7 +2734,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "stopOthers", 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 9f119aa6..6501e77e 100644 --- a/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/multiple-select-bindings-output.json @@ -1343,17 +1343,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 368, + 373 + ], + "loc": { + "start": { + "line": 20, + "column": 24 + }, + "end": { + "line": 20, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 368, + 363, 373 ], "loc": { "start": { "line": 20, - "column": 24 + "column": 19 }, "end": { "line": 20, @@ -1361,7 +1379,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "scoops", @@ -1715,17 +1732,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 447, + 452 + ], + "loc": { + "start": { + "line": 25, + "column": 24 + }, + "end": { + "line": 25, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 447, + 442, 452 ], "loc": { "start": { "line": 25, - "column": 24 + "column": 19 }, "end": { "line": 25, @@ -1733,7 +1768,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "scoops", @@ -2087,17 +2121,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "group", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "group", + "range": [ + 527, + 532 + ], + "loc": { + "start": { + "line": 30, + "column": 24 + }, + "end": { + "line": 30, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 527, + 522, 532 ], "loc": { "start": { "line": 30, - "column": 24 + "column": 19 }, "end": { "line": 30, @@ -2105,7 +2157,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "scoops", @@ -2491,17 +2542,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 618, + 623 + ], + "loc": { + "start": { + "line": 36, + "column": 22 + }, + "end": { + "line": 36, + "column": 27 + } + } + }, + "modifiers": [], "range": [ - 618, + 613, 623 ], "loc": { "start": { "line": 36, - "column": 22 + "column": 17 }, "end": { "line": 36, @@ -2509,7 +2578,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "flavours", diff --git a/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json b/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json index 920a5280..4bf4142d 100644 --- a/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json +++ b/tests/fixtures/parser/ast/tutorial/numeric-inputs02-output.json @@ -382,17 +382,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 77, + 82 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 77, + 72, 82 ], "loc": { "start": { "line": 7, - "column": 25 + "column": 20 }, "end": { "line": 7, @@ -400,7 +418,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "a", @@ -681,17 +698,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 125, + 130 + ], + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 125, + 120, 130 ], "loc": { "start": { "line": 8, - "column": 24 + "column": 19 }, "end": { "line": 8, @@ -699,7 +734,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "a", @@ -1090,17 +1124,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 192, + 197 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 30 + } + } + }, + "modifiers": [], "range": [ - 192, + 187, 197 ], "loc": { "start": { "line": 12, - "column": 25 + "column": 20 }, "end": { "line": 12, @@ -1108,7 +1160,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "b", @@ -1389,17 +1440,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 240, + 235, 245 ], "loc": { "start": { "line": 13, - "column": 24 + "column": 19 }, "end": { "line": 13, @@ -1407,7 +1476,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "b", diff --git a/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json b/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json index 63db4f64..33615901 100644 --- a/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json +++ b/tests/fixtures/parser/ast/tutorial/optional-slots03-output.json @@ -489,17 +489,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "has-discussion", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "has-discussion", + "range": [ + 742, + 756 + ], + "loc": { + "start": { + "line": 53, + "column": 15 + }, + "end": { + "line": 53, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 742, + 736, 756 ], "loc": { "start": { "line": 53, - "column": 15 + "column": 9 }, "end": { "line": 53, @@ -507,7 +525,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, diff --git a/tests/fixtures/parser/ast/tutorial/reactive-assignments-output.json b/tests/fixtures/parser/ast/tutorial/reactive-assignments-output.json index 9677adef..23d7ef97 100644 --- a/tests/fixtures/parser/ast/tutorial/reactive-assignments-output.json +++ b/tests/fixtures/parser/ast/tutorial/reactive-assignments-output.json @@ -323,17 +323,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 131, + 136 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 131, + 128, 136 ], "loc": { "start": { "line": 10, - "column": 11 + "column": 8 }, "end": { "line": 10, @@ -341,7 +359,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/tutorial/reactive-declarations-output.json b/tests/fixtures/parser/ast/tutorial/reactive-declarations-output.json index 8eeefaaa..9243aab8 100644 --- a/tests/fixtures/parser/ast/tutorial/reactive-declarations-output.json +++ b/tests/fixtures/parser/ast/tutorial/reactive-declarations-output.json @@ -466,17 +466,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 119, + 124 + ], + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 119, + 116, 124 ], "loc": { "start": { "line": 10, - "column": 11 + "column": 8 }, "end": { "line": 10, @@ -484,7 +502,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/tutorial/reactive-statements-output.json b/tests/fixtures/parser/ast/tutorial/reactive-statements-output.json index 5f5f0fdd..ddbbb6d1 100644 --- a/tests/fixtures/parser/ast/tutorial/reactive-statements-output.json +++ b/tests/fixtures/parser/ast/tutorial/reactive-statements-output.json @@ -1196,17 +1196,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 301, + 306 + ], + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 301, + 298, 306 ], "loc": { "start": { "line": 18, - "column": 11 + "column": 8 }, "end": { "line": 18, @@ -1214,7 +1232,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleClick", diff --git a/tests/fixtures/parser/ast/tutorial/select-bindings-output.json b/tests/fixtures/parser/ast/tutorial/select-bindings-output.json index d5184995..2021281f 100644 --- a/tests/fixtures/parser/ast/tutorial/select-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/select-bindings-output.json @@ -1366,27 +1366,44 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "submit", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "submit", + "range": [ + 505, + 511 + ], + "loc": { + "start": { + "line": 23, + "column": 9 + }, + "end": { + "line": 23, + "column": 15 + } + } + }, + "modifiers": [ + "preventDefault" + ], "range": [ - 505, - 511 + 502, + 526 ], "loc": { "start": { "line": 23, - "column": 9 + "column": 6 }, "end": { "line": 23, - "column": 15 + "column": 30 } } }, - "modifiers": [ - "preventDefault" - ], "expression": { "type": "Identifier", "name": "handleSubmit", @@ -1483,17 +1500,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 557, + 562 + ], + "loc": { + "start": { + "line": 24, + "column": 14 + }, + "end": { + "line": 24, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 557, + 552, 562 ], "loc": { "start": { "line": 24, - "column": 14 + "column": 9 }, "end": { "line": 24, @@ -1501,7 +1536,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "selected", @@ -1538,17 +1572,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "change", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "change", + "range": [ + 577, + 583 + ], + "loc": { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 40 + } + } + }, + "modifiers": [], "range": [ - 577, + 574, 583 ], "loc": { "start": { "line": 24, - "column": 34 + "column": 31 }, "end": { "line": 24, @@ -1556,7 +1608,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -2097,17 +2148,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 736, + 741 + ], + "loc": { + "start": { + "line": 32, + "column": 13 + }, + "end": { + "line": 32, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 736, + 731, 741 ], "loc": { "start": { "line": 32, - "column": 13 + "column": 8 }, "end": { "line": 32, @@ -2115,7 +2184,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "answer", diff --git a/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json b/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json index 08b9d591..91df06f5 100644 --- a/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json +++ b/tests/fixtures/parser/ast/tutorial/sharing-code02-output.json @@ -1190,17 +1190,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "playing", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "playing", + "range": [ + 477, + 484 + ], + "loc": { + "start": { + "line": 27, + "column": 15 + }, + "end": { + "line": 27, + "column": 22 + } + } + }, + "modifiers": [], "range": [ - 477, + 471, 484 ], "loc": { "start": { "line": 27, - "column": 15 + "column": 9 }, "end": { "line": 27, @@ -1208,7 +1226,6 @@ } } }, - "modifiers": [], "expression": { "type": "UnaryExpression", "argument": { @@ -1708,17 +1725,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 593, + 597 + ], + "loc": { + "start": { + "line": 32, + "column": 7 + }, + "end": { + "line": 32, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 593, + 588, 597 ], "loc": { "start": { "line": 32, - "column": 7 + "column": 2 }, "end": { "line": 32, @@ -1726,7 +1761,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "audio", @@ -1763,17 +1797,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "paused", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "paused", + "range": [ + 613, + 619 + ], + "loc": { + "start": { + "line": 33, + "column": 7 + }, + "end": { + "line": 33, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 613, + 608, 619 ], "loc": { "start": { "line": 33, - "column": 7 + "column": 2 }, "end": { "line": 33, @@ -1781,7 +1833,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "paused", @@ -1818,17 +1869,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "play", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "play", + "range": [ + 625, + 629 + ], + "loc": { + "start": { + "line": 34, + "column": 5 + }, + "end": { + "line": 34, + "column": 9 + } + } + }, + "modifiers": [], "range": [ - 625, + 622, 629 ], "loc": { "start": { "line": 34, - "column": 5 + "column": 2 }, "end": { "line": 34, @@ -1836,7 +1905,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "stopOthers", diff --git a/tests/fixtures/parser/ast/tutorial/slot-props01-output.json b/tests/fixtures/parser/ast/tutorial/slot-props01-output.json index 6e4a9989..38d892a6 100644 --- a/tests/fixtures/parser/ast/tutorial/slot-props01-output.json +++ b/tests/fixtures/parser/ast/tutorial/slot-props01-output.json @@ -301,17 +301,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "hovering", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "hovering", + "range": [ + 231, + 239 + ], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 23 + } + } + }, + "modifiers": [], "range": [ - 231, + 227, 239 ], "loc": { "start": { "line": 18, - "column": 15 + "column": 11 }, "end": { "line": 18, @@ -319,7 +337,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "active", @@ -416,17 +433,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "active", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "active", + "range": [ + 262, + 268 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 262, + 256, 268 ], "loc": { "start": { "line": 19, - "column": 12 + "column": 6 }, "end": { "line": 19, @@ -434,7 +469,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "active", diff --git a/tests/fixtures/parser/ast/tutorial/slot-props01-scope-output.json b/tests/fixtures/parser/ast/tutorial/slot-props01-scope-output.json index b7cba23b..df465651 100644 --- a/tests/fixtures/parser/ast/tutorial/slot-props01-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/slot-props01-scope-output.json @@ -265,17 +265,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "hovering", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "hovering", + "range": [ + 231, + 239 + ], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 23 + } + } + }, + "modifiers": [], "range": [ - 231, + 227, 239 ], "loc": { "start": { "line": 18, - "column": 15 + "column": 11 }, "end": { "line": 18, @@ -283,7 +301,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "active", @@ -380,17 +397,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "active", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "active", + "range": [ + 262, + 268 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 262, + 256, 268 ], "loc": { "start": { "line": 19, - "column": 12 + "column": 6 }, "end": { "line": 19, @@ -398,7 +433,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "active", diff --git a/tests/fixtures/parser/ast/tutorial/slot-props02-output.json b/tests/fixtures/parser/ast/tutorial/slot-props02-output.json index c657f255..9532d642 100644 --- a/tests/fixtures/parser/ast/tutorial/slot-props02-output.json +++ b/tests/fixtures/parser/ast/tutorial/slot-props02-output.json @@ -435,17 +435,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseenter", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseenter", + "range": [ + 130, + 140 + ], + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 130, + 127, 140 ], "loc": { "start": { "line": 13, - "column": 8 + "column": 5 }, "end": { "line": 13, @@ -453,7 +471,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "enter", @@ -490,17 +507,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseleave", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseleave", + "range": [ + 152, + 162 + ], + "loc": { + "start": { + "line": 13, + "column": 30 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + "modifiers": [], "range": [ - 152, + 149, 162 ], "loc": { "start": { "line": 13, - "column": 30 + "column": 27 }, "end": { "line": 13, @@ -508,7 +543,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "leave", diff --git a/tests/fixtures/parser/ast/tutorial/slot-props03-output.json b/tests/fixtures/parser/ast/tutorial/slot-props03-output.json index 59fb7618..20c33435 100644 --- a/tests/fixtures/parser/ast/tutorial/slot-props03-output.json +++ b/tests/fixtures/parser/ast/tutorial/slot-props03-output.json @@ -301,17 +301,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "hovering", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "hovering", + "range": [ + 231, + 239 + ], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 23 + } + } + }, + "modifiers": [], "range": [ - 231, + 227, 239 ], "loc": { "start": { "line": 18, - "column": 15 + "column": 11 }, "end": { "line": 18, @@ -319,7 +337,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "hovering", @@ -416,17 +433,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "active", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "active", + "range": [ + 264, + 270 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 264, + 258, 270 ], "loc": { "start": { "line": 19, - "column": 12 + "column": 6 }, "end": { "line": 19, @@ -434,7 +469,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "hovering", diff --git a/tests/fixtures/parser/ast/tutorial/slot-props03-scope-output.json b/tests/fixtures/parser/ast/tutorial/slot-props03-scope-output.json index 2c26181b..828a532e 100644 --- a/tests/fixtures/parser/ast/tutorial/slot-props03-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/slot-props03-scope-output.json @@ -265,17 +265,35 @@ { "type": "SvelteDirective", "kind": "Let", - "name": { - "type": "Identifier", - "name": "hovering", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "hovering", + "range": [ + 231, + 239 + ], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 23 + } + } + }, + "modifiers": [], "range": [ - 231, + 227, 239 ], "loc": { "start": { "line": 18, - "column": 15 + "column": 11 }, "end": { "line": 18, @@ -283,7 +301,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "hovering", @@ -380,17 +397,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "active", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "active", + "range": [ + 264, + 270 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 264, + 258, 270 ], "loc": { "start": { "line": 19, - "column": 12 + "column": 6 }, "end": { "line": 19, @@ -398,7 +433,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "hovering", diff --git a/tests/fixtures/parser/ast/tutorial/spring-output.json b/tests/fixtures/parser/ast/tutorial/spring-output.json index 909a6503..55ef43de 100644 --- a/tests/fixtures/parser/ast/tutorial/spring-output.json +++ b/tests/fixtures/parser/ast/tutorial/spring-output.json @@ -1170,17 +1170,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 371, + 376 + ], + "loc": { + "start": { + "line": 19, + "column": 14 + }, + "end": { + "line": 19, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 371, + 366, 376 ], "loc": { "start": { "line": 19, - "column": 14 + "column": 9 }, "end": { "line": 19, @@ -1188,7 +1206,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -1873,17 +1890,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 510, + 515 + ], + "loc": { + "start": { + "line": 24, + "column": 14 + }, + "end": { + "line": 24, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 510, + 505, 515 ], "loc": { "start": { "line": 24, - "column": 14 + "column": 9 }, "end": { "line": 24, @@ -1891,7 +1926,6 @@ } } }, - "modifiers": [], "expression": { "type": "MemberExpression", "computed": false, @@ -2367,17 +2401,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mousemove", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mousemove", + "range": [ + 602, + 611 + ], + "loc": { + "start": { + "line": 29, + "column": 4 + }, + "end": { + "line": 29, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 602, + 599, 611 ], "loc": { "start": { "line": 29, - "column": 4 + "column": 1 }, "end": { "line": 29, @@ -2385,7 +2437,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -2727,17 +2778,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mousedown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mousedown", + "range": [ + 668, + 677 + ], + "loc": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 30, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 668, + 665, 677 ], "loc": { "start": { "line": 30, - "column": 4 + "column": 1 }, "end": { "line": 30, @@ -2745,7 +2814,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -2880,17 +2948,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseup", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseup", + "range": [ + 705, + 712 + ], + "loc": { + "start": { + "line": 31, + "column": 4 + }, + "end": { + "line": 31, + "column": 11 + } + } + }, + "modifiers": [], "range": [ - 705, + 702, 712 ], "loc": { "start": { "line": 31, - "column": 4 + "column": 1 }, "end": { "line": 31, @@ -2898,7 +2984,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/svelte-body-output.json b/tests/fixtures/parser/ast/tutorial/svelte-body-output.json index ba06b3b4..d2ffea6d 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-body-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-body-output.json @@ -566,17 +566,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseenter", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseenter", + "range": [ + 453, + 463 + ], + "loc": { + "start": { + "line": 28, + "column": 4 + }, + "end": { + "line": 28, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 453, + 450, 463 ], "loc": { "start": { "line": 28, - "column": 4 + "column": 1 }, "end": { "line": 28, @@ -584,7 +602,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMouseenter", @@ -621,17 +638,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "mouseleave", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "mouseleave", + "range": [ + 487, + 497 + ], + "loc": { + "start": { + "line": 29, + "column": 4 + }, + "end": { + "line": 29, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 487, + 484, 497 ], "loc": { "start": { "line": 29, - "column": 4 + "column": 1 }, "end": { "line": 29, @@ -639,7 +674,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleMouseleave", @@ -788,17 +822,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "curious", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "curious", + "range": [ + 612, + 619 + ], + "loc": { + "start": { + "line": 34, + "column": 7 + }, + "end": { + "line": 34, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 612, + 606, 619 ], "loc": { "start": { "line": 34, - "column": 7 + "column": 1 }, "end": { "line": 34, @@ -806,7 +858,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "hereKitty", diff --git a/tests/fixtures/parser/ast/tutorial/svelte-component-output.json b/tests/fixtures/parser/ast/tutorial/svelte-component-output.json index 32234993..9dd1ec1d 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-component-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-component-output.json @@ -925,17 +925,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 356, + 361 + ], + "loc": { + "start": { + "line": 15, + "column": 13 + }, + "end": { + "line": 15, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 356, + 351, 361 ], "loc": { "start": { "line": 15, - "column": 13 + "column": 8 }, "end": { "line": 15, @@ -943,7 +961,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "selected", @@ -1389,6 +1406,23 @@ { "type": "SvelteSpecialDirective", "kind": "this", + "key": { + "type": "SvelteSpecialDirectiveKey", + "range": [ + 488, + 492 + ], + "loc": { + "start": { + "line": 21, + "column": 18 + }, + "end": { + "line": 21, + "column": 22 + } + } + }, "expression": { "type": "MemberExpression", "computed": false, diff --git a/tests/fixtures/parser/ast/tutorial/svelte-options01-output.json b/tests/fixtures/parser/ast/tutorial/svelte-options01-output.json index 14c4cf8c..e2b77dd8 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-options01-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-options01-output.json @@ -1777,17 +1777,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 537, + 542 + ], + "loc": { + "start": { + "line": 29, + "column": 17 + }, + "end": { + "line": 29, + "column": 22 + } + } + }, + "modifiers": [], "range": [ - 537, + 534, 542 ], "loc": { "start": { "line": 29, - "column": 17 + "column": 14 }, "end": { "line": 29, @@ -1795,7 +1813,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/svelte-options01-scope-output.json b/tests/fixtures/parser/ast/tutorial/svelte-options01-scope-output.json index 482094e4..fdad0a9a 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-options01-scope-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-options01-scope-output.json @@ -4240,17 +4240,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 537, + 542 + ], + "loc": { + "start": { + "line": 29, + "column": 17 + }, + "end": { + "line": 29, + "column": 22 + } + } + }, + "modifiers": [], "range": [ - 537, + 534, 542 ], "loc": { "start": { "line": 29, - "column": 17 + "column": 14 }, "end": { "line": 29, @@ -4258,7 +4276,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json b/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json index 8703871c..42c9c99c 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-options02-output.json @@ -879,17 +879,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 350, + 354 + ], + "loc": { + "start": { + "line": 24, + "column": 10 + }, + "end": { + "line": 24, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 350, + 345, 354 ], "loc": { "start": { "line": 24, - "column": 10 + "column": 5 }, "end": { "line": 24, @@ -897,7 +915,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "div", @@ -934,17 +951,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 364, + 369 + ], + "loc": { + "start": { + "line": 24, + "column": 24 + }, + "end": { + "line": 24, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 364, + 361, 369 ], "loc": { "start": { "line": 24, - "column": 24 + "column": 21 }, "end": { "line": 24, @@ -952,7 +987,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 361, diff --git a/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json b/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json index fc8e7298..37dfe800 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-options03-output.json @@ -841,17 +841,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 343, + 347 + ], + "loc": { + "start": { + "line": 24, + "column": 10 + }, + "end": { + "line": 24, + "column": 14 + } + } + }, + "modifiers": [], "range": [ - 343, + 338, 347 ], "loc": { "start": { "line": 24, - "column": 10 + "column": 5 }, "end": { "line": 24, @@ -859,7 +877,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "div", @@ -896,17 +913,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 357, + 362 + ], + "loc": { + "start": { + "line": 24, + "column": 24 + }, + "end": { + "line": 24, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 357, + 354, 362 ], "loc": { "start": { "line": 24, - "column": 24 + "column": 21 }, "end": { "line": 24, @@ -914,7 +949,6 @@ } } }, - "modifiers": [], "expression": null, "range": [ 354, diff --git a/tests/fixtures/parser/ast/tutorial/svelte-self03-output.json b/tests/fixtures/parser/ast/tutorial/svelte-self03-output.json index 9e7df193..c53d38e5 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-self03-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-self03-output.json @@ -692,17 +692,35 @@ { "type": "SvelteDirective", "kind": "Class", - "name": { - "type": "Identifier", - "name": "expanded", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "expanded", + "range": [ + 585, + 593 + ], + "loc": { + "start": { + "line": 38, + "column": 12 + }, + "end": { + "line": 38, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 585, + 579, 593 ], "loc": { "start": { "line": 38, - "column": 12 + "column": 6 }, "end": { "line": 38, @@ -710,7 +728,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "expanded", @@ -747,17 +764,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 597, + 602 + ], + "loc": { + "start": { + "line": 38, + "column": 24 + }, + "end": { + "line": 38, + "column": 29 + } + } + }, + "modifiers": [], "range": [ - 597, + 594, 602 ], "loc": { "start": { "line": 38, - "column": 24 + "column": 21 }, "end": { "line": 38, @@ -765,7 +800,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "toggle", 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 2db12d17..c9d08f4d 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-window-bindings-output.json @@ -420,17 +420,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "scrollY", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "scrollY", + "range": [ + 94, + 101 + ], + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 27 + } + } + }, + "modifiers": [], "range": [ - 94, + 89, 101 ], "loc": { "start": { "line": 7, - "column": 20 + "column": 15 }, "end": { "line": 7, @@ -438,7 +456,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "y", diff --git a/tests/fixtures/parser/ast/tutorial/svelte-window-output.json b/tests/fixtures/parser/ast/tutorial/svelte-window-output.json index a841d3eb..3047e898 100644 --- a/tests/fixtures/parser/ast/tutorial/svelte-window-output.json +++ b/tests/fixtures/parser/ast/tutorial/svelte-window-output.json @@ -633,17 +633,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "keydown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "keydown", + "range": [ + 580, + 587 + ], + "loc": { + "start": { + "line": 33, + "column": 18 + }, + "end": { + "line": 33, + "column": 25 + } + } + }, + "modifiers": [], "range": [ - 580, + 577, 587 ], "loc": { "start": { "line": 33, - "column": 18 + "column": 15 }, "end": { "line": 33, @@ -651,7 +669,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleKeydown", diff --git a/tests/fixtures/parser/ast/tutorial/text-inputs01-output.json b/tests/fixtures/parser/ast/tutorial/text-inputs01-output.json index 67f2c318..25ce6998 100644 --- a/tests/fixtures/parser/ast/tutorial/text-inputs01-output.json +++ b/tests/fixtures/parser/ast/tutorial/text-inputs01-output.json @@ -193,17 +193,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 53, + 58 + ], + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 53, + 48, 58 ], "loc": { "start": { "line": 5, - "column": 12 + "column": 7 }, "end": { "line": 5, @@ -211,7 +229,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "name", diff --git a/tests/fixtures/parser/ast/tutorial/textarea-inputs-output.json b/tests/fixtures/parser/ast/tutorial/textarea-inputs-output.json index 4f167ce9..e63de2d3 100644 --- a/tests/fixtures/parser/ast/tutorial/textarea-inputs-output.json +++ b/tests/fixtures/parser/ast/tutorial/textarea-inputs-output.json @@ -398,17 +398,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "value", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "value", + "range": [ + 184, + 189 + ], + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 20 + } + } + }, + "modifiers": [], "range": [ - 184, + 179, 189 ], "loc": { "start": { "line": 10, - "column": 15 + "column": 10 }, "end": { "line": 10, @@ -416,7 +434,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "value", diff --git a/tests/fixtures/parser/ast/tutorial/tick-output.json b/tests/fixtures/parser/ast/tutorial/tick-output.json index 30b87404..fa273911 100644 --- a/tests/fixtures/parser/ast/tutorial/tick-output.json +++ b/tests/fixtures/parser/ast/tutorial/tick-output.json @@ -2111,17 +2111,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "keydown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "keydown", + "range": [ + 798, + 805 + ], + "loc": { + "start": { + "line": 37, + "column": 26 + }, + "end": { + "line": 37, + "column": 33 + } + } + }, + "modifiers": [], "range": [ - 798, + 795, 805 ], "loc": { "start": { "line": 37, - "column": 26 + "column": 23 }, "end": { "line": 37, @@ -2129,7 +2147,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleKeydown", diff --git a/tests/fixtures/parser/ast/tutorial/transition-events-output.json b/tests/fixtures/parser/ast/tutorial/transition-events-output.json index 93651e36..a7f896f9 100644 --- a/tests/fixtures/parser/ast/tutorial/transition-events-output.json +++ b/tests/fixtures/parser/ast/tutorial/transition-events-output.json @@ -619,17 +619,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 174, + 181 + ], + "loc": { + "start": { + "line": 11, + "column": 29 + }, + "end": { + "line": 11, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 174, + 169, 181 ], "loc": { "start": { "line": 11, - "column": 29 + "column": 24 }, "end": { "line": 11, @@ -637,7 +655,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", @@ -823,17 +840,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fly", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fly", + "range": [ + 243, + 246 + ], + "loc": { + "start": { + "line": 17, + "column": 13 + }, + "end": { + "line": 17, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 243, + 232, 246 ], "loc": { "start": { "line": 17, - "column": 13 + "column": 2 }, "end": { "line": 17, @@ -841,7 +876,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": { @@ -997,17 +1031,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "introstart", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "introstart", + "range": [ + 283, + 293 + ], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 283, + 280, 293 ], "loc": { "start": { "line": 18, - "column": 5 + "column": 2 }, "end": { "line": 18, @@ -1015,7 +1067,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1111,17 +1162,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "outrostart", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "outrostart", + "range": [ + 334, + 344 + ], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "modifiers": [], "range": [ - 334, + 331, 344 ], "loc": { "start": { "line": 19, - "column": 5 + "column": 2 }, "end": { "line": 19, @@ -1129,7 +1198,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1225,17 +1293,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "introend", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "introend", + "range": [ + 385, + 393 + ], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 385, + 382, 393 ], "loc": { "start": { "line": 20, - "column": 5 + "column": 2 }, "end": { "line": 20, @@ -1243,7 +1329,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1339,17 +1424,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "outroend", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "outroend", + "range": [ + 432, + 440 + ], + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 432, + 429, 440 ], "loc": { "start": { "line": 21, - "column": 5 + "column": 2 }, "end": { "line": 21, @@ -1357,7 +1460,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/transition-output.json b/tests/fixtures/parser/ast/tutorial/transition-output.json index 6609d36e..3a0bc95e 100644 --- a/tests/fixtures/parser/ast/tutorial/transition-output.json +++ b/tests/fixtures/parser/ast/tutorial/transition-output.json @@ -399,17 +399,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "checked", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "checked", + "range": [ + 121, + 128 + ], + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 36 + } + } + }, + "modifiers": [], "range": [ - 121, + 116, 128 ], "loc": { "start": { "line": 7, - "column": 29 + "column": 24 }, "end": { "line": 7, @@ -417,7 +435,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "visible", @@ -603,17 +620,35 @@ { "type": "SvelteDirective", "kind": "Transition", - "name": { - "type": "Identifier", - "name": "fade", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "fade", + "range": [ + 188, + 192 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 19 + } + } + }, + "modifiers": [], "range": [ - 188, + 177, 192 ], "loc": { "start": { "line": 12, - "column": 15 + "column": 4 }, "end": { "line": 12, @@ -621,7 +656,6 @@ } } }, - "modifiers": [], "intro": true, "outro": true, "expression": null, diff --git a/tests/fixtures/parser/ast/tutorial/tweened-output.json b/tests/fixtures/parser/ast/tutorial/tweened-output.json index a50dd5c5..c3f6eea3 100644 --- a/tests/fixtures/parser/ast/tutorial/tweened-output.json +++ b/tests/fixtures/parser/ast/tutorial/tweened-output.json @@ -822,17 +822,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 296, + 301 + ], + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 296, + 293, 301 ], "loc": { "start": { "line": 20, - "column": 11 + "column": 8 }, "end": { "line": 20, @@ -840,7 +858,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1086,17 +1103,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 355, + 360 + ], + "loc": { + "start": { + "line": 24, + "column": 11 + }, + "end": { + "line": 24, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 355, + 352, 360 ], "loc": { "start": { "line": 24, - "column": 11 + "column": 8 }, "end": { "line": 24, @@ -1104,7 +1139,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1350,17 +1384,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 418, + 423 + ], + "loc": { + "start": { + "line": 28, + "column": 11 + }, + "end": { + "line": 28, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 418, + 415, 423 ], "loc": { "start": { "line": 28, - "column": 11 + "column": 8 }, "end": { "line": 28, @@ -1368,7 +1420,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1614,17 +1665,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 480, + 485 + ], + "loc": { + "start": { + "line": 32, + "column": 11 + }, + "end": { + "line": 32, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 480, + 477, 485 ], "loc": { "start": { "line": 32, - "column": 11 + "column": 8 }, "end": { "line": 32, @@ -1632,7 +1701,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, @@ -1878,17 +1946,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 543, + 548 + ], + "loc": { + "start": { + "line": 36, + "column": 11 + }, + "end": { + "line": 36, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 543, + 540, 548 ], "loc": { "start": { "line": 36, - "column": 11 + "column": 8 }, "end": { "line": 36, @@ -1896,7 +1982,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/fixtures/parser/ast/tutorial/update-output.json b/tests/fixtures/parser/ast/tutorial/update-output.json index 098a45a6..6bd42a7a 100644 --- a/tests/fixtures/parser/ast/tutorial/update-output.json +++ b/tests/fixtures/parser/ast/tutorial/update-output.json @@ -4140,17 +4140,35 @@ { "type": "SvelteDirective", "kind": "Binding", - "name": { - "type": "Identifier", - "name": "this", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "this", + "range": [ + 1646, + 1650 + ], + "loc": { + "start": { + "line": 98, + "column": 30 + }, + "end": { + "line": 98, + "column": 34 + } + } + }, + "modifiers": [], "range": [ - 1646, + 1641, 1650 ], "loc": { "start": { "line": 98, - "column": 30 + "column": 25 }, "end": { "line": 98, @@ -4158,7 +4176,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "div", @@ -4751,17 +4768,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "keydown", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "keydown", + "range": [ + 1800, + 1807 + ], + "loc": { + "start": { + "line": 106, + "column": 11 + }, + "end": { + "line": 106, + "column": 18 + } + } + }, + "modifiers": [], "range": [ - 1800, + 1797, 1807 ], "loc": { "start": { "line": 106, - "column": 11 + "column": 8 }, "end": { "line": 106, @@ -4769,7 +4804,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "handleKeydown", diff --git a/tests/fixtures/parser/ast/tutorial/updating-arrays-and-objects-output.json b/tests/fixtures/parser/ast/tutorial/updating-arrays-and-objects-output.json index c1a06828..f39954df 100644 --- a/tests/fixtures/parser/ast/tutorial/updating-arrays-and-objects-output.json +++ b/tests/fixtures/parser/ast/tutorial/updating-arrays-and-objects-output.json @@ -1135,17 +1135,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 230, + 235 + ], + "loc": { + "start": { + "line": 14, + "column": 11 + }, + "end": { + "line": 14, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 230, + 227, 235 ], "loc": { "start": { "line": 14, - "column": 11 + "column": 8 }, "end": { "line": 14, @@ -1153,7 +1171,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "addNumber", diff --git a/tests/fixtures/parser/ast/tutorial/writable-stores02-output.json b/tests/fixtures/parser/ast/tutorial/writable-stores02-output.json index 7309774a..9f21e2ed 100644 --- a/tests/fixtures/parser/ast/tutorial/writable-stores02-output.json +++ b/tests/fixtures/parser/ast/tutorial/writable-stores02-output.json @@ -456,17 +456,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 125, + 130 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 125, + 122, 130 ], "loc": { "start": { "line": 9, - "column": 11 + "column": 8 }, "end": { "line": 9, @@ -474,7 +492,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "decrement", diff --git a/tests/fixtures/parser/ast/tutorial/writable-stores03-output.json b/tests/fixtures/parser/ast/tutorial/writable-stores03-output.json index bcbff5f7..caf4dbf4 100644 --- a/tests/fixtures/parser/ast/tutorial/writable-stores03-output.json +++ b/tests/fixtures/parser/ast/tutorial/writable-stores03-output.json @@ -456,17 +456,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 125, + 130 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 125, + 122, 130 ], "loc": { "start": { "line": 9, - "column": 11 + "column": 8 }, "end": { "line": 9, @@ -474,7 +492,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "increment", diff --git a/tests/fixtures/parser/ast/tutorial/writable-stores04-output.json b/tests/fixtures/parser/ast/tutorial/writable-stores04-output.json index 2d1ac449..28cdfb9f 100644 --- a/tests/fixtures/parser/ast/tutorial/writable-stores04-output.json +++ b/tests/fixtures/parser/ast/tutorial/writable-stores04-output.json @@ -379,17 +379,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 109, + 114 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "modifiers": [], "range": [ - 109, + 106, 114 ], "loc": { "start": { "line": 9, - "column": 11 + "column": 8 }, "end": { "line": 9, @@ -397,7 +415,6 @@ } } }, - "modifiers": [], "expression": { "type": "Identifier", "name": "reset", diff --git a/tests/fixtures/parser/ast/unused-write-only-store-output.json b/tests/fixtures/parser/ast/unused-write-only-store-output.json index 1990afa4..6b101c4b 100644 --- a/tests/fixtures/parser/ast/unused-write-only-store-output.json +++ b/tests/fixtures/parser/ast/unused-write-only-store-output.json @@ -626,17 +626,35 @@ { "type": "SvelteDirective", "kind": "EventHandler", - "name": { - "type": "Identifier", - "name": "click", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "Identifier", + "name": "click", + "range": [ + 204, + 209 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 13 + } + } + }, + "modifiers": [], "range": [ - 204, + 201, 209 ], "loc": { "start": { "line": 9, - "column": 8 + "column": 5 }, "end": { "line": 9, @@ -644,7 +662,6 @@ } } }, - "modifiers": [], "expression": { "type": "ArrowFunctionExpression", "async": false, diff --git a/tests/src/parser/test-utils.ts b/tests/src/parser/test-utils.ts index 47385307..d76b7564 100644 --- a/tests/src/parser/test-utils.ts +++ b/tests/src/parser/test-utils.ts @@ -179,7 +179,8 @@ const nodeToKeys: SvelteKeysType = { SvelteAwaitPendingBlock: ["children"], SvelteAwaitThenBlock: ["value", "children"], SvelteDebugTag: ["identifiers"], - SvelteDirective: ["name", "modifiers", "intro", "outro", "expression"], + SvelteDirective: ["key", "intro", "outro", "expression"], + SvelteDirectiveKey: ["name", "modifiers"], SvelteEachBlock: [ "expression", "context", @@ -200,7 +201,8 @@ const nodeToKeys: SvelteKeysType = { SvelteReactiveStatement: ["label", "body"], SvelteScriptElement: ["name", "startTag", "body", "endTag"], SvelteShorthandAttribute: ["key", "value"], - SvelteSpecialDirective: ["kind", "expression"], + SvelteSpecialDirective: ["kind", "key", "expression"], + SvelteSpecialDirectiveKey: [], SvelteSpreadAttribute: ["argument"], SvelteStartTag: ["attributes", "selfClosing"], SvelteStyleElement: ["name", "startTag", "children", "endTag"],