From 696b55fbdbe35065f866f3aa83c8aa3de18d05eb Mon Sep 17 00:00:00 2001 From: baseballyama Date: Thu, 15 May 2025 08:29:57 +0900 Subject: [PATCH 1/4] feat: support attach tag --- package.json | 2 +- src/ast/html.ts | 8 + src/parser/converts/attr.ts | 25 + src/parser/svelte-ast-types-for-v5.ts | 1 + src/parser/svelte-ast-types.ts | 7 + .../ast/svelte5/attach-ts-01-input.svelte | 14 + .../ast/svelte5/attach-ts-01-output.json | 2226 +++++++++ .../svelte5/attach-ts-01-scope-output.json | 2081 +++++++++ .../ast/svelte5/attach-ts-02-input.svelte | 19 + .../ast/svelte5/attach-ts-02-output.json | 3190 +++++++++++++ .../svelte5/attach-ts-02-scope-output.json | 3308 ++++++++++++++ .../ast/svelte5/attach-ts-03-input.svelte | 22 + .../ast/svelte5/attach-ts-03-output.json | 3309 ++++++++++++++ .../svelte5/attach-ts-03-scope-output.json | 3985 +++++++++++++++++ .../parser/ast/svelte5/attach01-input.svelte | 12 + .../parser/ast/svelte5/attach01-output.json | 1680 +++++++ .../ast/svelte5/attach01-scope-output.json | 1356 ++++++ .../parser/ast/svelte5/attach02-input.svelte | 22 + .../parser/ast/svelte5/attach02-output.json | 2666 +++++++++++ .../ast/svelte5/attach02-scope-output.json | 2743 ++++++++++++ .../parser/ast/svelte5/attach03-input.svelte | 22 + .../parser/ast/svelte5/attach03-output.json | 3160 +++++++++++++ .../ast/svelte5/attach03-scope-output.json | 3984 ++++++++++++++++ 23 files changed, 33841 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-01-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-01-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-02-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-02-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-03-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach-ts-03-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach01-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach01-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach01-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach02-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach02-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach02-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach03-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach03-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach03-scope-output.json diff --git a/package.json b/package.json index 598cf544..9c888a05 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "prettier-plugin-svelte": "^3.3.3", "rimraf": "^6.0.1", "semver": "^7.7.1", - "svelte": "^5.25.3", + "svelte": "^5.30.1", "svelte2tsx": "^0.7.35", "tsx": "^4.19.3", "typescript": "~5.8.2", diff --git a/src/ast/html.ts b/src/ast/html.ts index cd1756f4..c70d158c 100644 --- a/src/ast/html.ts +++ b/src/ast/html.ts @@ -31,6 +31,7 @@ export type SvelteHTMLNode = | SvelteAttribute | SvelteShorthandAttribute | SvelteSpreadAttribute + | SvelteAttachTag | SvelteDirective | SvelteStyleDirective | SvelteSpecialDirective @@ -142,6 +143,7 @@ export interface SvelteStartTag extends BaseNode { | SvelteAttribute | SvelteShorthandAttribute | SvelteSpreadAttribute + | SvelteAttachTag | SvelteDirective | SvelteStyleDirective | SvelteSpecialDirective @@ -541,6 +543,12 @@ export interface SvelteSpreadAttribute extends BaseNode { parent: SvelteStartTag; } +export interface SvelteAttachTag extends BaseNode { + type: "SvelteAttachTag"; + expression: ESTree.Expression; + parent: SvelteStartTag; +} + /** Node of directive. e.g. `` */ export type SvelteDirective = | SvelteActionDirective diff --git a/src/parser/converts/attr.ts b/src/parser/converts/attr.ts index db0d0b9b..7573c557 100644 --- a/src/parser/converts/attr.ts +++ b/src/parser/converts/attr.ts @@ -3,6 +3,7 @@ import type { SvelteAnimationDirective, SvelteAttribute, SvelteShorthandAttribute, + SvelteAttachTag, SvelteBindingDirective, SvelteClassDirective, SvelteDirective, @@ -56,6 +57,7 @@ export function* convertAttributes( | SvelteAttribute | SvelteShorthandAttribute | SvelteSpreadAttribute + | SvelteAttachTag | SvelteDirective | SvelteStyleDirective > { @@ -68,6 +70,10 @@ export function* convertAttributes( yield convertSpreadAttribute(attr, parent, ctx); continue; } + if (attr.type === "AttachTag") { + yield convertAttachTag(attr, parent, ctx); + continue; + } if (attr.type === "BindDirective" || attr.type === "Binding") { yield convertBindingDirective(attr, parent, ctx); continue; @@ -344,6 +350,25 @@ function convertSpreadAttribute( return attribute; } +function convertAttachTag( + node: SvAST.AttachTag | Compiler.AttachTag, + parent: SvelteAttachTag["parent"], + ctx: Context, +): SvelteAttachTag { + const attachTag: SvelteAttachTag = { + type: "SvelteAttachTag", + expression: node.expression, + parent, + ...ctx.getConvertLocation(node), + }; + + ctx.scriptLet.addExpression(node.expression, attachTag, null, (es) => { + attachTag.expression = es; + }); + + return attachTag; +} + /** Convert for Binding Directive */ function convertBindingDirective( node: SvAST.DirectiveForExpression | Compiler.BindDirective, diff --git a/src/parser/svelte-ast-types-for-v5.ts b/src/parser/svelte-ast-types-for-v5.ts index 9c8fd9d9..52614128 100644 --- a/src/parser/svelte-ast-types-for-v5.ts +++ b/src/parser/svelte-ast-types-for-v5.ts @@ -37,6 +37,7 @@ export type SnippetBlock = AST.SnippetBlock; export type Comment = AST.Comment; export type Attribute = AST.Attribute; export type SpreadAttribute = AST.SpreadAttribute; +export type AttachTag = AST.AttachTag; export type AnimateDirective = AST.AnimateDirective; export type BindDirective = AST.BindDirective; export type ClassDirective = AST.ClassDirective; diff --git a/src/parser/svelte-ast-types.ts b/src/parser/svelte-ast-types.ts index 6cd31660..2ebd0da1 100644 --- a/src/parser/svelte-ast-types.ts +++ b/src/parser/svelte-ast-types.ts @@ -203,9 +203,16 @@ export interface AttributeShorthand extends BaseNode { type: "AttributeShorthand"; expression: ESTree.Identifier; } + +export interface AttachTag extends BaseNode { + type: "AttachTag"; + expression: ESTree.Expression; +} + export type AttributeOrDirective = | Attribute | Spread + | AttachTag | Directive | StyleDirective; diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-01-input.svelte b/tests/fixtures/parser/ast/svelte5/attach-ts-01-input.svelte new file mode 100644 index 00000000..e1bc8a5b --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-01-input.svelte @@ -0,0 +1,14 @@ + + +
...
\ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json new file mode 100644 index 00000000..8283b5d3 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json @@ -0,0 +1,2226 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "importKind": "type", + "source": { + "type": "Literal", + "raw": "'svelte/attachments'", + "value": "svelte/attachments", + "range": [ + 52, + 72 + ], + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 53 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "local": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + ], + "range": [ + 20, + 73 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "init": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "element", + "range": [ + 139, + 146 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "nodeName", + "range": [ + 147, + 155 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + "range": [ + 139, + 155 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 135, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + "range": [ + 127, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + "optional": false, + "range": [ + 127, + 156 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "range": [ + 127, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 32 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'cleaning up'", + "value": "cleaning up", + "range": [ + 200, + 213 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 28 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 196, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + "range": [ + 188, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + "optional": false, + "range": [ + 188, + 214 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 29 + } + } + }, + "range": [ + 188, + 215 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 30 + } + } + } + ], + "range": [ + 183, + 219 + ], + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 177, + 219 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + "range": [ + 170, + 220 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 4 + } + } + } + ], + "range": [ + 123, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 47 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + } + ], + "range": [ + 110, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 34 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + "range": [ + 83, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 11, + "column": 2 + } + } + } + ], + "range": [ + 77, + 224 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 11, + "column": 3 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 225, + 234 + ], + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 9 + } + } + }, + "range": [ + 0, + 234 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 12, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 234, + 236 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 14, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "div", + "range": [ + 237, + 240 + ], + "loc": { + "start": { + "line": 14, + "column": 1 + }, + "end": { + "line": 14, + "column": 4 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", + "expression": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 250, + 262 + ], + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + "range": [ + 241, + 263 + ], + "loc": { + "start": { + "line": 14, + "column": 5 + }, + "end": { + "line": 14, + "column": 27 + } + } + } + ], + "selfClosing": false, + "range": [ + 236, + 264 + ], + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 28 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "...", + "range": [ + 264, + 267 + ], + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 31 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 267, + 273 + ], + "loc": { + "start": { + "line": 14, + "column": 31 + }, + "end": { + "line": 14, + "column": 37 + } + } + }, + "range": [ + 236, + 273 + ], + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 37 + } + } + } + ], + "sourceType": "module", + "comments": [ + { + "type": "Line", + "value": " 'DIV'", + "range": [ + 158, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 33 + }, + "end": { + "line": 6, + "column": 41 + } + } + } + ], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 20, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "type", + "range": [ + 27, + 31 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 32, + 33 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 45, + 46 + ], + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 27 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 47, + 51 + ], + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 32 + } + } + }, + { + "type": "String", + "value": "'svelte/attachments'", + "range": [ + 52, + 72 + ], + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 72, + 73 + ], + "loc": { + "start": { + "line": 2, + "column": 53 + }, + "end": { + "line": 2, + "column": 54 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 77, + 82 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "myAttachment", + "range": [ + 83, + 95 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 19 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 95, + 96 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 20 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 5, + "column": 32 + }, + "end": { + "line": 5, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 110, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 34 + }, + "end": { + "line": 5, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 118, + 119 + ], + "loc": { + "start": { + "line": 5, + "column": 42 + }, + "end": { + "line": 5, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 120, + 122 + ], + "loc": { + "start": { + "line": 5, + "column": 44 + }, + "end": { + "line": 5, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 123, + 124 + ], + "loc": { + "start": { + "line": 5, + "column": 47 + }, + "end": { + "line": 5, + "column": 48 + } + } + }, + { + "type": "Identifier", + "value": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 134, + 135 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "log", + "range": [ + 135, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 138, + 139 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 139, + 146 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 146, + 147 + ], + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + } + }, + { + "type": "Identifier", + "value": "nodeName", + "range": [ + 147, + 155 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 155, + 156 + ], + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 156, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 170, + 176 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 177, + 178 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 178, + 179 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 180, + 182 + ], + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 183, + 184 + ], + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 16 + } + } + }, + { + "type": "Identifier", + "value": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 195, + 196 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "log", + "range": [ + 196, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 199, + 200 + ], + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + { + "type": "String", + "value": "'cleaning up'", + "range": [ + 200, + 213 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 28 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 213, + 214 + ], + "loc": { + "start": { + "line": 9, + "column": 28 + }, + "end": { + "line": 9, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 214, + 215 + ], + "loc": { + "start": { + "line": 9, + "column": 29 + }, + "end": { + "line": 9, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 218, + 219 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 219, + 220 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 222, + 223 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 223, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 225, + 226 + ], + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 226, + 227 + ], + "loc": { + "start": { + "line": 12, + "column": 1 + }, + "end": { + "line": 12, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 227, + 233 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 233, + 234 + ], + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 234, + 236 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 14, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 236, + 237 + ], + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 237, + 240 + ], + "loc": { + "start": { + "line": 14, + "column": 1 + }, + "end": { + "line": 14, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 241, + 242 + ], + "loc": { + "start": { + "line": 14, + "column": 5 + }, + "end": { + "line": 14, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 242, + 243 + ], + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 243, + 244 + ], + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 244, + 245 + ], + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 14, + "column": 9 + }, + "end": { + "line": 14, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 246, + 247 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 247, + 248 + ], + "loc": { + "start": { + "line": 14, + "column": 11 + }, + "end": { + "line": 14, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 248, + 249 + ], + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "myAttachment", + "range": [ + 250, + 262 + ], + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 262, + 263 + ], + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 263, + 264 + ], + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + } + }, + { + "type": "HTMLText", + "value": "...", + "range": [ + 264, + 267 + ], + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 267, + 268 + ], + "loc": { + "start": { + "line": 14, + "column": 31 + }, + "end": { + "line": 14, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 268, + 269 + ], + "loc": { + "start": { + "line": 14, + "column": 32 + }, + "end": { + "line": 14, + "column": 33 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 269, + 272 + ], + "loc": { + "start": { + "line": 14, + "column": 33 + }, + "end": { + "line": 14, + "column": 36 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 272, + 273 + ], + "loc": { + "start": { + "line": 14, + "column": 36 + }, + "end": { + "line": 14, + "column": 37 + } + } + } + ], + "range": [ + 0, + 273 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 14, + "column": 37 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-01-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-01-scope-output.json new file mode 100644 index 00000000..ffc206e4 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-01-scope-output.json @@ -0,0 +1,2081 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "Attachment", + "identifiers": [ + { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "node": { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "local": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + } + ] + }, + { + "name": "myAttachment", + "identifiers": [ + { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "init": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "element", + "range": [ + 139, + 146 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "nodeName", + "range": [ + 147, + 155 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + "range": [ + 139, + 155 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 135, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + "range": [ + 127, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + "optional": false, + "range": [ + 127, + 156 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "range": [ + 127, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 32 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'cleaning up'", + "value": "cleaning up", + "range": [ + 200, + 213 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 28 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 196, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + "range": [ + 188, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + "optional": false, + "range": [ + 188, + 214 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 29 + } + } + }, + "range": [ + 188, + 215 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 30 + } + } + } + ], + "range": [ + 183, + 219 + ], + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 177, + 219 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + "range": [ + 170, + 220 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 4 + } + } + } + ], + "range": [ + 123, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 47 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + } + ], + "range": [ + 110, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 34 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + "range": [ + 83, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 11, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 250, + 262 + ], + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 34, + 44 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 250, + 262 + ], + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "myAttachment", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 97, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 95, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 83, + 107 + ], + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "element", + "range": [ + 139, + 146 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "nodeName", + "range": [ + 147, + 155 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + "range": [ + 139, + 155 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 135, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + "range": [ + 127, + 138 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 13 + } + } + }, + "optional": false, + "range": [ + 127, + 156 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "range": [ + 127, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 32 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'cleaning up'", + "value": "cleaning up", + "range": [ + 200, + 213 + ], + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 28 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 196, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + "range": [ + 188, + 199 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 14 + } + } + }, + "optional": false, + "range": [ + 188, + 214 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 29 + } + } + }, + "range": [ + 188, + 215 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 30 + } + } + } + ], + "range": [ + 183, + 219 + ], + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 177, + 219 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 10, + "column": 3 + } + } + }, + "range": [ + 170, + 220 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 4 + } + } + } + ], + "range": [ + 123, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 47 + }, + "end": { + "line": 11, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + } + ], + "range": [ + 110, + 223 + ], + "loc": { + "start": { + "line": 5, + "column": 34 + }, + "end": { + "line": 11, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 139, + 146 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 139, + 146 + ], + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 42 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 127, + 134 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 188, + 195 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-02-input.svelte b/tests/fixtures/parser/ast/svelte5/attach-ts-02-input.svelte new file mode 100644 index 00000000..e99390da --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-02-input.svelte @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json new file mode 100644 index 00000000..345d16a2 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json @@ -0,0 +1,3190 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "importKind": "value", + "source": { + "type": "Literal", + "raw": "'tippy.js'", + "value": "tippy.js", + "range": [ + 38, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "range": [ + 20, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "ImportDeclaration", + "importKind": "type", + "source": { + "type": "Literal", + "raw": "'svelte/attachments'", + "value": "svelte/attachments", + "range": [ + 83, + 103 + ], + "loc": { + "start": { + "line": 3, + "column": 33 + }, + "end": { + "line": 3, + "column": 53 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "local": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + ], + "range": [ + 51, + 104 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 54 + } + } + }, + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 128, + 136 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 121, + 127 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 121, + 137 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 111, + 137 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + ], + "range": [ + 107, + 138 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 32 + } + } + }, + { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + } + ], + "range": [ + 247, + 258 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 232, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 46 + } + } + }, + "range": [ + 222, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 46 + } + } + } + ], + "range": [ + 216, + 260 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 271, + 278 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 271, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 264, + 287 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 26 + } + } + } + ], + "range": [ + 211, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 198, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + "range": [ + 191, + 292 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 11, + "column": 4 + } + } + } + ], + "range": [ + 187, + 295 + ], + "loc": { + "start": { + "line": 7, + "column": 47 + }, + "end": { + "line": 12, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 174, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 141, + 295 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 12, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 296, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "range": [ + 0, + 305 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 305, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 15, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 308, + 313 + ], + "loc": { + "start": { + "line": 15, + "column": 1 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteDirective", + "kind": "Binding", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "value", + "range": [ + 319, + 324 + ], + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 17 + } + } + }, + "modifiers": [], + "range": [ + 314, + 324 + ], + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 17 + } + } + }, + "expression": { + "type": "Identifier", + "name": "content", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 15, + "column": 19 + }, + "end": { + "line": 15, + "column": 26 + } + } + }, + "shorthand": false, + "range": [ + 314, + 334 + ], + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 27 + } + } + } + ], + "selfClosing": true, + "range": [ + 307, + 337 + ], + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 30 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 307, + 337 + ], + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 30 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 337, + 339 + ], + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 17, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "button", + "range": [ + 340, + 346 + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 32 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 356, + 363 + ], + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 356, + 372 + ], + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 33 + } + } + }, + "range": [ + 347, + 373 + ], + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 34 + } + } + } + ], + "selfClosing": false, + "range": [ + 339, + 374 + ], + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 35 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n\tHover me\n", + "range": [ + 374, + 385 + ], + "loc": { + "start": { + "line": 17, + "column": 35 + }, + "end": { + "line": 19, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 385, + 394 + ], + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 9 + } + } + }, + "range": [ + 339, + 394 + ], + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 19, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 20, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 33, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "String", + "value": "'tippy.js'", + "range": [ + 38, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 48, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 51, + 57 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "type", + "range": [ + 58, + 62 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 63, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 76, + 77 + ], + "loc": { + "start": { + "line": 3, + "column": 26 + }, + "end": { + "line": 3, + "column": 27 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 78, + 82 + ], + "loc": { + "start": { + "line": 3, + "column": 28 + }, + "end": { + "line": 3, + "column": 32 + } + } + }, + { + "type": "String", + "value": "'svelte/attachments'", + "range": [ + 83, + 103 + ], + "loc": { + "start": { + "line": 3, + "column": 33 + }, + "end": { + "line": 3, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 103, + 104 + ], + "loc": { + "start": { + "line": 3, + "column": 53 + }, + "end": { + "line": 3, + "column": 54 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 107, + 110 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 119, + 120 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "$state", + "range": [ + 121, + 127 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 127, + 128 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'Hello!'", + "range": [ + 128, + 136 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 136, + 137 + ], + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 137, + 138 + ], + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 141, + 149 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 157, + 158 + ], + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 158, + 165 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 165, + 166 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 26 + } + } + }, + { + "type": "Identifier", + "value": "string", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 173, + 174 + ], + "loc": { + "start": { + "line": 7, + "column": 33 + }, + "end": { + "line": 7, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 174, + 175 + ], + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 187, + 188 + ], + "loc": { + "start": { + "line": 7, + "column": 47 + }, + "end": { + "line": 7, + "column": 48 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 191, + 197 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 198, + 199 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 206, + 207 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 208, + 210 + ], + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 211, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 216, + 221 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 237, + 238 + ], + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 9, + "column": 32 + }, + "end": { + "line": 9, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 247, + 248 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 257, + 258 + ], + "loc": { + "start": { + "line": 9, + "column": 44 + }, + "end": { + "line": 9, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 258, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 45 + }, + "end": { + "line": 9, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 259, + 260 + ], + "loc": { + "start": { + "line": 9, + "column": 46 + }, + "end": { + "line": 9, + "column": 47 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 264, + 270 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 271, + 278 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 278, + 279 + ], + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "destroy", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 286, + 287 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 290, + 291 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 291, + 292 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 294, + 295 + ], + "loc": { + "start": { + "line": 12, + "column": 1 + }, + "end": { + "line": 12, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 296, + 297 + ], + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 297, + 298 + ], + "loc": { + "start": { + "line": 13, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 298, + 304 + ], + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 304, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 305, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 15, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 307, + 308 + ], + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 308, + 313 + ], + "loc": { + "start": { + "line": 15, + "column": 1 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "bind", + "range": [ + 314, + 318 + ], + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 318, + 319 + ], + "loc": { + "start": { + "line": 15, + "column": 11 + }, + "end": { + "line": 15, + "column": 12 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "value", + "range": [ + 319, + 324 + ], + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 324, + 325 + ], + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 325, + 326 + ], + "loc": { + "start": { + "line": 15, + "column": 18 + }, + "end": { + "line": 15, + "column": 19 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 15, + "column": 19 + }, + "end": { + "line": 15, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 333, + 334 + ], + "loc": { + "start": { + "line": 15, + "column": 26 + }, + "end": { + "line": 15, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 335, + 336 + ], + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 336, + 337 + ], + "loc": { + "start": { + "line": 15, + "column": 29 + }, + "end": { + "line": 15, + "column": 30 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 337, + 339 + ], + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 17, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 339, + 340 + ], + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 340, + 346 + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 347, + 348 + ], + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 348, + 349 + ], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 349, + 350 + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 350, + 351 + ], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 351, + 352 + ], + "loc": { + "start": { + "line": 17, + "column": 12 + }, + "end": { + "line": 17, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 352, + 353 + ], + "loc": { + "start": { + "line": 17, + "column": 13 + }, + "end": { + "line": 17, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 353, + 354 + ], + "loc": { + "start": { + "line": 17, + "column": 14 + }, + "end": { + "line": 17, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 354, + 355 + ], + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 16 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 356, + 363 + ], + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 363, + 364 + ], + "loc": { + "start": { + "line": 17, + "column": 24 + }, + "end": { + "line": 17, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 371, + 372 + ], + "loc": { + "start": { + "line": 17, + "column": 32 + }, + "end": { + "line": 17, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 372, + 373 + ], + "loc": { + "start": { + "line": 17, + "column": 33 + }, + "end": { + "line": 17, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 373, + 374 + ], + "loc": { + "start": { + "line": 17, + "column": 34 + }, + "end": { + "line": 17, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "\n\t", + "range": [ + 374, + 376 + ], + "loc": { + "start": { + "line": 17, + "column": 35 + }, + "end": { + "line": 18, + "column": 1 + } + } + }, + { + "type": "HTMLText", + "value": "Hover", + "range": [ + 376, + 381 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 6 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 381, + 382 + ], + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + { + "type": "HTMLText", + "value": "me", + "range": [ + 382, + 384 + ], + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 384, + 385 + ], + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 19, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 385, + 386 + ], + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 386, + 387 + ], + "loc": { + "start": { + "line": 19, + "column": 1 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 387, + 393 + ], + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 19, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 393, + 394 + ], + "loc": { + "start": { + "line": 19, + "column": 8 + }, + "end": { + "line": 19, + "column": 9 + } + } + } + ], + "range": [ + 0, + 394 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 19, + "column": 9 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-02-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-02-scope-output.json new file mode 100644 index 00000000..e400cdfc --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-02-scope-output.json @@ -0,0 +1,3308 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 121, + 127 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "tippy", + "identifiers": [ + { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + }, + { + "name": "Attachment", + "identifiers": [ + { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "node": { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "local": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + } + ] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 128, + 136 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 121, + 127 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 121, + 137 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 111, + 137 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 15, + "column": 19 + }, + "end": { + "line": 15, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + } + ], + "range": [ + 247, + 258 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 232, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 46 + } + } + }, + "range": [ + 222, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 46 + } + } + } + ], + "range": [ + 216, + 260 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 271, + 278 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 271, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 264, + 287 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 26 + } + } + } + ], + "range": [ + 211, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 198, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + "range": [ + 191, + 292 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 11, + "column": 4 + } + } + } + ], + "range": [ + 187, + 295 + ], + "loc": { + "start": { + "line": 7, + "column": 47 + }, + "end": { + "line": 12, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 174, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 141, + 295 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 12, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 356, + 363 + ], + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 121, + 127 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 15, + "column": 19 + }, + "end": { + "line": 15, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 356, + 363 + ], + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 111, + 118 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + } + ], + "range": [ + 247, + 258 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 232, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 46 + } + } + }, + "range": [ + 222, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 46 + } + } + } + ], + "range": [ + 216, + 260 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 271, + 278 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 271, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 264, + 287 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 26 + } + } + } + ], + "range": [ + 211, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 198, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + "range": [ + 191, + 292 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 11, + "column": 4 + } + } + } + ], + "range": [ + 187, + 295 + ], + "loc": { + "start": { + "line": 7, + "column": 47 + }, + "end": { + "line": 12, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 174, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "range": [ + 141, + 295 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 12, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + } + ], + "range": [ + 247, + 258 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 232, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 46 + } + } + }, + "range": [ + 222, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 46 + } + } + } + ], + "range": [ + 216, + 260 + ], + "loc": { + "start": { + "line": 9, + "column": 3 + }, + "end": { + "line": 9, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 271, + 278 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 271, + 286 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "range": [ + 264, + 287 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 26 + } + } + } + ], + "range": [ + 211, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 11, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 198, + 291 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 11, + "column": 3 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + } + ], + "range": [ + 247, + 258 + ], + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 232, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 46 + } + } + }, + "range": [ + 222, + 259 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 46 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 271, + 278 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 199, + 206 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 271, + 278 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 222, + 229 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 249, + 256 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 167, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 165, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 33 + } + } + }, + "range": [ + 158, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 33 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 176, + 186 + ], + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 65, + 75 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 232, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 121, + 127 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-03-input.svelte b/tests/fixtures/parser/ast/svelte5/attach-ts-03-input.svelte new file mode 100644 index 00000000..392ba5ea --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-03-input.svelte @@ -0,0 +1,22 @@ + + + { + const context = canvas.getContext('2d'); + + $effect(() => { + let frame = requestAnimationFrame(function loop(t) { + frame = requestAnimationFrame(loop); + paint(context, t); + }); + + return () => { + cancelAnimationFrame(frame); + }; + }); + }} +> \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json new file mode 100644 index 00000000..2fb712c4 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json @@ -0,0 +1,3309 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "importKind": "value", + "source": { + "type": "Literal", + "raw": "'./gradient.js'", + "value": "./gradient.js", + "range": [ + 42, + 57 + ], + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 38 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "local": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + ], + "range": [ + 20, + 58 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 39 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 59, + 68 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 68 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 68, + 70 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "canvas", + "range": [ + 71, + 77 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "width", + "range": [ + 79, + 84 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 6 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "32", + "value": 32, + "range": [ + 86, + 88 + ], + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + } + }, + "range": [ + 85, + 89 + ], + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 11 + } + } + } + ], + "range": [ + 79, + 89 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "height", + "range": [ + 91, + 97 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 7 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "32", + "value": 32, + "range": [ + 99, + 101 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + "range": [ + 98, + 102 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 12 + } + } + } + ], + "range": [ + 91, + 102 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "SvelteAttachTag", + "expression": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'2d'", + "value": "2d", + "range": [ + 163, + 167 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "canvas", + "range": [ + 145, + 151 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "getContext", + "range": [ + 152, + 162 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "range": [ + 145, + 162 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "optional": false, + "range": [ + 145, + 168 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + "range": [ + 135, + 168 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + ], + "range": [ + 129, + 169 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 257, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 290, + 307 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 290, + 308 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 243, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 226, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 204, + 314 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + "range": [ + 196, + 314 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 15, + "column": 5 + } + } + } + ], + "range": [ + 192, + 315 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "frame", + "range": [ + 360, + 365 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 339, + 366 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 31 + } + } + }, + "range": [ + 339, + 367 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 32 + } + } + } + ], + "range": [ + 333, + 372 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 327, + 372 + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "range": [ + 320, + 373 + ], + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 19, + "column": 5 + } + } + } + ], + "range": [ + 187, + 377 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 20, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 181, + 377 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 20, + "column": 3 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$effect", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 173, + 378 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 4 + } + } + }, + "range": [ + 173, + 379 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 5 + } + } + } + ], + "range": [ + 125, + 382 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "canvas", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 113, + 382 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "range": [ + 104, + 383 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 21, + "column": 3 + } + } + } + ], + "selfClosing": false, + "range": [ + 70, + 385 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + } + }, + "children": [], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 385, + 394 + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 22, + "column": 10 + } + } + }, + "range": [ + 70, + 394 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 22, + "column": 10 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 20, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 27, + 28 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 35, + 36 + ], + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 37, + 41 + ], + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'./gradient.js'", + "range": [ + 42, + 57 + ], + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 38 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 57, + 58 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 59, + 60 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 60, + 61 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 61, + 67 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 67, + 68 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 68, + 70 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 70, + 71 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "canvas", + "range": [ + 71, + 77 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "width", + "range": [ + 79, + 84 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 84, + 85 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 85, + 86 + ], + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 8 + } + } + }, + { + "type": "Numeric", + "value": "32", + "range": [ + 86, + 88 + ], + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 88, + 89 + ], + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "height", + "range": [ + 91, + 97 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 97, + 98 + ], + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 7, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 98, + 99 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + } + }, + { + "type": "Numeric", + "value": "32", + "range": [ + 99, + 101 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 101, + 102 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 104, + 105 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 105, + 106 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 106, + 107 + ], + "loc": { + "start": { + "line": 8, + "column": 3 + }, + "end": { + "line": 8, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 107, + 108 + ], + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 109, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 110, + 111 + ], + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 111, + 112 + ], + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 113, + 114 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "canvas", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 120, + 121 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 122, + 124 + ], + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 125, + 126 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 129, + 134 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 143, + 144 + ], + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + { + "type": "Identifier", + "value": "canvas", + "range": [ + 145, + 151 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 151, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "getContext", + "range": [ + 152, + 162 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 162, + 163 + ], + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 36 + } + } + }, + { + "type": "String", + "value": "'2d'", + "range": [ + 163, + 167 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 167, + 168 + ], + "loc": { + "start": { + "line": 9, + "column": 40 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 168, + 169 + ], + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "Identifier", + "value": "$effect", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 180, + 181 + ], + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 181, + 182 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 182, + 183 + ], + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 184, + 186 + ], + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 187, + 188 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 192, + 195 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 202, + 203 + ], + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 225, + 226 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 37 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 226, + 234 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 12, + "column": 45 + } + } + }, + { + "type": "Identifier", + "value": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 239, + 240 + ], + "loc": { + "start": { + "line": 12, + "column": 50 + }, + "end": { + "line": 12, + "column": 51 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 241, + 242 + ], + "loc": { + "start": { + "line": 12, + "column": 52 + }, + "end": { + "line": 12, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 243, + 244 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 12, + "column": 55 + } + } + }, + { + "type": "Identifier", + "value": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 255, + 256 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 278, + 279 + ], + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 34 + } + } + }, + { + "type": "Identifier", + "value": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 283, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 38 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 284, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 39 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "Identifier", + "value": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 9 + }, + "end": { + "line": 14, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 303, + 304 + ], + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 306, + 307 + ], + "loc": { + "start": { + "line": 14, + "column": 20 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 307, + 308 + ], + "loc": { + "start": { + "line": 14, + "column": 21 + }, + "end": { + "line": 14, + "column": 22 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 312, + 313 + ], + "loc": { + "start": { + "line": 15, + "column": 3 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 313, + 314 + ], + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 314, + 315 + ], + "loc": { + "start": { + "line": 15, + "column": 5 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 320, + 326 + ], + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 327, + 328 + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 328, + 329 + ], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 330, + 332 + ], + "loc": { + "start": { + "line": 17, + "column": 13 + }, + "end": { + "line": 17, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 333, + 334 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + } + }, + { + "type": "Identifier", + "value": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 359, + 360 + ], + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "frame", + "range": [ + 360, + 365 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 365, + 366 + ], + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 366, + 367 + ], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 371, + 372 + ], + "loc": { + "start": { + "line": 19, + "column": 3 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 372, + 373 + ], + "loc": { + "start": { + "line": 19, + "column": 4 + }, + "end": { + "line": 19, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 376, + 377 + ], + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 377, + 378 + ], + "loc": { + "start": { + "line": 20, + "column": 3 + }, + "end": { + "line": 20, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 378, + 379 + ], + "loc": { + "start": { + "line": 20, + "column": 4 + }, + "end": { + "line": 20, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 381, + 382 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 382, + 383 + ], + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 384, + 385 + ], + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 385, + 386 + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 386, + 387 + ], + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "canvas", + "range": [ + 387, + 393 + ], + "loc": { + "start": { + "line": 22, + "column": 3 + }, + "end": { + "line": 22, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 393, + 394 + ], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 10 + } + } + } + ], + "range": [ + 0, + 394 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 22, + "column": 10 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-03-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-03-scope-output.json new file mode 100644 index 00000000..51a918f4 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-03-scope-output.json @@ -0,0 +1,3985 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "paint", + "identifiers": [ + { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "node": { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "local": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + ] + } + ], + "references": [], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "canvas", + "identifiers": [ + { + "type": "Identifier", + "name": "canvas", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "canvas", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'2d'", + "value": "2d", + "range": [ + 163, + 167 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "canvas", + "range": [ + 145, + 151 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "getContext", + "range": [ + 152, + 162 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "range": [ + 145, + 162 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "optional": false, + "range": [ + 145, + 168 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + "range": [ + 135, + 168 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + ], + "range": [ + 129, + 169 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 257, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 290, + 307 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 290, + 308 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 243, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 226, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 204, + 314 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + "range": [ + 196, + 314 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 15, + "column": 5 + } + } + } + ], + "range": [ + 192, + 315 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "frame", + "range": [ + 360, + 365 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 339, + 366 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 31 + } + } + }, + "range": [ + 339, + 367 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 32 + } + } + } + ], + "range": [ + 333, + 372 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 327, + 372 + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "range": [ + 320, + 373 + ], + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 19, + "column": 5 + } + } + } + ], + "range": [ + 187, + 377 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 20, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 181, + 377 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 20, + "column": 3 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$effect", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 173, + 378 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 4 + } + } + }, + "range": [ + 173, + 379 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 5 + } + } + } + ], + "range": [ + 125, + 382 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "canvas", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 113, + 382 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "canvas", + "range": [ + 145, + 151 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "canvas", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + } + ] + }, + { + "name": "context", + "identifiers": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'2d'", + "value": "2d", + "range": [ + 163, + 167 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "canvas", + "range": [ + 145, + 151 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "getContext", + "range": [ + 152, + 162 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "range": [ + 145, + 162 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "optional": false, + "range": [ + 145, + 168 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + "range": [ + 135, + 168 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "canvas", + "range": [ + 145, + 151 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "canvas", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "frame", + "identifiers": [ + { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 257, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 290, + 307 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 290, + 308 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 243, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 226, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 204, + 314 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + "range": [ + 196, + 314 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 15, + "column": 5 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 360, + 365 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ], + "childScopes": [ + { + "type": "function-expression-name", + "variables": [ + { + "name": "loop", + "identifiers": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "node": { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 257, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 290, + 307 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 290, + 308 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 243, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 226, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + } + ] + } + ], + "references": [], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "t", + "identifiers": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + }, + "node": { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 257, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 249, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 290, + 307 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 290, + 308 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 243, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 226, + 313 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "t", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "t", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "loop", + "range": [ + 279, + 283 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "loop", + "range": [ + 235, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 249, + 254 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + } + ] + }, + { + "type": "function", + "variables": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 360, + 365 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 360, + 365 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 196, + 201 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 135, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 290, + 295 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 29, + 34 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 173, + 180 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 204, + 225 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 257, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 339, + 359 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach01-input.svelte b/tests/fixtures/parser/ast/svelte5/attach01-input.svelte new file mode 100644 index 00000000..dbd10390 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach01-input.svelte @@ -0,0 +1,12 @@ + + +
...
\ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach01-output.json b/tests/fixtures/parser/ast/svelte5/attach01-output.json new file mode 100644 index 00000000..dffb41e6 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach01-output.json @@ -0,0 +1,1680 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "element", + "range": [ + 113, + 120 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "nodeName", + "range": [ + 121, + 129 + ], + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 30 + } + } + }, + "range": [ + 113, + 129 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 30 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 109, + 112 + ], + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "range": [ + 101, + 112 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "optional": false, + "range": [ + 101, + 130 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 31 + } + } + }, + "range": [ + 101, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'cleaning up'", + "value": "cleaning up", + "range": [ + 174, + 187 + ], + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 28 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 170, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + "range": [ + 162, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + "optional": false, + "range": [ + 162, + 188 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + "range": [ + 162, + 189 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 30 + } + } + } + ], + "range": [ + 157, + 193 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 151, + 193 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + "range": [ + 144, + 194 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 4 + } + } + } + ], + "range": [ + 97, + 197 + ], + "loc": { + "start": { + "line": 3, + "column": 32 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + } + ], + "range": [ + 66, + 197 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 9, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 198, + 207 + ], + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 9 + } + } + }, + "range": [ + 0, + 207 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 10, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 207, + 209 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 12, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "div", + "range": [ + 210, + 213 + ], + "loc": { + "start": { + "line": 12, + "column": 1 + }, + "end": { + "line": 12, + "column": 4 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", + "expression": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 223, + 235 + ], + "loc": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 26 + } + } + }, + "range": [ + 214, + 236 + ], + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 27 + } + } + } + ], + "selfClosing": false, + "range": [ + 209, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 28 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "...", + "range": [ + 237, + 240 + ], + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 31 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 240, + 246 + ], + "loc": { + "start": { + "line": 12, + "column": 31 + }, + "end": { + "line": 12, + "column": 37 + } + } + }, + "range": [ + 209, + 246 + ], + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 37 + } + } + } + ], + "sourceType": "module", + "comments": [ + { + "type": "Block", + "value": "* @type {import('svelte/attachments').Attachment} ", + "range": [ + 10, + 64 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 55 + } + } + }, + { + "type": "Line", + "value": " 'DIV'", + "range": [ + 132, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 41 + } + } + } + ], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 66, + 74 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 87, + 88 + ], + "loc": { + "start": { + "line": 3, + "column": 22 + }, + "end": { + "line": 3, + "column": 23 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 95, + 96 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 97, + 98 + ], + "loc": { + "start": { + "line": 3, + "column": 32 + }, + "end": { + "line": 3, + "column": 33 + } + } + }, + { + "type": "Identifier", + "value": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "log", + "range": [ + 109, + 112 + ], + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 112, + 113 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 113, + 120 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 120, + 121 + ], + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 22 + } + } + }, + { + "type": "Identifier", + "value": "nodeName", + "range": [ + 121, + 129 + ], + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 129, + 130 + ], + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 130, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 144, + 150 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 151, + 152 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 152, + 153 + ], + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 154, + 156 + ], + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 157, + 158 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 16 + } + } + }, + { + "type": "Identifier", + "value": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 169, + 170 + ], + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "log", + "range": [ + 170, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 173, + 174 + ], + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 15 + } + } + }, + { + "type": "String", + "value": "'cleaning up'", + "range": [ + 174, + 187 + ], + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 28 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 187, + 188 + ], + "loc": { + "start": { + "line": 7, + "column": 28 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 188, + 189 + ], + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 192, + 193 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 193, + 194 + ], + "loc": { + "start": { + "line": 8, + "column": 3 + }, + "end": { + "line": 8, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 196, + 197 + ], + "loc": { + "start": { + "line": 9, + "column": 1 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 198, + 199 + ], + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 199, + 200 + ], + "loc": { + "start": { + "line": 10, + "column": 1 + }, + "end": { + "line": 10, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 200, + 206 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 206, + 207 + ], + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 207, + 209 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 12, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 209, + 210 + ], + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 210, + 213 + ], + "loc": { + "start": { + "line": 12, + "column": 1 + }, + "end": { + "line": 12, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 214, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 215, + 216 + ], + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 216, + 217 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 217, + 218 + ], + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 218, + 219 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 219, + 220 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 220, + 221 + ], + "loc": { + "start": { + "line": 12, + "column": 11 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 221, + 222 + ], + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "myAttachment", + "range": [ + 223, + 235 + ], + "loc": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 235, + 236 + ], + "loc": { + "start": { + "line": 12, + "column": 26 + }, + "end": { + "line": 12, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 236, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 28 + } + } + }, + { + "type": "HTMLText", + "value": "...", + "range": [ + 237, + 240 + ], + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 240, + 241 + ], + "loc": { + "start": { + "line": 12, + "column": 31 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 241, + 242 + ], + "loc": { + "start": { + "line": 12, + "column": 32 + }, + "end": { + "line": 12, + "column": 33 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "div", + "range": [ + 242, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 33 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 37 + } + } + } + ], + "range": [ + 0, + 246 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 12, + "column": 37 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach01-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach01-scope-output.json new file mode 100644 index 00000000..e6423bc4 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach01-scope-output.json @@ -0,0 +1,1356 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "myAttachment", + "identifiers": [ + { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "element", + "range": [ + 113, + 120 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "nodeName", + "range": [ + 121, + 129 + ], + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 30 + } + } + }, + "range": [ + 113, + 129 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 30 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 109, + 112 + ], + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "range": [ + 101, + 112 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "optional": false, + "range": [ + 101, + 130 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 31 + } + } + }, + "range": [ + 101, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'cleaning up'", + "value": "cleaning up", + "range": [ + 174, + 187 + ], + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 28 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 170, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + "range": [ + 162, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + "optional": false, + "range": [ + 162, + 188 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + "range": [ + 162, + 189 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 30 + } + } + } + ], + "range": [ + 157, + 193 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 151, + 193 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + "range": [ + 144, + 194 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 4 + } + } + } + ], + "range": [ + 97, + 197 + ], + "loc": { + "start": { + "line": 3, + "column": 32 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + } + ], + "range": [ + 66, + 197 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 9, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 223, + 235 + ], + "loc": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 223, + 235 + ], + "loc": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "element", + "range": [ + 113, + 120 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "nodeName", + "range": [ + 121, + 129 + ], + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 30 + } + } + }, + "range": [ + 113, + 129 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 30 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 109, + 112 + ], + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "range": [ + 101, + 112 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "optional": false, + "range": [ + 101, + 130 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 31 + } + } + }, + "range": [ + 101, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'cleaning up'", + "value": "cleaning up", + "range": [ + 174, + 187 + ], + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 28 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "log", + "range": [ + 170, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + "range": [ + 162, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 14 + } + } + }, + "optional": false, + "range": [ + 162, + 188 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 29 + } + } + }, + "range": [ + 162, + 189 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 30 + } + } + } + ], + "range": [ + 157, + 193 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 151, + 193 + ], + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + "range": [ + 144, + 194 + ], + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 4 + } + } + } + ], + "range": [ + 97, + 197 + ], + "loc": { + "start": { + "line": 3, + "column": 32 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "myAttachment", + "range": [ + 75, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 22 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + } + ], + "range": [ + 66, + 197 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 9, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 113, + 120 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 113, + 120 + ], + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 88, + 95 + ], + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 30 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 101, + 108 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "console", + "range": [ + 162, + 169 + ], + "loc": { + "start": { + "line": 7, + "column": 3 + }, + "end": { + "line": 7, + "column": 10 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach02-input.svelte b/tests/fixtures/parser/ast/svelte5/attach02-input.svelte new file mode 100644 index 00000000..130adc7f --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach02-input.svelte @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach02-output.json b/tests/fixtures/parser/ast/svelte5/attach02-output.json new file mode 100644 index 00000000..a5892e20 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach02-output.json @@ -0,0 +1,2666 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "source": { + "type": "Literal", + "raw": "'tippy.js'", + "value": "tippy.js", + "range": [ + 28, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "range": [ + 10, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 63, + 71 + ], + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 56, + 62 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 56, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 31 + } + } + }, + "range": [ + 46, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 31 + } + } + } + ], + "range": [ + 42, + 73 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + } + ], + "range": [ + 255, + 266 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 240, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 46 + } + } + }, + "range": [ + 230, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 46 + } + } + } + ], + "range": [ + 224, + 268 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 287, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 279, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 272, + 295 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 26 + } + } + } + ], + "range": [ + 219, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + ], + "range": [ + 206, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + "range": [ + 199, + 300 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 14, + "column": 4 + } + } + } + ], + "range": [ + 195, + 303 + ], + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 15, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + } + ], + "range": [ + 169, + 303 + ], + "loc": { + "start": { + "line": 10, + "column": 1 + }, + "end": { + "line": 15, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 304, + 313 + ], + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 9 + } + } + }, + "range": [ + 0, + 313 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 16, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 313, + 315 + ], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 18, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 316, + 321 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 6 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteDirective", + "kind": "Binding", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "value", + "range": [ + 327, + 332 + ], + "loc": { + "start": { + "line": 18, + "column": 12 + }, + "end": { + "line": 18, + "column": 17 + } + } + }, + "modifiers": [], + "range": [ + 322, + 332 + ], + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 17 + } + } + }, + "expression": { + "type": "Identifier", + "name": "content", + "range": [ + 334, + 341 + ], + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 26 + } + } + }, + "shorthand": false, + "range": [ + 322, + 342 + ], + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 27 + } + } + } + ], + "selfClosing": true, + "range": [ + 315, + 345 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 315, + 345 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 345, + 347 + ], + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 20, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "button", + "range": [ + 348, + 354 + ], + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 20, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 372, + 379 + ], + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 32 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 364, + 380 + ], + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 33 + } + } + }, + "range": [ + 355, + 381 + ], + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 34 + } + } + } + ], + "selfClosing": false, + "range": [ + 347, + 382 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 35 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n\tHover me\n", + "range": [ + 382, + 393 + ], + "loc": { + "start": { + "line": 20, + "column": 35 + }, + "end": { + "line": 22, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 393, + 402 + ], + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 9 + } + } + }, + "range": [ + 347, + 402 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 22, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [ + { + "type": "Block", + "value": "*\n\t * @param {string} content\n\t * @returns {import('svelte/attachments').Attachment}\n\t ", + "range": [ + 76, + 167 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 9, + "column": 4 + } + } + } + ], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 10, + 16 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 23, + 27 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "String", + "value": "'tippy.js'", + "range": [ + 28, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 38, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 42, + 45 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 54, + 55 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "$state", + "range": [ + 56, + 62 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 62, + 63 + ], + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'Hello!'", + "range": [ + 63, + 71 + ], + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 71, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 72, + 73 + ], + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 169, + 177 + ], + "loc": { + "start": { + "line": 10, + "column": 1 + }, + "end": { + "line": 10, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 185, + 186 + ], + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 193, + 194 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 195, + 196 + ], + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 10, + "column": 28 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 199, + 205 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 206, + 207 + ], + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 214, + 215 + ], + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 216, + 218 + ], + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 219, + 220 + ], + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 23 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 224, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 238, + 239 + ], + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 253, + 254 + ], + "loc": { + "start": { + "line": 12, + "column": 32 + }, + "end": { + "line": 12, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 255, + 256 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 265, + 266 + ], + "loc": { + "start": { + "line": 12, + "column": 44 + }, + "end": { + "line": 12, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 266, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 45 + }, + "end": { + "line": 12, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 267, + 268 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 47 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 272, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 286, + 287 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "destroy", + "range": [ + 287, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 294, + 295 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 298, + 299 + ], + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 299, + 300 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 302, + 303 + ], + "loc": { + "start": { + "line": 15, + "column": 1 + }, + "end": { + "line": 15, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 304, + 305 + ], + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 306, + 312 + ], + "loc": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 16, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 312, + 313 + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 313, + 315 + ], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 18, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 315, + 316 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 316, + 321 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 6 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "bind", + "range": [ + 322, + 326 + ], + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 326, + 327 + ], + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 12 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "value", + "range": [ + 327, + 332 + ], + "loc": { + "start": { + "line": 18, + "column": 12 + }, + "end": { + "line": 18, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 332, + 333 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 333, + 334 + ], + "loc": { + "start": { + "line": 18, + "column": 18 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 334, + 341 + ], + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 341, + 342 + ], + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 343, + 344 + ], + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 344, + 345 + ], + "loc": { + "start": { + "line": 18, + "column": 29 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 345, + 347 + ], + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 20, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 347, + 348 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 348, + 354 + ], + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 20, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 355, + 356 + ], + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 356, + 357 + ], + "loc": { + "start": { + "line": 20, + "column": 9 + }, + "end": { + "line": 20, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 357, + 358 + ], + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 358, + 359 + ], + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 359, + 360 + ], + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 360, + 361 + ], + "loc": { + "start": { + "line": 20, + "column": 13 + }, + "end": { + "line": 20, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 361, + 362 + ], + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 362, + 363 + ], + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 16 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 371, + 372 + ], + "loc": { + "start": { + "line": 20, + "column": 24 + }, + "end": { + "line": 20, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 372, + 379 + ], + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 379, + 380 + ], + "loc": { + "start": { + "line": 20, + "column": 32 + }, + "end": { + "line": 20, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 380, + 381 + ], + "loc": { + "start": { + "line": 20, + "column": 33 + }, + "end": { + "line": 20, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 381, + 382 + ], + "loc": { + "start": { + "line": 20, + "column": 34 + }, + "end": { + "line": 20, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "\n\t", + "range": [ + 382, + 384 + ], + "loc": { + "start": { + "line": 20, + "column": 35 + }, + "end": { + "line": 21, + "column": 1 + } + } + }, + { + "type": "HTMLText", + "value": "Hover", + "range": [ + 384, + 389 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 6 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 389, + 390 + ], + "loc": { + "start": { + "line": 21, + "column": 6 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + { + "type": "HTMLText", + "value": "me", + "range": [ + 390, + 392 + ], + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 392, + 393 + ], + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 22, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 393, + 394 + ], + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 394, + 395 + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 395, + 401 + ], + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 401, + 402 + ], + "loc": { + "start": { + "line": 22, + "column": 8 + }, + "end": { + "line": 22, + "column": 9 + } + } + } + ], + "range": [ + 0, + 402 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 22, + "column": 9 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach02-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach02-scope-output.json new file mode 100644 index 00000000..ccd49d11 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach02-scope-output.json @@ -0,0 +1,2743 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 56, + 62 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "tippy", + "identifiers": [ + { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 63, + 71 + ], + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 56, + 62 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 56, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 31 + } + } + }, + "range": [ + 46, + 72 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 31 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 334, + 341 + ], + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 372, + 379 + ], + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + } + ], + "range": [ + 255, + 266 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 240, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 46 + } + } + }, + "range": [ + 230, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 46 + } + } + } + ], + "range": [ + 224, + 268 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 287, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 279, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 272, + 295 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 26 + } + } + } + ], + "range": [ + 219, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + ], + "range": [ + 206, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + "range": [ + 199, + 300 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 14, + "column": 4 + } + } + } + ], + "range": [ + 195, + 303 + ], + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 15, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + } + ], + "range": [ + 169, + 303 + ], + "loc": { + "start": { + "line": 10, + "column": 1 + }, + "end": { + "line": 15, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 56, + 62 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 334, + 341 + ], + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 364, + 371 + ], + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 372, + 379 + ], + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 46, + 53 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 12 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + } + ], + "range": [ + 255, + 266 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 240, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 46 + } + } + }, + "range": [ + 230, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 46 + } + } + } + ], + "range": [ + 224, + 268 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 287, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 279, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 272, + 295 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 26 + } + } + } + ], + "range": [ + 219, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + ], + "range": [ + 206, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + "range": [ + 199, + 300 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 14, + "column": 4 + } + } + } + ], + "range": [ + 195, + 303 + ], + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 15, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 178, + 185 + ], + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + } + ], + "range": [ + 169, + 303 + ], + "loc": { + "start": { + "line": 10, + "column": 1 + }, + "end": { + "line": 15, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + } + } + ] + } + ], + "references": [], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + } + ], + "range": [ + 255, + 266 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 240, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 46 + } + } + }, + "range": [ + 230, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 46 + } + } + } + ], + "range": [ + 224, + 268 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 287, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 279, + 294 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + "range": [ + 272, + 295 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 26 + } + } + } + ], + "range": [ + 219, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 14, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + ], + "range": [ + 206, + 299 + ], + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 14, + "column": 3 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + } + ], + "range": [ + 255, + 266 + ], + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 240, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 46 + } + } + }, + "range": [ + 230, + 267 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 46 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 207, + 214 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 279, + 286 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 230, + 237 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 16 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 257, + 264 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 186, + 193 + ], + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 240, + 245 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 56, + 62 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach03-input.svelte b/tests/fixtures/parser/ast/svelte5/attach03-input.svelte new file mode 100644 index 00000000..95409d2d --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach03-input.svelte @@ -0,0 +1,22 @@ + + + { + const context = canvas.getContext('2d'); + + $effect(() => { + let frame = requestAnimationFrame(function loop(t) { + frame = requestAnimationFrame(loop); + paint(context, t); + }); + + return () => { + cancelAnimationFrame(frame); + }; + }); + }} +> \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach03-output.json b/tests/fixtures/parser/ast/svelte5/attach03-output.json new file mode 100644 index 00000000..97ac8927 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach03-output.json @@ -0,0 +1,3160 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "source": { + "type": "Literal", + "raw": "'./gradient.js'", + "value": "./gradient.js", + "range": [ + 32, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 38 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "imported": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "local": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + ], + "range": [ + 10, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 39 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 49, + 58 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "range": [ + 0, + 58 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 58, + 60 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "canvas", + "range": [ + 61, + 67 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "width", + "range": [ + 69, + 74 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 6 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "32", + "value": 32, + "range": [ + 76, + 78 + ], + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + } + }, + "range": [ + 75, + 79 + ], + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 11 + } + } + } + ], + "range": [ + 69, + 79 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "height", + "range": [ + 81, + 87 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 7 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteMustacheTag", + "kind": "text", + "expression": { + "type": "Literal", + "raw": "32", + "value": 32, + "range": [ + 89, + 91 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + "range": [ + 88, + 92 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 12 + } + } + } + ], + "range": [ + 81, + 92 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "SvelteAttachTag", + "expression": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'2d'", + "value": "2d", + "range": [ + 153, + 157 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "canvas", + "range": [ + 135, + 141 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "getContext", + "range": [ + 142, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "range": [ + 135, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "optional": false, + "range": [ + 135, + 158 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + "range": [ + 125, + 158 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + ], + "range": [ + 119, + 159 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 247, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 275 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 280, + 297 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 280, + 298 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 233, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 216, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 194, + 304 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + "range": [ + 186, + 304 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 15, + "column": 5 + } + } + } + ], + "range": [ + 182, + 305 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "frame", + "range": [ + 350, + 355 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 329, + 356 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 31 + } + } + }, + "range": [ + 329, + 357 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 32 + } + } + } + ], + "range": [ + 323, + 362 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 317, + 362 + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "range": [ + 310, + 363 + ], + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 19, + "column": 5 + } + } + } + ], + "range": [ + 177, + 367 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 20, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 171, + 367 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 20, + "column": 3 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$effect", + "range": [ + 163, + 170 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 163, + 368 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 4 + } + } + }, + "range": [ + 163, + 369 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 5 + } + } + } + ], + "range": [ + 115, + 372 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "canvas", + "range": [ + 104, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 103, + 372 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "range": [ + 94, + 373 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 21, + "column": 3 + } + } + } + ], + "selfClosing": false, + "range": [ + 60, + 375 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + } + }, + "children": [], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 375, + 384 + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 22, + "column": 10 + } + } + }, + "range": [ + 60, + 384 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 22, + "column": 10 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 10, + 16 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 25, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 27, + 31 + ], + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'./gradient.js'", + "range": [ + 32, + 47 + ], + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 38 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 47, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 49, + 50 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 50, + 51 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 51, + 57 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 57, + 58 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 58, + 60 + ], + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 60, + 61 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "canvas", + "range": [ + 61, + 67 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "width", + "range": [ + 69, + 74 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 74, + 75 + ], + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 75, + 76 + ], + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 8 + } + } + }, + { + "type": "Numeric", + "value": "32", + "range": [ + 76, + 78 + ], + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 78, + 79 + ], + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 11 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "height", + "range": [ + 81, + 87 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 87, + 88 + ], + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 7, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 88, + 89 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + } + }, + { + "type": "Numeric", + "value": "32", + "range": [ + 89, + 91 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 91, + 92 + ], + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 94, + 95 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 95, + 96 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 96, + 97 + ], + "loc": { + "start": { + "line": 8, + "column": 3 + }, + "end": { + "line": 8, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 97, + 98 + ], + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 98, + 99 + ], + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 99, + 100 + ], + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 100, + 101 + ], + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 101, + 102 + ], + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 103, + 104 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "canvas", + "range": [ + 104, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 110, + 111 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 112, + 114 + ], + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 115, + 116 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 119, + 124 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 133, + 134 + ], + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + { + "type": "Identifier", + "value": "canvas", + "range": [ + 135, + 141 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 141, + 142 + ], + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "getContext", + "range": [ + 142, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 152, + 153 + ], + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 36 + } + } + }, + { + "type": "String", + "value": "'2d'", + "range": [ + 153, + 157 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 157, + 158 + ], + "loc": { + "start": { + "line": 9, + "column": 40 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 158, + 159 + ], + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "Identifier", + "value": "$effect", + "range": [ + 163, + 170 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 170, + 171 + ], + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 171, + 172 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 172, + 173 + ], + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 174, + 176 + ], + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 177, + 178 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 182, + 185 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 192, + 193 + ], + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 215, + 216 + ], + "loc": { + "start": { + "line": 12, + "column": 36 + }, + "end": { + "line": 12, + "column": 37 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 216, + 224 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 12, + "column": 45 + } + } + }, + { + "type": "Identifier", + "value": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 229, + 230 + ], + "loc": { + "start": { + "line": 12, + "column": 50 + }, + "end": { + "line": 12, + "column": 51 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 231, + 232 + ], + "loc": { + "start": { + "line": 12, + "column": 52 + }, + "end": { + "line": 12, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 233, + 234 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 12, + "column": 55 + } + } + }, + { + "type": "Identifier", + "value": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 13, + "column": 10 + }, + "end": { + "line": 13, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 268, + 269 + ], + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 34 + } + } + }, + { + "type": "Identifier", + "value": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 273, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 38 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 274, + 275 + ], + "loc": { + "start": { + "line": 13, + "column": 39 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "Identifier", + "value": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 285, + 286 + ], + "loc": { + "start": { + "line": 14, + "column": 9 + }, + "end": { + "line": 14, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 293, + 294 + ], + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 296, + 297 + ], + "loc": { + "start": { + "line": 14, + "column": 20 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 297, + 298 + ], + "loc": { + "start": { + "line": 14, + "column": 21 + }, + "end": { + "line": 14, + "column": 22 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 302, + 303 + ], + "loc": { + "start": { + "line": 15, + "column": 3 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 303, + 304 + ], + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 304, + 305 + ], + "loc": { + "start": { + "line": 15, + "column": 5 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 310, + 316 + ], + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 317, + 318 + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 318, + 319 + ], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 320, + 322 + ], + "loc": { + "start": { + "line": 17, + "column": 13 + }, + "end": { + "line": 17, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 323, + 324 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + } + }, + { + "type": "Identifier", + "value": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 349, + 350 + ], + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "frame", + "range": [ + 350, + 355 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 355, + 356 + ], + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 356, + 357 + ], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 361, + 362 + ], + "loc": { + "start": { + "line": 19, + "column": 3 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 362, + 363 + ], + "loc": { + "start": { + "line": 19, + "column": 4 + }, + "end": { + "line": 19, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 366, + 367 + ], + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 367, + 368 + ], + "loc": { + "start": { + "line": 20, + "column": 3 + }, + "end": { + "line": 20, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 368, + 369 + ], + "loc": { + "start": { + "line": 20, + "column": 4 + }, + "end": { + "line": 20, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 371, + 372 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 372, + 373 + ], + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 374, + 375 + ], + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 375, + 376 + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 376, + 377 + ], + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 3 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "canvas", + "range": [ + 377, + 383 + ], + "loc": { + "start": { + "line": 22, + "column": 3 + }, + "end": { + "line": 22, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 383, + 384 + ], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 10 + } + } + } + ], + "range": [ + 0, + 384 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 22, + "column": 10 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach03-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach03-scope-output.json new file mode 100644 index 00000000..c8e33f77 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach03-scope-output.json @@ -0,0 +1,3984 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 163, + 170 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "paint", + "identifiers": [ + { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "node": { + "type": "ImportSpecifier", + "imported": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "local": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + ] + } + ], + "references": [], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "canvas", + "identifiers": [ + { + "type": "Identifier", + "name": "canvas", + "range": [ + 104, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "canvas", + "range": [ + 104, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'2d'", + "value": "2d", + "range": [ + 153, + 157 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "canvas", + "range": [ + 135, + 141 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "getContext", + "range": [ + 142, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "range": [ + 135, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "optional": false, + "range": [ + 135, + 158 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + "range": [ + 125, + 158 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + ], + "range": [ + 119, + 159 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 42 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 247, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 275 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 280, + 297 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 280, + 298 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 233, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 216, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 194, + 304 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + "range": [ + 186, + 304 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 15, + "column": 5 + } + } + } + ], + "range": [ + 182, + 305 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 15, + "column": 6 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "frame", + "range": [ + 350, + 355 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 329, + 356 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 31 + } + } + }, + "range": [ + 329, + 357 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 32 + } + } + } + ], + "range": [ + 323, + 362 + ], + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 317, + 362 + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 19, + "column": 4 + } + } + }, + "range": [ + 310, + 363 + ], + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 19, + "column": 5 + } + } + } + ], + "range": [ + 177, + 367 + ], + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 20, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [], + "range": [ + 171, + 367 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 20, + "column": 3 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$effect", + "range": [ + 163, + 170 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 163, + 368 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 4 + } + } + }, + "range": [ + 163, + 369 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 5 + } + } + } + ], + "range": [ + 115, + 372 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "canvas", + "range": [ + 104, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "range": [ + 103, + 372 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "canvas", + "range": [ + 135, + 141 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "canvas", + "range": [ + 104, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + } + ] + }, + { + "name": "context", + "identifiers": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'2d'", + "value": "2d", + "range": [ + 153, + 157 + ], + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 40 + } + } + } + ], + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "canvas", + "range": [ + 135, + 141 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "getContext", + "range": [ + 142, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "range": [ + 135, + 152 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 35 + } + } + }, + "optional": false, + "range": [ + 135, + 158 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 41 + } + } + }, + "range": [ + 125, + 158 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 41 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "canvas", + "range": [ + 135, + 141 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "canvas", + "range": [ + 104, + 110 + ], + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 163, + 170 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "frame", + "identifiers": [ + { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 247, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 275 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 280, + 297 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 280, + 298 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 233, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 216, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 194, + 304 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 15, + "column": 5 + } + } + }, + "range": [ + 186, + 304 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 15, + "column": 5 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 350, + 355 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ], + "childScopes": [ + { + "type": "function-expression-name", + "variables": [ + { + "name": "loop", + "identifiers": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "node": { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 247, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 275 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 280, + 297 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 280, + 298 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 233, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 216, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + } + ] + } + ], + "references": [], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "t", + "identifiers": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + }, + "node": { + "type": "FunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "left": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "operator": "=", + "right": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "optional": false, + "range": [ + 247, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 274 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 39 + } + } + }, + "range": [ + 239, + 275 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 40 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "optional": false, + "range": [ + 280, + 297 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + } + }, + "range": [ + 280, + 298 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 22 + } + } + } + ], + "range": [ + 233, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 54 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + ], + "range": [ + 216, + 303 + ], + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "t", + "range": [ + 295, + 296 + ], + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "t", + "range": [ + 230, + 231 + ], + "loc": { + "start": { + "line": 12, + "column": 51 + }, + "end": { + "line": 12, + "column": 52 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "loop", + "range": [ + 269, + 273 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 38 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "loop", + "range": [ + 225, + 229 + ], + "loc": { + "start": { + "line": 12, + "column": 46 + }, + "end": { + "line": 12, + "column": 50 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 239, + 244 + ], + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 9 + } + } + }, + "from": "function", + "init": false, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + } + ] + }, + { + "type": "function", + "variables": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 350, + 355 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "frame", + "range": [ + 350, + 355 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "frame", + "range": [ + 186, + 191 + ], + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 12 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "context", + "range": [ + 286, + 293 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "context", + "range": [ + 125, + 132 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 163, + 170 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "paint", + "range": [ + 280, + 285 + ], + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "paint", + "range": [ + 19, + 24 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$effect", + "range": [ + 163, + 170 + ], + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 194, + 215 + ], + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 36 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "requestAnimationFrame", + "range": [ + 247, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + "from": "function", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "cancelAnimationFrame", + "range": [ + 329, + 349 + ], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": null + } + ] +} \ No newline at end of file From 2fb3b1ed04b51a2a5d3c9e3454a1bff1679eaa63 Mon Sep 17 00:00:00 2001 From: baseballyama Date: Thu, 15 May 2025 08:30:56 +0900 Subject: [PATCH 2/4] add changeset --- .changeset/public-sheep-speak.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/public-sheep-speak.md diff --git a/.changeset/public-sheep-speak.md b/.changeset/public-sheep-speak.md new file mode 100644 index 00000000..3310ef1a --- /dev/null +++ b/.changeset/public-sheep-speak.md @@ -0,0 +1,5 @@ +--- +"svelte-eslint-parser": minor +--- + +feat: support `{@attach ...}` From 3feedf0aaf01c1e4b14933fbcb0c3b722ed6c8e0 Mon Sep 17 00:00:00 2001 From: baseballyama Date: Thu, 15 May 2025 08:36:38 +0900 Subject: [PATCH 3/4] more --- src/parser/converts/attr.ts | 1 + src/parser/converts/element.ts | 9 +- src/parser/svelte-ast-types.ts | 1 - src/visitor-keys.ts | 1 + .../parser/ast/svelte5/attach04-input.svelte | 9 + .../parser/ast/svelte5/attach04-output.json | 1327 +++++++ .../svelte5/attach04-prefer-const-result.json | 14 + .../ast/svelte5/attach04-scope-output.json | 895 +++++ .../ast/svelte5/attach04-ts-input.svelte | 10 + .../ast/svelte5/attach04-ts-output.json | 1781 +++++++++ .../attach04-ts-prefer-const-result.json | 14 + .../ast/svelte5/attach04-ts-scope-output.json | 1183 ++++++ .../parser/ast/svelte5/attach05-input.svelte | 23 + .../parser/ast/svelte5/attach05-output.json | 2829 ++++++++++++++ .../ast/svelte5/attach05-scope-output.json | 2906 ++++++++++++++ .../ast/svelte5/attach05-ts-input.svelte | 20 + .../ast/svelte5/attach05-ts-output.json | 3354 ++++++++++++++++ .../ast/svelte5/attach05-ts-scope-output.json | 3471 +++++++++++++++++ 18 files changed, 17846 insertions(+), 2 deletions(-) create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-ts-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach05-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach05-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach05-scope-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte create mode 100644 tests/fixtures/parser/ast/svelte5/attach05-ts-output.json create mode 100644 tests/fixtures/parser/ast/svelte5/attach05-ts-scope-output.json diff --git a/src/parser/converts/attr.ts b/src/parser/converts/attr.ts index 7573c557..57a96e1f 100644 --- a/src/parser/converts/attr.ts +++ b/src/parser/converts/attr.ts @@ -49,6 +49,7 @@ export function* convertAttributes( | SvAST.AttributeOrDirective | Compiler.Attribute | Compiler.SpreadAttribute + | Compiler.AttachTag | Compiler.Directive )[], parent: SvelteStartTag, diff --git a/src/parser/converts/element.ts b/src/parser/converts/element.ts index bbabaac6..23ab6948 100644 --- a/src/parser/converts/element.ts +++ b/src/parser/converts/element.ts @@ -223,13 +223,19 @@ export function* convertChildren( function extractLetDirectives(fragment: { attributes: | SvAST.AttributeOrDirective[] - | (Compiler.Attribute | Compiler.SpreadAttribute | Compiler.Directive)[]; + | ( + | Compiler.Attribute + | Compiler.SpreadAttribute + | Compiler.AttachTag + | Compiler.Directive + )[]; }): { letDirectives: (SvAST.LetDirective | Compiler.LetDirective)[]; attributes: Exclude< | SvAST.AttributeOrDirective | Compiler.Attribute | Compiler.SpreadAttribute + | Compiler.AttachTag | Compiler.Directive, SvAST.LetDirective | Compiler.LetDirective >[]; @@ -239,6 +245,7 @@ function extractLetDirectives(fragment: { | SvAST.AttributeOrDirective | Compiler.Attribute | Compiler.SpreadAttribute + | Compiler.AttachTag | Compiler.Directive, SvAST.LetDirective | Compiler.LetDirective >[] = []; diff --git a/src/parser/svelte-ast-types.ts b/src/parser/svelte-ast-types.ts index 2ebd0da1..b34674b0 100644 --- a/src/parser/svelte-ast-types.ts +++ b/src/parser/svelte-ast-types.ts @@ -212,7 +212,6 @@ export interface AttachTag extends BaseNode { export type AttributeOrDirective = | Attribute | Spread - | AttachTag | Directive | StyleDirective; diff --git a/src/visitor-keys.ts b/src/visitor-keys.ts index f9a2e0e2..2dbebe40 100644 --- a/src/visitor-keys.ts +++ b/src/visitor-keys.ts @@ -42,6 +42,7 @@ const svelteKeys: SvelteKeysType = { SvelteAttribute: ["key", "value"], SvelteShorthandAttribute: ["key", "value"], SvelteSpreadAttribute: ["argument"], + SvelteAttachTag: ["expression"], SvelteDirective: ["key", "expression"], SvelteStyleDirective: ["key", "value"], SvelteSpecialDirective: ["key", "expression"], diff --git a/tests/fixtures/parser/ast/svelte5/attach04-input.svelte b/tests/fixtures/parser/ast/svelte5/attach04-input.svelte new file mode 100644 index 00000000..4ba28475 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-input.svelte @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-output.json b/tests/fixtures/parser/ast/svelte5/attach04-output.json new file mode 100644 index 00000000..cdc45cdf --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-output.json @@ -0,0 +1,1327 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + { + "type": "RestElement", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + ], + "range": [ + 77, + 99 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 27 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + "range": [ + 77, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 38 + } + } + } + ], + "range": [ + 73, + 111 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 39 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 112, + 121 + ], + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + "range": [ + 0, + 121 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 121, + 123 + ], + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 6, + "column": 0 + } + } + }, + { + "type": "SvelteHTMLComment", + "value": " `props` includes attachments ", + "range": [ + 123, + 160 + ], + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 37 + } + } + }, + { + "type": "SvelteText", + "value": "\n", + "range": [ + 160, + 161 + ], + "loc": { + "start": { + "line": 6, + "column": 37 + }, + "end": { + "line": 7, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "button", + "range": [ + 162, + 168 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteSpreadAttribute", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 173, + 178 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "range": [ + 169, + 179 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 18 + } + } + } + ], + "selfClosing": false, + "range": [ + 161, + 180 + ], + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 19 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n\t", + "range": [ + 180, + 182 + ], + "loc": { + "start": { + "line": 7, + "column": 19 + }, + "end": { + "line": 8, + "column": 1 + } + } + }, + { + "type": "SvelteRenderTag", + "expression": { + "type": "ChainExpression", + "expression": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "children", + "range": [ + 191, + 199 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + "optional": true, + "range": [ + 191, + 203 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 22 + } + } + }, + "range": [ + 191, + 203 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 22 + } + } + }, + "range": [ + 182, + 204 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 23 + } + } + }, + { + "type": "SvelteText", + "value": "\n", + "range": [ + 204, + 205 + ], + "loc": { + "start": { + "line": 8, + "column": 23 + }, + "end": { + "line": 9, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 205, + 214 + ], + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 9 + } + } + }, + "range": [ + 161, + 214 + ], + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 9, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [ + { + "type": "Block", + "value": "* @type {import('svelte/elements').HTMLButtonAttributes} ", + "range": [ + 10, + 71 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 62 + } + } + } + ], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 73, + 76 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 77, + 78 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 87, + 88 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "...", + "range": [ + 89, + 92 + ], + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 20 + } + } + }, + { + "type": "Identifier", + "value": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 98, + 99 + ], + "loc": { + "start": { + "line": 3, + "column": 26 + }, + "end": { + "line": 3, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 100, + 101 + ], + "loc": { + "start": { + "line": 3, + "column": 28 + }, + "end": { + "line": 3, + "column": 29 + } + } + }, + { + "type": "Identifier", + "value": "$props", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 36 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 3, + "column": 36 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 109, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 110, + 111 + ], + "loc": { + "start": { + "line": 3, + "column": 38 + }, + "end": { + "line": 3, + "column": 39 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 112, + 113 + ], + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 113, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 114, + 120 + ], + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 120, + 121 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 121, + 123 + ], + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 6, + "column": 0 + } + } + }, + { + "type": "HTMLComment", + "value": "", + "range": [ + 123, + 160 + ], + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 37 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 160, + 161 + ], + "loc": { + "start": { + "line": 6, + "column": 37 + }, + "end": { + "line": 7, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 161, + 162 + ], + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 162, + 168 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 7, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 169, + 170 + ], + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "...", + "range": [ + 170, + 173 + ], + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "props", + "range": [ + 173, + 178 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 178, + 179 + ], + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 179, + 180 + ], + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 19 + } + } + }, + { + "type": "HTMLText", + "value": "\n\t", + "range": [ + 180, + 182 + ], + "loc": { + "start": { + "line": 7, + "column": 19 + }, + "end": { + "line": 8, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 182, + 183 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 2 + } + } + }, + { + "type": "MustacheKeyword", + "value": "@render", + "range": [ + 183, + 190 + ], + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "children", + "range": [ + 191, + 199 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "?.", + "range": [ + 199, + 201 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 20 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 201, + 202 + ], + "loc": { + "start": { + "line": 8, + "column": 20 + }, + "end": { + "line": 8, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 202, + 203 + ], + "loc": { + "start": { + "line": 8, + "column": 21 + }, + "end": { + "line": 8, + "column": 22 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 203, + 204 + ], + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 204, + 205 + ], + "loc": { + "start": { + "line": 8, + "column": 23 + }, + "end": { + "line": 9, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 205, + 206 + ], + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 206, + 207 + ], + "loc": { + "start": { + "line": 9, + "column": 1 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 207, + 213 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 213, + 214 + ], + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 9 + } + } + } + ], + "range": [ + 0, + 214 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 9 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json b/tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json new file mode 100644 index 00000000..1b179581 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json @@ -0,0 +1,14 @@ +[ + { + "ruleId": "prefer-const", + "code": "children", + "line": 3, + "column": 8 + }, + { + "ruleId": "prefer-const", + "code": "props", + "line": 3, + "column": 21 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach04-scope-output.json new file mode 100644 index 00000000..fbdf8845 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-scope-output.json @@ -0,0 +1,895 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 36 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "children", + "identifiers": [ + { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + { + "type": "RestElement", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + ], + "range": [ + 77, + 99 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 27 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + "range": [ + 77, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 38 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 191, + 199 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + } + } + ] + }, + { + "name": "props", + "identifiers": [ + { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + { + "type": "RestElement", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + ], + "range": [ + 77, + 99 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 27 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 36 + } + } + }, + "optional": false, + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + "range": [ + 77, + 110 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 38 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 173, + 178 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 36 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 173, + 178 + ], + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 92, + 97 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 191, + 199 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 79, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 15 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 102, + 108 + ], + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 36 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte b/tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte new file mode 100644 index 00000000..7c62a792 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-output.json b/tests/fixtures/parser/ast/svelte5/attach04-ts-output.json new file mode 100644 index 00000000..e2f42b34 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-ts-output.json @@ -0,0 +1,1781 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "importKind": "type", + "source": { + "type": "Literal", + "raw": "'svelte/elements'", + "value": "svelte/elements", + "range": [ + 62, + 79 + ], + "loc": { + "start": { + "line": 2, + "column": 43 + }, + "end": { + "line": 2, + "column": 60 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "local": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + } + ], + "range": [ + 20, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 61 + } + } + }, + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + { + "type": "RestElement", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "optional": false, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 109, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 87, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 134, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 58 + } + } + }, + "optional": false, + "range": [ + 134, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 60 + } + } + }, + "range": [ + 87, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 60 + } + } + } + ], + "range": [ + 83, + 143 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 61 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 144, + 153 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 9 + } + } + }, + "range": [ + 0, + 153 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 153, + 155 + ], + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 7, + "column": 0 + } + } + }, + { + "type": "SvelteHTMLComment", + "value": " `props` includes attachments ", + "range": [ + 155, + 192 + ], + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 37 + } + } + }, + { + "type": "SvelteText", + "value": "\n", + "range": [ + 192, + 193 + ], + "loc": { + "start": { + "line": 7, + "column": 37 + }, + "end": { + "line": 8, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "button", + "range": [ + 194, + 200 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteSpreadAttribute", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 205, + 210 + ], + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "range": [ + 201, + 211 + ], + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 18 + } + } + } + ], + "selfClosing": false, + "range": [ + 193, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 19 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n\t", + "range": [ + 212, + 214 + ], + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 9, + "column": 1 + } + } + }, + { + "type": "SvelteRenderTag", + "expression": { + "type": "ChainExpression", + "expression": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "children", + "range": [ + 223, + 231 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "optional": true, + "range": [ + 223, + 235 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 22 + } + } + }, + "range": [ + 223, + 235 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 22 + } + } + }, + "range": [ + 214, + 236 + ], + "loc": { + "start": { + "line": 9, + "column": 1 + }, + "end": { + "line": 9, + "column": 23 + } + } + }, + { + "type": "SvelteText", + "value": "\n", + "range": [ + 236, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 23 + }, + "end": { + "line": 10, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 237, + 246 + ], + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 9 + } + } + }, + "range": [ + 193, + 246 + ], + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 10, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 20, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "type", + "range": [ + 27, + 31 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 32, + 33 + ], + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 55, + 56 + ], + "loc": { + "start": { + "line": 2, + "column": 36 + }, + "end": { + "line": 2, + "column": 37 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 57, + 61 + ], + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 42 + } + } + }, + { + "type": "String", + "value": "'svelte/elements'", + "range": [ + 62, + 79 + ], + "loc": { + "start": { + "line": 2, + "column": 43 + }, + "end": { + "line": 2, + "column": 60 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 79, + 80 + ], + "loc": { + "start": { + "line": 2, + "column": 60 + }, + "end": { + "line": 2, + "column": 61 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 83, + 86 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 87, + 88 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + } + }, + { + "type": "Identifier", + "value": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 97, + 98 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "...", + "range": [ + 99, + 102 + ], + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 20 + } + } + }, + { + "type": "Identifier", + "value": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 108, + 109 + ], + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 109, + 110 + ], + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + } + }, + { + "type": "Identifier", + "value": "HTMLButtonAttributes", + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 132, + 133 + ], + "loc": { + "start": { + "line": 4, + "column": 50 + }, + "end": { + "line": 4, + "column": 51 + } + } + }, + { + "type": "Identifier", + "value": "$props", + "range": [ + 134, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 58 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 140, + 141 + ], + "loc": { + "start": { + "line": 4, + "column": 58 + }, + "end": { + "line": 4, + "column": 59 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 141, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 59 + }, + "end": { + "line": 4, + "column": 60 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 142, + 143 + ], + "loc": { + "start": { + "line": 4, + "column": 60 + }, + "end": { + "line": 4, + "column": 61 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 144, + 145 + ], + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 145, + 146 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 146, + 152 + ], + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 152, + 153 + ], + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 153, + 155 + ], + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 7, + "column": 0 + } + } + }, + { + "type": "HTMLComment", + "value": "", + "range": [ + 155, + 192 + ], + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 37 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 192, + 193 + ], + "loc": { + "start": { + "line": 7, + "column": 37 + }, + "end": { + "line": 8, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 193, + 194 + ], + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 194, + 200 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 201, + 202 + ], + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "...", + "range": [ + 202, + 205 + ], + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "props", + "range": [ + 205, + 210 + ], + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 210, + 211 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 211, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 19 + } + } + }, + { + "type": "HTMLText", + "value": "\n\t", + "range": [ + 212, + 214 + ], + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 9, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 214, + 215 + ], + "loc": { + "start": { + "line": 9, + "column": 1 + }, + "end": { + "line": 9, + "column": 2 + } + } + }, + { + "type": "MustacheKeyword", + "value": "@render", + "range": [ + 215, + 222 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "children", + "range": [ + 223, + 231 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "?.", + "range": [ + 231, + 233 + ], + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 20 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 233, + 234 + ], + "loc": { + "start": { + "line": 9, + "column": 20 + }, + "end": { + "line": 9, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 234, + 235 + ], + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 22 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 235, + 236 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 23 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 236, + 237 + ], + "loc": { + "start": { + "line": 9, + "column": 23 + }, + "end": { + "line": 10, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 237, + 238 + ], + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 238, + 239 + ], + "loc": { + "start": { + "line": 10, + "column": 1 + }, + "end": { + "line": 10, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "button", + "range": [ + 239, + 245 + ], + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 9 + } + } + } + ], + "range": [ + 0, + 246 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 10, + "column": 9 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json b/tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json new file mode 100644 index 00000000..402c7fc4 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json @@ -0,0 +1,14 @@ +[ + { + "ruleId": "prefer-const", + "code": "children", + "line": 4, + "column": 8 + }, + { + "ruleId": "prefer-const", + "code": "props", + "line": 4, + "column": 21 + } +] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json new file mode 100644 index 00000000..e2d18b10 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json @@ -0,0 +1,1183 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 134, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 58 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "HTMLButtonAttributes", + "identifiers": [ + { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "node": { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "local": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + } + } + ] + }, + { + "name": "children", + "identifiers": [ + { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + { + "type": "RestElement", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "optional": false, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 109, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 87, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 134, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 58 + } + } + }, + "optional": false, + "range": [ + 134, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 60 + } + } + }, + "range": [ + 87, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 60 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 223, + 231 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + } + } + ] + }, + { + "name": "props", + "identifiers": [ + { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "ObjectPattern", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + { + "type": "RestElement", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "optional": false, + "range": [ + 99, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 109, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "range": [ + 87, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [], + "callee": { + "type": "Identifier", + "name": "$props", + "range": [ + 134, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 58 + } + } + }, + "optional": false, + "range": [ + 134, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 60 + } + } + }, + "range": [ + 87, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 60 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 205, + 210 + ], + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 134, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 58 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 111, + 131 + ], + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 49 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "HTMLButtonAttributes", + "range": [ + 34, + 54 + ], + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "props", + "range": [ + 205, + 210 + ], + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "props", + "range": [ + 102, + 107 + ], + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "children", + "range": [ + 223, + 231 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "children", + "range": [ + 89, + 97 + ], + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$props", + "range": [ + 134, + 140 + ], + "loc": { + "start": { + "line": 4, + "column": 52 + }, + "end": { + "line": 4, + "column": 58 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-input.svelte b/tests/fixtures/parser/ast/svelte5/attach05-input.svelte new file mode 100644 index 00000000..b600aa6e --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach05-input.svelte @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-output.json b/tests/fixtures/parser/ast/svelte5/attach05-output.json new file mode 100644 index 00000000..3e4e49ba --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach05-output.json @@ -0,0 +1,2829 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [], + "selfClosing": false, + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "source": { + "type": "Literal", + "raw": "'tippy.js'", + "value": "tippy.js", + "range": [ + 28, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "range": [ + 10, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "ImportDeclaration", + "source": { + "type": "Literal", + "raw": "'./Button.svelte'", + "value": "./Button.svelte", + "range": [ + 60, + 77 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + ], + "range": [ + 41, + 78 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 95, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 85, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + ], + "range": [ + 81, + 112 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 32 + } + } + }, + { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } + } + } + ], + "range": [ + 258, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "range": [ + 245, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "range": [ + 238, + 339 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "range": [ + 234, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + ], + "range": [ + 208, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 16, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 343, + 352 + ], + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + "range": [ + 0, + 352 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 352, + 354 + ], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 19, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 355, + 360 + ], + "loc": { + "start": { + "line": 19, + "column": 1 + }, + "end": { + "line": 19, + "column": 6 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteDirective", + "kind": "Binding", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "value", + "range": [ + 366, + 371 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 17 + } + } + }, + "modifiers": [], + "range": [ + 361, + 371 + ], + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 17 + } + } + }, + "expression": { + "type": "Identifier", + "name": "content", + "range": [ + 373, + 380 + ], + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + "shorthand": false, + "range": [ + 361, + 381 + ], + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 27 + } + } + } + ], + "selfClosing": true, + "range": [ + 354, + 384 + ], + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 30 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 354, + 384 + ], + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 30 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 384, + 386 + ], + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 21, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Button", + "range": [ + 387, + 393 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 411, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 32 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 403, + 419 + ], + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 33 + } + } + }, + "range": [ + 394, + 420 + ], + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 34 + } + } + } + ], + "selfClosing": false, + "range": [ + 386, + 421 + ], + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 35 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n\tHover me\n", + "range": [ + 421, + 432 + ], + "loc": { + "start": { + "line": 21, + "column": 35 + }, + "end": { + "line": 23, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 432, + 441 + ], + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 9 + } + } + }, + "range": [ + 386, + 441 + ], + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 23, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [ + { + "type": "Block", + "value": "*\n\t * @param {string} content\n\t * @returns {import('svelte/attachments').Attachment}\n\t ", + "range": [ + 115, + 206 + ], + "loc": { + "start": { + "line": 7, + "column": 1 + }, + "end": { + "line": 10, + "column": 4 + } + } + } + ], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 10, + 16 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 23, + 27 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "String", + "value": "'tippy.js'", + "range": [ + 28, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 38, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 55, + 59 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 19 + } + } + }, + { + "type": "String", + "value": "'./Button.svelte'", + "range": [ + 60, + 77 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 77, + 78 + ], + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 81, + 84 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 93, + 94 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 101, + 102 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'Hello!'", + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 110, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 111, + 112 + ], + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 208, + 216 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 224, + 225 + ], + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 232, + 233 + ], + "loc": { + "start": { + "line": 11, + "column": 25 + }, + "end": { + "line": 11, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 234, + 235 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 11, + "column": 28 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 238, + 244 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 253, + 254 + ], + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 255, + 257 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 258, + 259 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 263, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 277, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 284, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 292, + 293 + ], + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 294, + 295 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 304, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 44 + }, + "end": { + "line": 13, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 45 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 306, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 46 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 311, + 317 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 325, + 326 + ], + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 333, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 337, + 338 + ], + "loc": { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 338, + 339 + ], + "loc": { + "start": { + "line": 15, + "column": 3 + }, + "end": { + "line": 15, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 341, + 342 + ], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 343, + 344 + ], + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 344, + 345 + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 345, + 351 + ], + "loc": { + "start": { + "line": 17, + "column": 2 + }, + "end": { + "line": 17, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 351, + 352 + ], + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 352, + 354 + ], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 19, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 354, + 355 + ], + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 355, + 360 + ], + "loc": { + "start": { + "line": 19, + "column": 1 + }, + "end": { + "line": 19, + "column": 6 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "bind", + "range": [ + 361, + 365 + ], + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 365, + 366 + ], + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 12 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "value", + "range": [ + 366, + 371 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 371, + 372 + ], + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 372, + 373 + ], + "loc": { + "start": { + "line": 19, + "column": 18 + }, + "end": { + "line": 19, + "column": 19 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 373, + 380 + ], + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 380, + 381 + ], + "loc": { + "start": { + "line": 19, + "column": 26 + }, + "end": { + "line": 19, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 382, + 383 + ], + "loc": { + "start": { + "line": 19, + "column": 28 + }, + "end": { + "line": 19, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 383, + 384 + ], + "loc": { + "start": { + "line": 19, + "column": 29 + }, + "end": { + "line": 19, + "column": 30 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 384, + 386 + ], + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 21, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 386, + 387 + ], + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 1 + } + } + }, + { + "type": "Identifier", + "value": "Button", + "range": [ + 387, + 393 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 394, + 395 + ], + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 395, + 396 + ], + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 396, + 397 + ], + "loc": { + "start": { + "line": 21, + "column": 10 + }, + "end": { + "line": 21, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 397, + 398 + ], + "loc": { + "start": { + "line": 21, + "column": 11 + }, + "end": { + "line": 21, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 398, + 399 + ], + "loc": { + "start": { + "line": 21, + "column": 12 + }, + "end": { + "line": 21, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 399, + 400 + ], + "loc": { + "start": { + "line": 21, + "column": 13 + }, + "end": { + "line": 21, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 400, + 401 + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 401, + 402 + ], + "loc": { + "start": { + "line": 21, + "column": 15 + }, + "end": { + "line": 21, + "column": 16 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 410, + 411 + ], + "loc": { + "start": { + "line": 21, + "column": 24 + }, + "end": { + "line": 21, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 411, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 418, + 419 + ], + "loc": { + "start": { + "line": 21, + "column": 32 + }, + "end": { + "line": 21, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 419, + 420 + ], + "loc": { + "start": { + "line": 21, + "column": 33 + }, + "end": { + "line": 21, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 420, + 421 + ], + "loc": { + "start": { + "line": 21, + "column": 34 + }, + "end": { + "line": 21, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "\n\t", + "range": [ + 421, + 423 + ], + "loc": { + "start": { + "line": 21, + "column": 35 + }, + "end": { + "line": 22, + "column": 1 + } + } + }, + { + "type": "HTMLText", + "value": "Hover", + "range": [ + 423, + 428 + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 22, + "column": 6 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 428, + 429 + ], + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + } + }, + { + "type": "HTMLText", + "value": "me", + "range": [ + 429, + 431 + ], + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 431, + 432 + ], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 23, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 432, + 433 + ], + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 433, + 434 + ], + "loc": { + "start": { + "line": 23, + "column": 1 + }, + "end": { + "line": 23, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "Button", + "range": [ + 434, + 440 + ], + "loc": { + "start": { + "line": 23, + "column": 2 + }, + "end": { + "line": 23, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 440, + 441 + ], + "loc": { + "start": { + "line": 23, + "column": 8 + }, + "end": { + "line": 23, + "column": 9 + } + } + } + ], + "range": [ + 0, + 441 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 23, + "column": 9 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach05-scope-output.json new file mode 100644 index 00000000..2388f9ba --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach05-scope-output.json @@ -0,0 +1,2906 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "tippy", + "identifiers": [ + { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + }, + { + "name": "Button", + "identifiers": [ + { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Button", + "range": [ + 387, + 393 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + } + ] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 95, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 85, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 373, + 380 + ], + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 411, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } + } + } + ], + "range": [ + 258, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "range": [ + 245, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "range": [ + 238, + 339 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "range": [ + 234, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + ], + "range": [ + 208, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 16, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 373, + 380 + ], + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 411, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "Button", + "range": [ + 387, + 393 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } + } + } + ], + "range": [ + 258, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "range": [ + 245, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "range": [ + 238, + 339 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "range": [ + 234, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + ], + "range": [ + 208, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 16, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + } + ] + } + ], + "references": [], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } + } + } + ], + "range": [ + 258, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "range": [ + 245, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 15, + "column": 3 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte b/tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte new file mode 100644 index 00000000..5c0cd4d3 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-ts-output.json b/tests/fixtures/parser/ast/svelte5/attach05-ts-output.json new file mode 100644 index 00000000..1d58a645 --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach05-ts-output.json @@ -0,0 +1,3354 @@ +{ + "type": "Program", + "body": [ + { + "type": "SvelteScriptElement", + "name": { + "type": "SvelteName", + "name": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttribute", + "key": { + "type": "SvelteName", + "name": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "boolean": false, + "value": [ + { + "type": "SvelteLiteral", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], + "range": [ + 8, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + "selfClosing": false, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "body": [ + { + "type": "ImportDeclaration", + "importKind": "value", + "source": { + "type": "Literal", + "raw": "'tippy.js'", + "value": "tippy.js", + "range": [ + 38, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "range": [ + 20, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "ImportDeclaration", + "importKind": "value", + "source": { + "type": "Literal", + "raw": "'./Button.svelte'", + "value": "./Button.svelte", + "range": [ + 70, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + ], + "range": [ + 51, + 88 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "ImportDeclaration", + "importKind": "type", + "source": { + "type": "Literal", + "raw": "'svelte/attachments'", + "value": "svelte/attachments", + "range": [ + 122, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 53 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "local": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + ], + "range": [ + 90, + 143 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 54 + } + } + }, + { + "type": "VariableDeclaration", + "kind": "let", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 167, + 175 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 160, + 176 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "range": [ + 150, + 176 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 31 + } + } + } + ], + "range": [ + 146, + 177 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 32 + } + } + }, + { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "range": [ + 230, + 331 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 4 + } + } + } + ], + "range": [ + 226, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 213, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 180, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 335, + 344 + ], + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + "range": [ + 0, + 344 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 344, + 346 + ], + "loc": { + "start": { + "line": 14, + "column": 9 + }, + "end": { + "line": 16, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "html", + "name": { + "type": "SvelteName", + "name": "input", + "range": [ + 347, + 352 + ], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 6 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteDirective", + "kind": "Binding", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "value", + "range": [ + 358, + 363 + ], + "loc": { + "start": { + "line": 16, + "column": 12 + }, + "end": { + "line": 16, + "column": 17 + } + } + }, + "modifiers": [], + "range": [ + 353, + 363 + ], + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 17 + } + } + }, + "expression": { + "type": "Identifier", + "name": "content", + "range": [ + 365, + 372 + ], + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + "shorthand": false, + "range": [ + 353, + 373 + ], + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 27 + } + } + } + ], + "selfClosing": true, + "range": [ + 346, + 376 + ], + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 30 + } + } + }, + "children": [], + "endTag": null, + "range": [ + 346, + 376 + ], + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 30 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 376, + 378 + ], + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 18, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Button", + "range": [ + 379, + 385 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 32 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 395, + 402 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 395, + 411 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 33 + } + } + }, + "range": [ + 386, + 412 + ], + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 34 + } + } + } + ], + "selfClosing": false, + "range": [ + 378, + 413 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 35 + } + } + }, + "children": [ + { + "type": "SvelteText", + "value": "\n\tHover me\n", + "range": [ + 413, + 424 + ], + "loc": { + "start": { + "line": 18, + "column": 35 + }, + "end": { + "line": 20, + "column": 0 + } + } + } + ], + "endTag": { + "type": "SvelteEndTag", + "range": [ + 424, + 433 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 9 + } + } + }, + "range": [ + 378, + 433 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 20, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 20, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 33, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "String", + "value": "'tippy.js'", + "range": [ + 38, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 48, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 51, + 57 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 65, + 69 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 19 + } + } + }, + { + "type": "String", + "value": "'./Button.svelte'", + "range": [ + 70, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 87, + 88 + ], + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 90, + 96 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "type", + "range": [ + 97, + 101 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 102, + 103 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 115, + 116 + ], + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 117, + 121 + ], + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "String", + "value": "'svelte/attachments'", + "range": [ + 122, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 142, + 143 + ], + "loc": { + "start": { + "line": 4, + "column": 53 + }, + "end": { + "line": 4, + "column": 54 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 146, + 149 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 158, + 159 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 166, + 167 + ], + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'Hello!'", + "range": [ + 167, + 175 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 175, + 176 + ], + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 176, + 177 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 180, + 188 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 196, + 197 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 197, + 204 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 204, + 205 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 26 + } + } + }, + { + "type": "Identifier", + "value": "string", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 212, + 213 + ], + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 213, + 214 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 226, + 227 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 8, + "column": 48 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 230, + 236 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 237, + 238 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 247, + 249 + ], + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 250, + 251 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 23 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 255, + 260 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 269, + 270 + ], + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 276, + 277 + ], + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 284, + 285 + ], + "loc": { + "start": { + "line": 10, + "column": 32 + }, + "end": { + "line": 10, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 286, + 287 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 296, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 44 + }, + "end": { + "line": 10, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 297, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 45 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 298, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 46 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 303, + 309 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 317, + 318 + ], + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 325, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 25 + }, + "end": { + "line": 11, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 329, + 330 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 330, + 331 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 333, + 334 + ], + "loc": { + "start": { + "line": 13, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 335, + 336 + ], + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 336, + 337 + ], + "loc": { + "start": { + "line": 14, + "column": 1 + }, + "end": { + "line": 14, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 337, + 343 + ], + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 343, + 344 + ], + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 344, + 346 + ], + "loc": { + "start": { + "line": 14, + "column": 9 + }, + "end": { + "line": 16, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 346, + 347 + ], + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "input", + "range": [ + 347, + 352 + ], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 6 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "bind", + "range": [ + 353, + 357 + ], + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 357, + 358 + ], + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "value", + "range": [ + 358, + 363 + ], + "loc": { + "start": { + "line": 16, + "column": 12 + }, + "end": { + "line": 16, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 363, + 364 + ], + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 364, + 365 + ], + "loc": { + "start": { + "line": 16, + "column": 18 + }, + "end": { + "line": 16, + "column": 19 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 365, + 372 + ], + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 372, + 373 + ], + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 374, + 375 + ], + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 375, + 376 + ], + "loc": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 30 + } + } + }, + { + "type": "HTMLText", + "value": "\n\n", + "range": [ + 376, + 378 + ], + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 18, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 378, + 379 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 1 + } + } + }, + { + "type": "Identifier", + "value": "Button", + "range": [ + 379, + 385 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 386, + 387 + ], + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "@", + "range": [ + 387, + 388 + ], + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 388, + 389 + ], + "loc": { + "start": { + "line": 18, + "column": 10 + }, + "end": { + "line": 18, + "column": 11 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 389, + 390 + ], + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 12 + } + } + }, + { + "type": "Identifier", + "value": "t", + "range": [ + 390, + 391 + ], + "loc": { + "start": { + "line": 18, + "column": 12 + }, + "end": { + "line": 18, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 391, + 392 + ], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "c", + "range": [ + 392, + 393 + ], + "loc": { + "start": { + "line": 18, + "column": 14 + }, + "end": { + "line": 18, + "column": 15 + } + } + }, + { + "type": "Identifier", + "value": "h", + "range": [ + 393, + 394 + ], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 16 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 395, + 402 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 402, + 403 + ], + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 410, + 411 + ], + "loc": { + "start": { + "line": 18, + "column": 32 + }, + "end": { + "line": 18, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 411, + 412 + ], + "loc": { + "start": { + "line": 18, + "column": 33 + }, + "end": { + "line": 18, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 412, + 413 + ], + "loc": { + "start": { + "line": 18, + "column": 34 + }, + "end": { + "line": 18, + "column": 35 + } + } + }, + { + "type": "HTMLText", + "value": "\n\t", + "range": [ + 413, + 415 + ], + "loc": { + "start": { + "line": 18, + "column": 35 + }, + "end": { + "line": 19, + "column": 1 + } + } + }, + { + "type": "HTMLText", + "value": "Hover", + "range": [ + 415, + 420 + ], + "loc": { + "start": { + "line": 19, + "column": 1 + }, + "end": { + "line": 19, + "column": 6 + } + } + }, + { + "type": "HTMLText", + "value": " ", + "range": [ + 420, + 421 + ], + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + } + }, + { + "type": "HTMLText", + "value": "me", + "range": [ + 421, + 423 + ], + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 9 + } + } + }, + { + "type": "HTMLText", + "value": "\n", + "range": [ + 423, + 424 + ], + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 20, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 424, + 425 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 425, + 426 + ], + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "Button", + "range": [ + 426, + 432 + ], + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 432, + 433 + ], + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 9 + } + } + } + ], + "range": [ + 0, + 433 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 20, + "column": 9 + } + } +} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach05-ts-scope-output.json new file mode 100644 index 00000000..12e1396d --- /dev/null +++ b/tests/fixtures/parser/ast/svelte5/attach05-ts-scope-output.json @@ -0,0 +1,3471 @@ +{ + "type": "global", + "variables": [ + { + "name": "$$slots", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$$restProps", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$state", + "identifiers": [], + "defs": [], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$bindable", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$inspect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$host", + "identifiers": [], + "defs": [], + "references": [] + } + ], + "references": [], + "childScopes": [ + { + "type": "module", + "variables": [ + { + "name": "tippy", + "identifiers": [ + { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + }, + { + "name": "Button", + "identifiers": [ + { + "type": "Identifier", + "name": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Button", + "range": [ + 379, + 385 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + } + ] + }, + { + "name": "Attachment", + "identifiers": [ + { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "node": { + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "local": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 167, + 175 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 160, + 176 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + "range": [ + 150, + 176 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 31 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 365, + 372 + ], + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "range": [ + 230, + 331 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 4 + } + } + } + ], + "range": [ + 226, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 213, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 180, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 395, + 402 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "from": "module", + "init": true, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 365, + 372 + ], + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 395, + 402 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "Button", + "range": [ + 379, + 385 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "range": [ + 230, + 331 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 4 + } + } + } + ], + "range": [ + 226, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 213, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 180, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + "from": "module", + "init": null, + "resolved": null + } + ] + } + ], + "through": [] +} \ No newline at end of file From 74351f7208c05771ca38e9e5a1052486a2ca148b Mon Sep 17 00:00:00 2001 From: baseballyama Date: Thu, 15 May 2025 10:54:41 +0900 Subject: [PATCH 4/4] update according to review --- docs/AST.md | 13 + src/parser/converts/attr.ts | 8 +- src/parser/svelte-ast-types.ts | 6 - .../ast/svelte5/attach-ts-01-output.json | 114 +- .../ast/svelte5/attach-ts-02-output.json | 114 +- .../ast/svelte5/attach-ts-03-output.json | 114 +- .../parser/ast/svelte5/attach01-output.json | 114 +- .../parser/ast/svelte5/attach02-output.json | 114 +- .../parser/ast/svelte5/attach03-output.json | 114 +- .../parser/ast/svelte5/attach04-input.svelte | 26 +- .../parser/ast/svelte5/attach04-output.json | 2508 +++++++++--- .../svelte5/attach04-prefer-const-result.json | 14 - .../ast/svelte5/attach04-scope-output.json | 2925 ++++++++++--- .../ast/svelte5/attach04-ts-input.svelte | 22 +- .../ast/svelte5/attach04-ts-output.json | 3117 ++++++++++---- .../attach04-ts-prefer-const-result.json | 14 - .../ast/svelte5/attach04-ts-scope-output.json | 3612 ++++++++++++++--- .../parser/ast/svelte5/attach05-input.svelte | 23 - .../parser/ast/svelte5/attach05-output.json | 2829 ------------- .../ast/svelte5/attach05-scope-output.json | 2906 ------------- .../ast/svelte5/attach05-ts-input.svelte | 20 - .../ast/svelte5/attach05-ts-output.json | 3354 --------------- 22 files changed, 9734 insertions(+), 12347 deletions(-) delete mode 100644 tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json delete mode 100644 tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json delete mode 100644 tests/fixtures/parser/ast/svelte5/attach05-input.svelte delete mode 100644 tests/fixtures/parser/ast/svelte5/attach05-output.json delete mode 100644 tests/fixtures/parser/ast/svelte5/attach05-scope-output.json delete mode 100644 tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte delete mode 100644 tests/fixtures/parser/ast/svelte5/attach05-ts-output.json diff --git a/docs/AST.md b/docs/AST.md index c0f90492..c1d3f92d 100644 --- a/docs/AST.md +++ b/docs/AST.md @@ -169,6 +169,7 @@ interface SvelteStartTag extends Node { | SvelteAttribute | SvelteShorthandAttribute | SvelteSpreadAttribute + | SvelteAttachTag | SvelteDirective | SvelteStyleDirective | SvelteSpecialDirective @@ -451,6 +452,18 @@ interface SvelteRenderTag extends Node { } ``` +### SvelteAttachTag + +This is `{@attach}` tag node. + +```ts +export interface SvelteAttachTag extends BaseNode { + type: "SvelteAttachTag"; + expression: ESTree.Expression; + parent: SvelteStartTag; +} +``` + ### SvelteIfBlock This is the `{#if}` tag node. `{:else if}` is also included in this node. diff --git a/src/parser/converts/attr.ts b/src/parser/converts/attr.ts index 57a96e1f..2904860f 100644 --- a/src/parser/converts/attr.ts +++ b/src/parser/converts/attr.ts @@ -352,7 +352,7 @@ function convertSpreadAttribute( } function convertAttachTag( - node: SvAST.AttachTag | Compiler.AttachTag, + node: Compiler.AttachTag, parent: SvelteAttachTag["parent"], ctx: Context, ): SvelteAttachTag { @@ -367,6 +367,12 @@ function convertAttachTag( attachTag.expression = es; }); + const atAttachStart = ctx.code.indexOf("@attach", attachTag.range[0]); + ctx.addToken("MustacheKeyword", { + start: atAttachStart, + end: atAttachStart + 7, + }); + return attachTag; } diff --git a/src/parser/svelte-ast-types.ts b/src/parser/svelte-ast-types.ts index b34674b0..6cd31660 100644 --- a/src/parser/svelte-ast-types.ts +++ b/src/parser/svelte-ast-types.ts @@ -203,12 +203,6 @@ export interface AttributeShorthand extends BaseNode { type: "AttributeShorthand"; expression: ESTree.Identifier; } - -export interface AttachTag extends BaseNode { - type: "AttachTag"; - expression: ESTree.Expression; -} - export type AttributeOrDirective = | Attribute | Spread diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json index 8283b5d3..33f2cc52 100644 --- a/tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-01-output.json @@ -1939,124 +1939,16 @@ } }, { - "type": "Punctuator", - "value": "@", + "type": "MustacheKeyword", + "value": "@attach", "range": [ 242, - 243 - ], - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 243, - 244 - ], - "loc": { - "start": { - "line": 14, - "column": 7 - }, - "end": { - "line": 14, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 244, - 245 - ], - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 9 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 245, - 246 - ], - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 246, - 247 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 11 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 247, - 248 - ], - "loc": { - "start": { - "line": 14, - "column": 11 - }, - "end": { - "line": 14, - "column": 12 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 248, 249 ], "loc": { "start": { "line": 14, - "column": 12 + "column": 6 }, "end": { "line": 14, diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json index 345d16a2..3ec9cd72 100644 --- a/tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-02-output.json @@ -2777,124 +2777,16 @@ } }, { - "type": "Punctuator", - "value": "@", + "type": "MustacheKeyword", + "value": "@attach", "range": [ 348, - 349 - ], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 349, - 350 - ], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 350, - 351 - ], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 351, - 352 - ], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 352, - 353 - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 353, - 354 - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 354, 355 ], "loc": { "start": { "line": 17, - "column": 15 + "column": 9 }, "end": { "line": 17, diff --git a/tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json b/tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json index 2fb712c4..168412cd 100644 --- a/tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach-ts-03-output.json @@ -1888,124 +1888,16 @@ } }, { - "type": "Punctuator", - "value": "@", + "type": "MustacheKeyword", + "value": "@attach", "range": [ 105, - 106 - ], - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 3 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 106, - 107 - ], - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 107, - 108 - ], - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 108, - 109 - ], - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 6 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 109, - 110 - ], - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 110, - 111 - ], - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 111, 112 ], "loc": { "start": { "line": 8, - "column": 8 + "column": 2 }, "end": { "line": 8, diff --git a/tests/fixtures/parser/ast/svelte5/attach01-output.json b/tests/fixtures/parser/ast/svelte5/attach01-output.json index dffb41e6..674fba42 100644 --- a/tests/fixtures/parser/ast/svelte5/attach01-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach01-output.json @@ -1393,124 +1393,16 @@ } }, { - "type": "Punctuator", - "value": "@", + "type": "MustacheKeyword", + "value": "@attach", "range": [ 215, - 216 - ], - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 12, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 216, - 217 - ], - "loc": { - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 12, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 217, - 218 - ], - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 9 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 218, - 219 - ], - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 219, - 220 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 11 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 220, - 221 - ], - "loc": { - "start": { - "line": 12, - "column": 11 - }, - "end": { - "line": 12, - "column": 12 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 221, 222 ], "loc": { "start": { "line": 12, - "column": 12 + "column": 6 }, "end": { "line": 12, diff --git a/tests/fixtures/parser/ast/svelte5/attach02-output.json b/tests/fixtures/parser/ast/svelte5/attach02-output.json index a5892e20..3db188f7 100644 --- a/tests/fixtures/parser/ast/svelte5/attach02-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach02-output.json @@ -2253,124 +2253,16 @@ } }, { - "type": "Punctuator", - "value": "@", + "type": "MustacheKeyword", + "value": "@attach", "range": [ 356, - 357 - ], - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 357, - 358 - ], - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 358, - 359 - ], - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 359, - 360 - ], - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 360, - 361 - ], - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 361, - 362 - ], - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 362, 363 ], "loc": { "start": { "line": 20, - "column": 15 + "column": 9 }, "end": { "line": 20, diff --git a/tests/fixtures/parser/ast/svelte5/attach03-output.json b/tests/fixtures/parser/ast/svelte5/attach03-output.json index 97ac8927..5d6bd09e 100644 --- a/tests/fixtures/parser/ast/svelte5/attach03-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach03-output.json @@ -1739,124 +1739,16 @@ } }, { - "type": "Punctuator", - "value": "@", + "type": "MustacheKeyword", + "value": "@attach", "range": [ 95, - 96 - ], - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 3 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 96, - 97 - ], - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 97, - 98 - ], - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 98, - 99 - ], - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 6 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 99, - 100 - ], - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 100, - 101 - ], - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 101, 102 ], "loc": { "start": { "line": 8, - "column": 8 + "column": 2 }, "end": { "line": 8, diff --git a/tests/fixtures/parser/ast/svelte5/attach04-input.svelte b/tests/fixtures/parser/ast/svelte5/attach04-input.svelte index 4ba28475..b600aa6e 100644 --- a/tests/fixtures/parser/ast/svelte5/attach04-input.svelte +++ b/tests/fixtures/parser/ast/svelte5/attach04-input.svelte @@ -1,9 +1,23 @@ - - \ No newline at end of file + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-output.json b/tests/fixtures/parser/ast/svelte5/attach04-output.json index cdc45cdf..992bc6d9 100644 --- a/tests/fixtures/parser/ast/svelte5/attach04-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach04-output.json @@ -41,6 +41,152 @@ } }, "body": [ + { + "type": "ImportDeclaration", + "source": { + "type": "Literal", + "raw": "'tippy.js'", + "value": "tippy.js", + "range": [ + 28, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "range": [ + 10, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "ImportDeclaration", + "source": { + "type": "Literal", + "raw": "'./Button.svelte'", + "value": "./Button.svelte", + "range": [ + 60, + 77 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + ], + "range": [ + 41, + 78 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, { "type": "VariableDeclaration", "kind": "let", @@ -48,181 +194,521 @@ { "type": "VariableDeclarator", "id": { - "type": "ObjectPattern", - "properties": [ + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "children", - "range": [ - 79, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 15 - } + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 } + } + } + ], + "callee": { + "type": "Identifier", + "name": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "children", - "range": [ - 79, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 7 + "end": { + "line": 5, + "column": 21 + } + } + }, + "optional": false, + "range": [ + 95, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + "range": [ + 85, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 31 + } + } + } + ], + "range": [ + 81, + 112 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 32 + } + } + }, + { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } }, - "end": { - "line": 3, - "column": 15 + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } } } - }, + ], "range": [ - 79, - 87 + 258, + 338 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 12, + "column": 22 }, "end": { - "line": 3, - "column": 15 + "line": 15, + "column": 3 } } }, - { - "type": "RestElement", - "argument": { + "expression": false, + "generator": false, + "id": null, + "params": [ + { "type": "Identifier", - "name": "props", + "name": "element", "range": [ - 92, - 97 + 246, + 253 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 12, + "column": 10 }, "end": { - "line": 3, - "column": 25 + "line": 12, + "column": 17 } } - }, - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 25 - } } - } - ], - "range": [ - 77, - 99 - ], - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 27 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [], - "callee": { - "type": "Identifier", - "name": "$props", + ], "range": [ - 102, - 108 + 245, + 338 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 12, + "column": 9 }, "end": { - "line": 3, - "column": 36 + "line": 15, + "column": 3 } } }, - "optional": false, "range": [ - 102, - 110 + 238, + 339 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 12, + "column": 2 }, "end": { - "line": 3, - "column": 38 + "line": 15, + "column": 4 } } + } + ], + "range": [ + 234, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", "range": [ - 77, - 110 + 225, + 232 ], "loc": { "start": { - "line": 3, - "column": 5 + "line": 11, + "column": 18 }, "end": { - "line": 3, - "column": 38 + "line": 11, + "column": 25 } } } ], "range": [ - 73, - 111 + 208, + 342 ], "loc": { "start": { - "line": 3, + "line": 11, "column": 1 }, "end": { - "line": 3, - "column": 39 + "line": 16, + "column": 2 } } } @@ -230,23 +716,23 @@ "endTag": { "type": "SvelteEndTag", "range": [ - 112, - 121 + 343, + 352 ], "loc": { "start": { - "line": 4, + "line": 17, "column": 0 }, "end": { - "line": 4, + "line": 17, "column": 9 } } }, "range": [ 0, - 121 + 352 ], "loc": { "start": { @@ -254,7 +740,7 @@ "column": 0 }, "end": { - "line": 4, + "line": 17, "column": 9 } } @@ -263,52 +749,16 @@ "type": "SvelteText", "value": "\n\n", "range": [ - 121, - 123 + 352, + 354 ], "loc": { "start": { - "line": 4, + "line": 17, "column": 9 }, "end": { - "line": 6, - "column": 0 - } - } - }, - { - "type": "SvelteHTMLComment", - "value": " `props` includes attachments ", - "range": [ - 123, - 160 - ], - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 37 - } - } - }, - { - "type": "SvelteText", - "value": "\n", - "range": [ - 160, - 161 - ], - "loc": { - "start": { - "line": 6, - "column": 37 - }, - "end": { - "line": 7, + "line": 19, "column": 0 } } @@ -318,19 +768,19 @@ "kind": "html", "name": { "type": "SvelteName", - "name": "button", + "name": "input", "range": [ - 162, - 168 + 355, + 360 ], "loc": { "start": { - "line": 7, + "line": 19, "column": 1 }, "end": { - "line": 7, - "column": 7 + "line": 19, + "column": 6 } } }, @@ -338,161 +788,259 @@ "type": "SvelteStartTag", "attributes": [ { - "type": "SvelteSpreadAttribute", - "argument": { - "type": "Identifier", - "name": "props", + "type": "SvelteDirective", + "kind": "Binding", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "value", + "range": [ + 366, + 371 + ], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 173, - 178 + 361, + 371 ], "loc": { "start": { - "line": 7, - "column": 12 + "line": 19, + "column": 7 }, "end": { - "line": 7, + "line": 19, "column": 17 } } }, + "expression": { + "type": "Identifier", + "name": "content", + "range": [ + 373, + 380 + ], + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + "shorthand": false, "range": [ - 169, - 179 + 361, + 381 ], "loc": { "start": { - "line": 7, - "column": 8 + "line": 19, + "column": 7 }, "end": { - "line": 7, - "column": 18 + "line": 19, + "column": 27 } } } ], - "selfClosing": false, + "selfClosing": true, "range": [ - 161, - 180 + 354, + 384 ], "loc": { "start": { - "line": 7, + "line": 19, "column": 0 }, "end": { - "line": 7, - "column": 19 + "line": 19, + "column": 30 } } }, - "children": [ - { - "type": "SvelteText", - "value": "\n\t", - "range": [ - 180, - 182 - ], - "loc": { - "start": { - "line": 7, - "column": 19 - }, - "end": { - "line": 8, - "column": 1 - } - } + "children": [], + "endTag": null, + "range": [ + 354, + 384 + ], + "loc": { + "start": { + "line": 19, + "column": 0 }, - { - "type": "SvelteRenderTag", - "expression": { - "type": "ChainExpression", + "end": { + "line": 19, + "column": 30 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 384, + 386 + ], + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 21, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Button", + "range": [ + 387, + 393 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", "expression": { "type": "CallExpression", - "arguments": [], + "arguments": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 411, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 32 + } + } + } + ], "callee": { "type": "Identifier", - "name": "children", + "name": "tooltip", "range": [ - 191, - 199 + 403, + 410 ], "loc": { "start": { - "line": 8, - "column": 10 + "line": 21, + "column": 17 }, "end": { - "line": 8, - "column": 18 + "line": 21, + "column": 24 } } }, - "optional": true, + "optional": false, "range": [ - 191, - 203 + 403, + 419 ], "loc": { "start": { - "line": 8, - "column": 10 + "line": 21, + "column": 17 }, "end": { - "line": 8, - "column": 22 + "line": 21, + "column": 33 } } }, "range": [ - 191, - 203 + 394, + 420 ], "loc": { "start": { - "line": 8, - "column": 10 + "line": 21, + "column": 8 }, "end": { - "line": 8, - "column": 22 + "line": 21, + "column": 34 } } + } + ], + "selfClosing": false, + "range": [ + 386, + 421 + ], + "loc": { + "start": { + "line": 21, + "column": 0 }, - "range": [ - 182, - 204 - ], - "loc": { - "start": { - "line": 8, - "column": 1 - }, - "end": { - "line": 8, - "column": 23 - } + "end": { + "line": 21, + "column": 35 } - }, + } + }, + "children": [ { "type": "SvelteText", - "value": "\n", + "value": "\n\tHover me\n", "range": [ - 204, - 205 + 421, + 432 ], "loc": { "start": { - "line": 8, - "column": 23 + "line": 21, + "column": 35 }, "end": { - "line": 9, + "line": 23, "column": 0 } } @@ -501,31 +1049,31 @@ "endTag": { "type": "SvelteEndTag", "range": [ - 205, - 214 + 432, + 441 ], "loc": { "start": { - "line": 9, + "line": 23, "column": 0 }, "end": { - "line": 9, + "line": 23, "column": 9 } } }, "range": [ - 161, - 214 + 386, + 441 ], "loc": { "start": { - "line": 7, + "line": 21, "column": 0 }, "end": { - "line": 9, + "line": 23, "column": 9 } } @@ -535,19 +1083,19 @@ "comments": [ { "type": "Block", - "value": "* @type {import('svelte/elements').HTMLButtonAttributes} ", + "value": "*\n\t * @param {string} content\n\t * @returns {import('svelte/attachments').Attachment}\n\t ", "range": [ - 10, - 71 + 115, + 206 ], "loc": { "start": { - "line": 2, + "line": 7, "column": 1 }, "end": { - "line": 2, - "column": 62 + "line": 10, + "column": 4 } } } @@ -580,371 +1128,1235 @@ ], "loc": { "start": { - "line": 1, - "column": 1 + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 7, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 10, + 16 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 23, + 27 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "String", + "value": "'tippy.js'", + "range": [ + 28, + 38 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 38, + 39 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 41, + 47 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 55, + 59 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 19 + } + } + }, + { + "type": "String", + "value": "'./Button.svelte'", + "range": [ + 60, + 77 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 77, + 78 + ], + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 81, + 84 + ], + "loc": { + "start": { + "line": 5, + "column": 1 + }, + "end": { + "line": 5, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 93, + 94 + ], + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 101, + 102 + ], + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'Hello!'", + "range": [ + 102, + 110 + ], + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 110, + 111 + ], + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 111, + 112 + ], + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 208, + 216 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 11, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 224, + 225 + ], + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 232, + 233 + ], + "loc": { + "start": { + "line": 11, + "column": 25 + }, + "end": { + "line": 11, + "column": 26 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 234, + 235 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 11, + "column": 28 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 238, + 244 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 245, + 246 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 253, + 254 + ], + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 18 + } + } + }, + { + "type": "Punctuator", + "value": "=>", + "range": [ + 255, + 257 + ], + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 258, + 259 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + } + }, + { + "type": "Keyword", + "value": "const", + "range": [ + 263, + 268 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 277, + 278 + ], + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 284, + 285 + ], + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 25 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "Punctuator", + "value": ",", + "range": [ + 292, + 293 + ], + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 294, + 295 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 304, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 44 + }, + "end": { + "line": 13, + "column": 45 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 305, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 45 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 306, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 46 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 311, + 317 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ".", + "range": [ + 325, + 326 + ], + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 333, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 25 }, "end": { - "line": 1, - "column": 7 + "line": 14, + "column": 26 } } }, { "type": "Punctuator", - "value": ">", + "value": "}", "range": [ - 7, - 8 + 337, + 338 ], "loc": { "start": { - "line": 1, - "column": 7 + "line": 15, + "column": 2 }, "end": { - "line": 1, - "column": 8 + "line": 15, + "column": 3 } } }, { - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": ";", "range": [ - 73, - 76 + 338, + 339 ], "loc": { "start": { - "line": 3, - "column": 1 + "line": 15, + "column": 3 }, "end": { - "line": 3, + "line": 15, "column": 4 } } }, { "type": "Punctuator", - "value": "{", + "value": "}", "range": [ - 77, - 78 + 341, + 342 ], "loc": { "start": { - "line": 3, - "column": 5 + "line": 16, + "column": 1 }, "end": { - "line": 3, - "column": 6 + "line": 16, + "column": 2 } } }, { - "type": "Identifier", - "value": "children", + "type": "Punctuator", + "value": "<", "range": [ - 79, - 87 + 343, + 344 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 17, + "column": 0 }, "end": { - "line": 3, - "column": 15 + "line": 17, + "column": 1 } } }, { "type": "Punctuator", - "value": ",", + "value": "/", "range": [ - 87, - 88 + 344, + 345 ], "loc": { "start": { - "line": 3, - "column": 15 + "line": 17, + "column": 1 }, "end": { - "line": 3, - "column": 16 + "line": 17, + "column": 2 } } }, { - "type": "Punctuator", - "value": "...", + "type": "HTMLIdentifier", + "value": "script", "range": [ - 89, - 92 + 345, + 351 ], "loc": { "start": { - "line": 3, - "column": 17 + "line": 17, + "column": 2 }, "end": { - "line": 3, - "column": 20 + "line": 17, + "column": 8 } } }, { - "type": "Identifier", - "value": "props", + "type": "Punctuator", + "value": ">", "range": [ - 92, - 97 + 351, + 352 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 17, + "column": 8 }, "end": { - "line": 3, - "column": 25 + "line": 17, + "column": 9 } } }, { - "type": "Punctuator", - "value": "}", + "type": "HTMLText", + "value": "\n\n", "range": [ - 98, - 99 + 352, + 354 ], "loc": { "start": { - "line": 3, - "column": 26 + "line": 17, + "column": 9 }, "end": { - "line": 3, - "column": 27 + "line": 19, + "column": 0 } } }, { "type": "Punctuator", - "value": "=", + "value": "<", "range": [ - 100, - 101 + 354, + 355 ], "loc": { "start": { - "line": 3, - "column": 28 + "line": 19, + "column": 0 }, "end": { - "line": 3, - "column": 29 + "line": 19, + "column": 1 } } }, { - "type": "Identifier", - "value": "$props", + "type": "HTMLIdentifier", + "value": "input", "range": [ - 102, - 108 + 355, + 360 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 19, + "column": 1 }, "end": { - "line": 3, - "column": 36 + "line": 19, + "column": 6 } } }, { - "type": "Punctuator", - "value": "(", + "type": "HTMLIdentifier", + "value": "bind", "range": [ - 108, - 109 + 361, + 365 ], "loc": { "start": { - "line": 3, - "column": 36 + "line": 19, + "column": 7 }, "end": { - "line": 3, - "column": 37 + "line": 19, + "column": 11 } } }, { "type": "Punctuator", - "value": ")", + "value": ":", "range": [ - 109, - 110 + 365, + 366 ], "loc": { "start": { - "line": 3, - "column": 37 + "line": 19, + "column": 11 }, "end": { - "line": 3, - "column": 38 + "line": 19, + "column": 12 } } }, { - "type": "Punctuator", - "value": ";", + "type": "HTMLIdentifier", + "value": "value", "range": [ - 110, - 111 + 366, + 371 ], "loc": { "start": { - "line": 3, - "column": 38 + "line": 19, + "column": 12 }, "end": { - "line": 3, - "column": 39 + "line": 19, + "column": 17 } } }, { "type": "Punctuator", - "value": "<", + "value": "=", "range": [ - 112, - 113 + 371, + 372 ], "loc": { "start": { - "line": 4, - "column": 0 + "line": 19, + "column": 17 }, "end": { - "line": 4, - "column": 1 + "line": 19, + "column": 18 } } }, { "type": "Punctuator", - "value": "/", + "value": "{", "range": [ - 113, - 114 + 372, + 373 ], "loc": { "start": { - "line": 4, - "column": 1 + "line": 19, + "column": 18 }, "end": { - "line": 4, - "column": 2 + "line": 19, + "column": 19 } } }, { - "type": "HTMLIdentifier", - "value": "script", + "type": "Identifier", + "value": "content", "range": [ - 114, - 120 + 373, + 380 ], "loc": { "start": { - "line": 4, - "column": 2 + "line": 19, + "column": 19 }, "end": { - "line": 4, - "column": 8 + "line": 19, + "column": 26 } } }, { "type": "Punctuator", - "value": ">", + "value": "}", "range": [ - 120, - 121 + 380, + 381 ], "loc": { "start": { - "line": 4, - "column": 8 + "line": 19, + "column": 26 }, "end": { - "line": 4, - "column": 9 + "line": 19, + "column": 27 } } }, { - "type": "HTMLText", - "value": "\n\n", + "type": "Punctuator", + "value": "/", "range": [ - 121, - 123 + 382, + 383 ], "loc": { "start": { - "line": 4, - "column": 9 + "line": 19, + "column": 28 }, "end": { - "line": 6, - "column": 0 + "line": 19, + "column": 29 } } }, { - "type": "HTMLComment", - "value": "", + "type": "Punctuator", + "value": ">", "range": [ - 123, - 160 + 383, + 384 ], "loc": { "start": { - "line": 6, - "column": 0 + "line": 19, + "column": 29 }, "end": { - "line": 6, - "column": 37 + "line": 19, + "column": 30 } } }, { "type": "HTMLText", - "value": "\n", + "value": "\n\n", "range": [ - 160, - 161 + 384, + 386 ], "loc": { "start": { - "line": 6, - "column": 37 + "line": 19, + "column": 30 }, "end": { - "line": 7, + "line": 21, "column": 0 } } @@ -953,34 +2365,34 @@ "type": "Punctuator", "value": "<", "range": [ - 161, - 162 + 386, + 387 ], "loc": { "start": { - "line": 7, + "line": 21, "column": 0 }, "end": { - "line": 7, + "line": 21, "column": 1 } } }, { - "type": "HTMLIdentifier", - "value": "button", + "type": "Identifier", + "value": "Button", "range": [ - 162, - 168 + 387, + 393 ], "loc": { "start": { - "line": 7, + "line": 21, "column": 1 }, "end": { - "line": 7, + "line": 21, "column": 7 } } @@ -989,233 +2401,215 @@ "type": "Punctuator", "value": "{", "range": [ - 169, - 170 + 394, + 395 ], "loc": { "start": { - "line": 7, + "line": 21, "column": 8 }, "end": { - "line": 7, + "line": 21, "column": 9 } } }, { - "type": "Punctuator", - "value": "...", + "type": "MustacheKeyword", + "value": "@attach", "range": [ - 170, - 173 + 395, + 402 ], "loc": { "start": { - "line": 7, + "line": 21, "column": 9 }, "end": { - "line": 7, - "column": 12 + "line": 21, + "column": 16 } } }, { "type": "Identifier", - "value": "props", - "range": [ - 173, - 178 - ], - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": "}", + "value": "tooltip", "range": [ - 178, - 179 + 403, + 410 ], "loc": { "start": { - "line": 7, + "line": 21, "column": 17 }, "end": { - "line": 7, - "column": 18 + "line": 21, + "column": 24 } } }, { "type": "Punctuator", - "value": ">", + "value": "(", "range": [ - 179, - 180 + 410, + 411 ], "loc": { "start": { - "line": 7, - "column": 18 + "line": 21, + "column": 24 }, "end": { - "line": 7, - "column": 19 + "line": 21, + "column": 25 } } }, { - "type": "HTMLText", - "value": "\n\t", + "type": "Identifier", + "value": "content", "range": [ - 180, - 182 + 411, + 418 ], "loc": { "start": { - "line": 7, - "column": 19 + "line": 21, + "column": 25 }, "end": { - "line": 8, - "column": 1 + "line": 21, + "column": 32 } } }, { "type": "Punctuator", - "value": "{", + "value": ")", "range": [ - 182, - 183 + 418, + 419 ], "loc": { "start": { - "line": 8, - "column": 1 + "line": 21, + "column": 32 }, "end": { - "line": 8, - "column": 2 + "line": 21, + "column": 33 } } }, { - "type": "MustacheKeyword", - "value": "@render", + "type": "Punctuator", + "value": "}", "range": [ - 183, - 190 + 419, + 420 ], "loc": { "start": { - "line": 8, - "column": 2 + "line": 21, + "column": 33 }, "end": { - "line": 8, - "column": 9 + "line": 21, + "column": 34 } } }, { - "type": "Identifier", - "value": "children", + "type": "Punctuator", + "value": ">", "range": [ - 191, - 199 + 420, + 421 ], "loc": { "start": { - "line": 8, - "column": 10 + "line": 21, + "column": 34 }, "end": { - "line": 8, - "column": 18 + "line": 21, + "column": 35 } } }, { - "type": "Punctuator", - "value": "?.", + "type": "HTMLText", + "value": "\n\t", "range": [ - 199, - 201 + 421, + 423 ], "loc": { "start": { - "line": 8, - "column": 18 + "line": 21, + "column": 35 }, "end": { - "line": 8, - "column": 20 + "line": 22, + "column": 1 } } }, { - "type": "Punctuator", - "value": "(", + "type": "HTMLText", + "value": "Hover", "range": [ - 201, - 202 + 423, + 428 ], "loc": { "start": { - "line": 8, - "column": 20 + "line": 22, + "column": 1 }, "end": { - "line": 8, - "column": 21 + "line": 22, + "column": 6 } } }, { - "type": "Punctuator", - "value": ")", + "type": "HTMLText", + "value": " ", "range": [ - 202, - 203 + 428, + 429 ], "loc": { "start": { - "line": 8, - "column": 21 + "line": 22, + "column": 6 }, "end": { - "line": 8, - "column": 22 + "line": 22, + "column": 7 } } }, { - "type": "Punctuator", - "value": "}", + "type": "HTMLText", + "value": "me", "range": [ - 203, - 204 + 429, + 431 ], "loc": { "start": { - "line": 8, - "column": 22 + "line": 22, + "column": 7 }, "end": { - "line": 8, - "column": 23 + "line": 22, + "column": 9 } } }, @@ -1223,16 +2617,16 @@ "type": "HTMLText", "value": "\n", "range": [ - 204, - 205 + 431, + 432 ], "loc": { "start": { - "line": 8, - "column": 23 + "line": 22, + "column": 9 }, "end": { - "line": 9, + "line": 23, "column": 0 } } @@ -1241,16 +2635,16 @@ "type": "Punctuator", "value": "<", "range": [ - 205, - 206 + 432, + 433 ], "loc": { "start": { - "line": 9, + "line": 23, "column": 0 }, "end": { - "line": 9, + "line": 23, "column": 1 } } @@ -1259,34 +2653,34 @@ "type": "Punctuator", "value": "/", "range": [ - 206, - 207 + 433, + 434 ], "loc": { "start": { - "line": 9, + "line": 23, "column": 1 }, "end": { - "line": 9, + "line": 23, "column": 2 } } }, { "type": "HTMLIdentifier", - "value": "button", + "value": "Button", "range": [ - 207, - 213 + 434, + 440 ], "loc": { "start": { - "line": 9, + "line": 23, "column": 2 }, "end": { - "line": 9, + "line": 23, "column": 8 } } @@ -1295,16 +2689,16 @@ "type": "Punctuator", "value": ">", "range": [ - 213, - 214 + 440, + 441 ], "loc": { "start": { - "line": 9, + "line": 23, "column": 8 }, "end": { - "line": 9, + "line": 23, "column": 9 } } @@ -1312,7 +2706,7 @@ ], "range": [ 0, - 214 + 441 ], "loc": { "start": { @@ -1320,7 +2714,7 @@ "column": 0 }, "end": { - "line": 9, + "line": 23, "column": 9 } } diff --git a/tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json b/tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json deleted file mode 100644 index 1b179581..00000000 --- a/tests/fixtures/parser/ast/svelte5/attach04-prefer-const-result.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "ruleId": "prefer-const", - "code": "children", - "line": 3, - "column": 8 - }, - { - "ruleId": "prefer-const", - "code": "props", - "line": 3, - "column": 21 - } -] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach04-scope-output.json index fbdf8845..2388f9ba 100644 --- a/tests/fixtures/parser/ast/svelte5/attach04-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach04-scope-output.json @@ -23,41 +23,23 @@ "name": "$state", "identifiers": [], "defs": [], - "references": [] - }, - { - "name": "$derived", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$effect", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$props", - "identifiers": [], - "defs": [], "references": [ { "identifier": { "type": "Identifier", - "name": "$props", + "name": "$state", "range": [ - 102, - 108 + 95, + 101 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 5, + "column": 15 }, "end": { - "line": 3, - "column": 36 + "line": 5, + "column": 21 } } }, @@ -67,6 +49,24 @@ } ] }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$bindable", "identifiers": [], @@ -92,210 +92,80 @@ "type": "module", "variables": [ { - "name": "children", + "name": "tippy", "identifiers": [ { "type": "Identifier", - "name": "children", + "name": "tippy", "range": [ - 79, - 87 + 17, + 22 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 2, + "column": 8 }, "end": { - "line": 3, - "column": 15 + "line": 2, + "column": 13 } } } ], "defs": [ { - "type": "Variable", + "type": "ImportBinding", "name": { "type": "Identifier", - "name": "children", + "name": "tippy", "range": [ - 79, - 87 + 17, + 22 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 2, + "column": 8 }, "end": { - "line": 3, - "column": 15 + "line": 2, + "column": 13 } } }, "node": { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "children", - "range": [ - 79, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 15 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "children", - "range": [ - 79, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 15 - } - } - }, - "range": [ - 79, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 15 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 92, - 97 - ], - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 25 - } - } - }, - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 25 - } - } - } - ], - "range": [ - 77, - 99 - ], - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 27 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [], - "callee": { - "type": "Identifier", - "name": "$props", - "range": [ - 102, - 108 - ], - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 36 - } - } - }, - "optional": false, + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", "range": [ - 102, - 110 + 17, + 22 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 2, + "column": 8 }, "end": { - "line": 3, - "column": 38 + "line": 2, + "column": 13 } } }, "range": [ - 77, - 110 + 17, + 22 ], "loc": { "start": { - "line": 3, - "column": 5 + "line": 2, + "column": 8 }, "end": { - "line": 3, - "column": 38 + "line": 2, + "column": 13 } } } @@ -305,59 +175,142 @@ { "identifier": { "type": "Identifier", - "name": "children", + "name": "tippy", "range": [ - 79, - 87 + 279, + 284 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 13, + "column": 19 }, "end": { - "line": 3, - "column": 15 + "line": 13, + "column": 24 } } }, - "from": "module", - "init": true, + "from": "function", + "init": null, "resolved": { "type": "Identifier", - "name": "children", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + }, + { + "name": "Button", + "identifiers": [ + { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + ], + "defs": [ + { + "type": "ImportBinding", + "name": { + "type": "Identifier", + "name": "Button", "range": [ - 79, - 87 + 48, + 54 ], "loc": { "start": { "line": 3, - "column": 7 + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "node": { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "range": [ + 48, + 54 + ], + "loc": { + "start": { + "line": 3, + "column": 8 }, "end": { "line": 3, - "column": 15 + "column": 14 } } } - }, + } + ], + "references": [ { "identifier": { "type": "Identifier", - "name": "children", + "name": "Button", "range": [ - 191, - 199 + 387, + 393 ], "loc": { "start": { - "line": 8, - "column": 10 + "line": 21, + "column": 1 }, "end": { - "line": 8, - "column": 18 + "line": 21, + "column": 7 } } }, @@ -365,19 +318,19 @@ "init": null, "resolved": { "type": "Identifier", - "name": "children", + "name": "Button", "range": [ - 79, - 87 + 48, + 54 ], "loc": { "start": { "line": 3, - "column": 7 + "column": 8 }, "end": { "line": 3, - "column": 15 + "column": 14 } } } @@ -385,23 +338,23 @@ ] }, { - "name": "props", + "name": "content", "identifiers": [ { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 92, - 97 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 25 + "line": 5, + "column": 12 } } } @@ -411,184 +364,111 @@ "type": "Variable", "name": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 92, - 97 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 25 + "line": 5, + "column": 12 } } }, "node": { "type": "VariableDeclarator", "id": { - "type": "ObjectPattern", - "properties": [ + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "children", - "range": [ - 79, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 15 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "children", - "range": [ - 79, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 15 - } - } - }, + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", "range": [ - 79, - 87 + 102, + 110 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 5, + "column": 22 }, "end": { - "line": 3, - "column": 15 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 92, - 97 - ], - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 25 - } - } - }, - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 25 + "line": 5, + "column": 30 } } } ], - "range": [ - 77, - 99 - ], - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 27 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [], "callee": { "type": "Identifier", - "name": "$props", + "name": "$state", "range": [ - 102, - 108 + 95, + 101 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 5, + "column": 15 }, "end": { - "line": 3, - "column": 36 + "line": 5, + "column": 21 } } }, "optional": false, "range": [ - 102, - 110 + 95, + 111 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 5, + "column": 15 }, "end": { - "line": 3, - "column": 38 + "line": 5, + "column": 31 } } }, "range": [ - 77, - 110 + 85, + 111 ], "loc": { "start": { - "line": 3, + "line": 5, "column": 5 }, "end": { - "line": 3, - "column": 38 + "line": 5, + "column": 31 } } } @@ -598,19 +478,19 @@ { "identifier": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 92, - 97 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 25 + "line": 5, + "column": 12 } } }, @@ -618,19 +498,59 @@ "init": true, "resolved": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 92, - 97 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 25 + "line": 5, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 373, + 380 + ], + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 85, + 92 + ], + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 } } } @@ -638,19 +558,520 @@ { "identifier": { "type": "Identifier", - "name": "props", + "name": "content", + "range": [ + 411, + 418 + ], + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", "range": [ - 173, - 178 + 85, + 92 ], "loc": { "start": { - "line": 7, + "line": 5, + "column": 5 + }, + "end": { + "line": 5, "column": 12 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } + } + } + ], + "range": [ + 258, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "range": [ + 245, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "range": [ + 238, + 339 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "range": [ + 234, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + ], + "range": [ + 208, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 1 }, "end": { - "line": 7, + "line": 16, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 21, "column": 17 + }, + "end": { + "line": 21, + "column": 24 } } }, @@ -658,19 +1079,19 @@ "init": null, "resolved": { "type": "Identifier", - "name": "props", + "name": "tooltip", "range": [ - 92, - 97 + 217, + 224 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 11, + "column": 10 }, "end": { - "line": 3, - "column": 25 + "line": 11, + "column": 17 } } } @@ -682,19 +1103,19 @@ { "identifier": { "type": "Identifier", - "name": "children", + "name": "content", "range": [ - 79, - 87 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 15 + "line": 5, + "column": 12 } } }, @@ -702,19 +1123,19 @@ "init": true, "resolved": { "type": "Identifier", - "name": "children", + "name": "content", "range": [ - 79, - 87 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 15 + "line": 5, + "column": 12 } } } @@ -722,82 +1143,82 @@ { "identifier": { "type": "Identifier", - "name": "props", + "name": "$state", "range": [ - 92, - 97 + 95, + 101 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 5, + "column": 15 }, "end": { - "line": 3, - "column": 25 + "line": 5, + "column": 21 } } }, "from": "module", - "init": true, - "resolved": { + "init": null, + "resolved": null + }, + { + "identifier": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 92, - 97 + 373, + 380 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 19, + "column": 19 }, "end": { - "line": 3, - "column": 25 + "line": 19, + "column": 26 } } - } - }, - { - "identifier": { + }, + "from": "module", + "init": null, + "resolved": { "type": "Identifier", - "name": "$props", + "name": "content", "range": [ - 102, - 108 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 30 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 36 + "line": 5, + "column": 12 } } - }, - "from": "module", - "init": null, - "resolved": null + } }, { "identifier": { "type": "Identifier", - "name": "props", + "name": "tooltip", "range": [ - 173, - 178 + 403, + 410 ], "loc": { "start": { - "line": 7, - "column": 12 + "line": 21, + "column": 17 }, "end": { - "line": 7, - "column": 17 + "line": 21, + "column": 24 } } }, @@ -805,19 +1226,19 @@ "init": null, "resolved": { "type": "Identifier", - "name": "props", + "name": "tooltip", "range": [ - 92, - 97 + 217, + 224 ], "loc": { "start": { - "line": 3, - "column": 20 + "line": 11, + "column": 10 }, "end": { - "line": 3, - "column": 25 + "line": 11, + "column": 17 } } } @@ -825,19 +1246,19 @@ { "identifier": { "type": "Identifier", - "name": "children", + "name": "content", "range": [ - 191, - 199 + 411, + 418 ], "loc": { "start": { - "line": 8, - "column": 10 + "line": 21, + "column": 25 }, "end": { - "line": 8, - "column": 18 + "line": 21, + "column": 32 } } }, @@ -845,42 +1266,1632 @@ "init": null, "resolved": { "type": "Identifier", - "name": "children", + "name": "content", "range": [ - 79, - 87 + 85, + 92 ], "loc": { "start": { - "line": 3, - "column": 7 + "line": 5, + "column": 5 }, "end": { - "line": 3, - "column": 15 + "line": 5, + "column": 12 } } } - } - ], - "childScopes": [], - "through": [ + }, { "identifier": { "type": "Identifier", - "name": "$props", + "name": "Button", "range": [ - 102, - 108 + 387, + 393 + ], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Button", + "range": [ + 48, + 54 ], "loc": { "start": { "line": 3, - "column": 30 + "column": 8 }, "end": { "line": 3, - "column": 36 + "column": 14 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } + } + } + ], + "range": [ + 258, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "range": [ + 245, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "range": [ + 238, + 339 + ], + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 15, + "column": 4 + } + } + } + ], + "range": [ + 234, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 16, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 217, + 224 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + ], + "range": [ + 208, + 342 + ], + "loc": { + "start": { + "line": 11, + "column": 1 + }, + "end": { + "line": 16, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + } + ] + } + ], + "references": [], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + ], + "range": [ + 263, + 307 + ], + "loc": { + "start": { + "line": 13, + "column": 3 + }, + "end": { + "line": 13, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 326, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 318, + 333 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 25 + } + } + }, + "range": [ + 311, + 334 + ], + "loc": { + "start": { + "line": 14, + "column": 3 + }, + "end": { + "line": 14, + "column": 26 + } + } + } + ], + "range": [ + 258, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 15, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + ], + "range": [ + 245, + 338 + ], + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 15, + "column": 3 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + } + ], + "range": [ + 294, + 305 + ], + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 279, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 46 + } + } + }, + "range": [ + 269, + 306 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 46 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 285, + 292 + ], + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 246, + 253 + ], + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 269, + 276 + ], + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 16 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 296, + 303 + ], + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 225, + 232 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 279, + 284 + ], + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 17, + 22 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 95, + 101 + ], + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 21 } } }, diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte b/tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte index 7c62a792..5c0cd4d3 100644 --- a/tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte +++ b/tests/fixtures/parser/ast/svelte5/attach04-ts-input.svelte @@ -1,10 +1,20 @@ - - \ No newline at end of file + + + \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-output.json b/tests/fixtures/parser/ast/svelte5/attach04-ts-output.json index e2f42b34..8ca334a4 100644 --- a/tests/fixtures/parser/ast/svelte5/attach04-ts-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach04-ts-output.json @@ -100,23 +100,171 @@ "body": [ { "type": "ImportDeclaration", - "importKind": "type", + "importKind": "value", "source": { "type": "Literal", - "raw": "'svelte/elements'", - "value": "svelte/elements", + "raw": "'tippy.js'", + "value": "tippy.js", "range": [ - 62, - 79 + 38, + 48 ], "loc": { "start": { "line": 2, - "column": 43 + "column": 19 }, "end": { "line": 2, - "column": 60 + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "range": [ + 20, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "ImportDeclaration", + "importKind": "value", + "source": { + "type": "Literal", + "raw": "'./Button.svelte'", + "value": "./Button.svelte", + "range": [ + 70, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + ], + "range": [ + 51, + 88 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "ImportDeclaration", + "importKind": "type", + "source": { + "type": "Literal", + "raw": "'svelte/attachments'", + "value": "svelte/attachments", + "range": [ + 122, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 53 } } }, @@ -126,68 +274,68 @@ "importKind": "value", "imported": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "Attachment", "range": [ - 34, - 54 + 104, + 114 ], "loc": { "start": { - "line": 2, + "line": 4, "column": 15 }, "end": { - "line": 2, - "column": 35 + "line": 4, + "column": 25 } } }, "local": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "Attachment", "range": [ - 34, - 54 + 104, + 114 ], "loc": { "start": { - "line": 2, + "line": 4, "column": 15 }, "end": { - "line": 2, - "column": 35 + "line": 4, + "column": 25 } } }, "range": [ - 34, - 54 + 104, + 114 ], "loc": { "start": { - "line": 2, + "line": 4, "column": 15 }, "end": { - "line": 2, - "column": 35 + "line": 4, + "column": 25 } } } ], "range": [ - 20, - 80 + 90, + 143 ], "loc": { "start": { - "line": 2, + "line": 4, "column": 1 }, "end": { - "line": 2, - "column": 61 + "line": 4, + "column": 54 } } }, @@ -198,320 +346,657 @@ { "type": "VariableDeclarator", "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 102, - 107 - ], - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 25 - } - } - }, - "optional": false, - "range": [ - 99, - 107 - ], - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 25 - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeAnnotation", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "HTMLButtonAttributes", - "range": [ - 111, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, - "range": [ - 111, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, - "range": [ - 109, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, + "type": "Identifier", + "name": "content", "range": [ - 87, - 131 + 150, + 157 ], "loc": { "start": { - "line": 4, + "line": 6, "column": 5 }, "end": { - "line": 4, - "column": 49 + "line": 6, + "column": 12 } } }, "init": { "type": "CallExpression", - "arguments": [], + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 167, + 175 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], "callee": { "type": "Identifier", - "name": "$props", + "name": "$state", "range": [ - 134, - 140 + 160, + 166 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 6, + "column": 15 }, "end": { - "line": 4, - "column": 58 + "line": 6, + "column": 21 } } }, "optional": false, "range": [ - 134, - 142 + 160, + 176 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 6, + "column": 15 }, "end": { - "line": 4, - "column": 60 + "line": 6, + "column": 31 } } }, "range": [ - 87, - 142 + 150, + 176 ], "loc": { "start": { - "line": 4, + "line": 6, "column": 5 }, "end": { - "line": 4, - "column": 60 + "line": 6, + "column": 31 } } } ], "range": [ - 83, - 143 + 146, + 177 ], "loc": { "start": { - "line": 4, + "line": 6, "column": 1 }, "end": { - "line": 4, - "column": 61 + "line": 6, + "column": 32 } } - } - ], - "endTag": { - "type": "SvelteEndTag", - "range": [ - 144, - 153 - ], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 9 - } - } - }, - "range": [ - 0, - 153 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 5, - "column": 9 - } - } - }, - { - "type": "SvelteText", - "value": "\n\n", - "range": [ - 153, - 155 + { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "range": [ + 230, + 331 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 4 + } + } + } + ], + "range": [ + 226, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 213, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 180, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } + } ], - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 7, - "column": 0 + "endTag": { + "type": "SvelteEndTag", + "range": [ + 335, + 344 + ], + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 9 + } } - } - }, - { - "type": "SvelteHTMLComment", - "value": " `props` includes attachments ", + }, "range": [ - 155, - 192 + 0, + 344 ], "loc": { "start": { - "line": 7, + "line": 1, "column": 0 }, "end": { - "line": 7, - "column": 37 + "line": 14, + "column": 9 } } }, { "type": "SvelteText", - "value": "\n", + "value": "\n\n", "range": [ - 192, - 193 + 344, + 346 ], "loc": { "start": { - "line": 7, - "column": 37 + "line": 14, + "column": 9 }, "end": { - "line": 8, + "line": 16, "column": 0 } } @@ -521,19 +1006,19 @@ "kind": "html", "name": { "type": "SvelteName", - "name": "button", + "name": "input", "range": [ - 194, - 200 + 347, + 352 ], "loc": { "start": { - "line": 8, + "line": 16, "column": 1 }, "end": { - "line": 8, - "column": 7 + "line": 16, + "column": 6 } } }, @@ -541,253 +1026,1233 @@ "type": "SvelteStartTag", "attributes": [ { - "type": "SvelteSpreadAttribute", - "argument": { - "type": "Identifier", - "name": "props", + "type": "SvelteDirective", + "kind": "Binding", + "key": { + "type": "SvelteDirectiveKey", + "name": { + "type": "SvelteName", + "name": "value", + "range": [ + 358, + 363 + ], + "loc": { + "start": { + "line": 16, + "column": 12 + }, + "end": { + "line": 16, + "column": 17 + } + } + }, + "modifiers": [], "range": [ - 205, - 210 + 353, + 363 ], "loc": { "start": { - "line": 8, - "column": 12 + "line": 16, + "column": 7 }, "end": { - "line": 8, + "line": 16, "column": 17 } } }, + "expression": { + "type": "Identifier", + "name": "content", + "range": [ + 365, + 372 + ], + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + "shorthand": false, "range": [ - 201, - 211 + 353, + 373 ], "loc": { "start": { - "line": 8, - "column": 8 + "line": 16, + "column": 7 }, "end": { - "line": 8, - "column": 18 + "line": 16, + "column": 27 } } } ], - "selfClosing": false, + "selfClosing": true, "range": [ - 193, - 212 + 346, + 376 ], "loc": { "start": { - "line": 8, + "line": 16, "column": 0 }, "end": { - "line": 8, - "column": 19 + "line": 16, + "column": 30 } } }, - "children": [ - { - "type": "SvelteText", - "value": "\n\t", - "range": [ - 212, - 214 - ], - "loc": { - "start": { - "line": 8, - "column": 19 - }, - "end": { - "line": 9, - "column": 1 - } - } + "children": [], + "endTag": null, + "range": [ + 346, + 376 + ], + "loc": { + "start": { + "line": 16, + "column": 0 }, - { - "type": "SvelteRenderTag", - "expression": { - "type": "ChainExpression", - "expression": { - "type": "CallExpression", - "arguments": [], - "callee": { - "type": "Identifier", - "name": "children", - "range": [ - 223, - 231 - ], - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 18 - } - } - }, - "optional": true, - "range": [ - 223, - 235 - ], - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 22 - } - } - }, - "range": [ - 223, - 235 - ], - "loc": { - "start": { - "line": 9, - "column": 10 + "end": { + "line": 16, + "column": 30 + } + } + }, + { + "type": "SvelteText", + "value": "\n\n", + "range": [ + 376, + 378 + ], + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 18, + "column": 0 + } + } + }, + { + "type": "SvelteElement", + "kind": "component", + "name": { + "type": "Identifier", + "name": "Button", + "range": [ + 379, + 385 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "startTag": { + "type": "SvelteStartTag", + "attributes": [ + { + "type": "SvelteAttachTag", + "expression": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 32 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 395, + 402 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 395, + 411 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 33 + } + } + }, + "range": [ + 386, + 412 + ], + "loc": { + "start": { + "line": 18, + "column": 8 }, "end": { - "line": 9, - "column": 22 + "line": 18, + "column": 34 } } + } + ], + "selfClosing": false, + "range": [ + 378, + 413 + ], + "loc": { + "start": { + "line": 18, + "column": 0 }, - "range": [ - 214, - 236 - ], - "loc": { - "start": { - "line": 9, - "column": 1 - }, - "end": { - "line": 9, - "column": 23 - } + "end": { + "line": 18, + "column": 35 } - }, + } + }, + "children": [ { "type": "SvelteText", - "value": "\n", + "value": "\n\tHover me\n", "range": [ - 236, - 237 + 413, + 424 ], "loc": { "start": { - "line": 9, - "column": 23 + "line": 18, + "column": 35 }, "end": { - "line": 10, + "line": 20, "column": 0 } } } ], - "endTag": { - "type": "SvelteEndTag", - "range": [ - 237, - 246 - ], - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 9 - } + "endTag": { + "type": "SvelteEndTag", + "range": [ + 424, + 433 + ], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 9 + } + } + }, + "range": [ + 378, + 433 + ], + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 20, + "column": 9 + } + } + } + ], + "sourceType": "module", + "comments": [], + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "script", + "range": [ + 1, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "HTMLIdentifier", + "value": "lang", + "range": [ + 8, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "HTMLText", + "value": "ts", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + }, + { + "type": "Punctuator", + "value": "\"", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 20, + 26 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 33, + 37 + ], + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + } + }, + { + "type": "String", + "value": "'tippy.js'", + "range": [ + 38, + 48 + ], + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 29 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 48, + 49 + ], + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 51, + 57 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "Button", + "range": [ + 58, + 64 + ], + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 65, + 69 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 19 + } + } + }, + { + "type": "String", + "value": "'./Button.svelte'", + "range": [ + 70, + 87 + ], + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 37 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 87, + 88 + ], + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 3, + "column": 38 + } + } + }, + { + "type": "Keyword", + "value": "import", + "range": [ + 90, + 96 + ], + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 7 + } + } + }, + { + "type": "Identifier", + "value": "type", + "range": [ + 97, + 101 + ], + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 102, + 103 + ], + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 115, + 116 + ], + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + } + }, + { + "type": "Identifier", + "value": "from", + "range": [ + 117, + 121 + ], + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 32 + } + } + }, + { + "type": "String", + "value": "'svelte/attachments'", + "range": [ + 122, + 142 + ], + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 53 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 142, + 143 + ], + "loc": { + "start": { + "line": 4, + "column": 53 + }, + "end": { + "line": 4, + "column": 54 + } + } + }, + { + "type": "Keyword", + "value": "let", + "range": [ + 146, + 149 + ], + "loc": { + "start": { + "line": 6, + "column": 1 + }, + "end": { + "line": 6, + "column": 4 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "=", + "range": [ + 158, + 159 + ], + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + } + }, + { + "type": "Identifier", + "value": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 21 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 166, + 167 + ], + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + } + }, + { + "type": "String", + "value": "'Hello!'", + "range": [ + 167, + 175 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 175, + 176 + ], + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 176, + 177 + ], + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 180, + 188 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 8, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 196, + 197 + ], + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + } + }, + { + "type": "Identifier", + "value": "content", + "range": [ + 197, + 204 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 25 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 204, + 205 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 26 + } + } + }, + { + "type": "Identifier", + "value": "string", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 212, + 213 + ], + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 34 + } + } + }, + { + "type": "Punctuator", + "value": ":", + "range": [ + 213, + 214 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 35 + } + } + }, + { + "type": "Identifier", + "value": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 226, + 227 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 8, + "column": 48 + } + } + }, + { + "type": "Keyword", + "value": "return", + "range": [ + 230, + 236 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 237, + 238 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + } + }, + { + "type": "Identifier", + "value": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 } - }, + } + }, + { + "type": "Punctuator", + "value": ")", "range": [ - 193, + 245, 246 ], "loc": { "start": { - "line": 8, - "column": 0 + "line": 9, + "column": 17 }, "end": { - "line": 10, - "column": 9 + "line": 9, + "column": 18 } } - } - ], - "sourceType": "module", - "comments": [], - "tokens": [ + }, { "type": "Punctuator", - "value": "<", + "value": "=>", "range": [ - 0, - 1 + 247, + 249 ], "loc": { "start": { - "line": 1, - "column": 0 + "line": 9, + "column": 19 }, "end": { - "line": 1, - "column": 1 + "line": 9, + "column": 21 } } }, { - "type": "HTMLIdentifier", - "value": "script", + "type": "Punctuator", + "value": "{", "range": [ - 1, - 7 + 250, + 251 ], "loc": { "start": { - "line": 1, - "column": 1 + "line": 9, + "column": 22 }, "end": { - "line": 1, - "column": 7 + "line": 9, + "column": 23 } } }, { - "type": "HTMLIdentifier", - "value": "lang", + "type": "Keyword", + "value": "const", "range": [ - 8, - 12 + 255, + 260 ], "loc": { "start": { - "line": 1, + "line": 10, + "column": 3 + }, + "end": { + "line": 10, "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 }, "end": { - "line": 1, - "column": 12 + "line": 10, + "column": 16 } } }, @@ -795,610 +2260,628 @@ "type": "Punctuator", "value": "=", "range": [ - 12, - 13 + 269, + 270 ], "loc": { "start": { - "line": 1, - "column": 12 + "line": 10, + "column": 17 }, "end": { - "line": 1, - "column": 13 + "line": 10, + "column": 18 } } }, { - "type": "Punctuator", - "value": "\"", + "type": "Identifier", + "value": "tippy", "range": [ - 13, - 14 + 271, + 276 ], "loc": { "start": { - "line": 1, - "column": 13 + "line": 10, + "column": 19 }, "end": { - "line": 1, - "column": 14 + "line": 10, + "column": 24 } } }, { - "type": "HTMLText", - "value": "ts", + "type": "Punctuator", + "value": "(", "range": [ - 14, - 16 + 276, + 277 ], "loc": { "start": { - "line": 1, - "column": 14 + "line": 10, + "column": 24 }, "end": { - "line": 1, - "column": 16 + "line": 10, + "column": 25 } } }, { - "type": "Punctuator", - "value": "\"", + "type": "Identifier", + "value": "element", "range": [ - 16, - 17 + 277, + 284 ], "loc": { "start": { - "line": 1, - "column": 16 + "line": 10, + "column": 25 }, "end": { - "line": 1, - "column": 17 + "line": 10, + "column": 32 } } }, { "type": "Punctuator", - "value": ">", + "value": ",", "range": [ - 17, - 18 + 284, + 285 ], "loc": { "start": { - "line": 1, - "column": 17 + "line": 10, + "column": 32 }, "end": { - "line": 1, - "column": 18 + "line": 10, + "column": 33 } } }, { - "type": "Keyword", - "value": "import", + "type": "Punctuator", + "value": "{", "range": [ - 20, - 26 + 286, + 287 ], "loc": { "start": { - "line": 2, - "column": 1 + "line": 10, + "column": 34 }, "end": { - "line": 2, - "column": 7 + "line": 10, + "column": 35 } } }, { "type": "Identifier", - "value": "type", + "value": "content", "range": [ - 27, - 31 + 288, + 295 ], "loc": { "start": { - "line": 2, - "column": 8 + "line": 10, + "column": 36 }, "end": { - "line": 2, - "column": 12 + "line": 10, + "column": 43 } } }, { "type": "Punctuator", - "value": "{", + "value": "}", "range": [ - 32, - 33 + 296, + 297 ], "loc": { "start": { - "line": 2, - "column": 13 + "line": 10, + "column": 44 }, "end": { - "line": 2, - "column": 14 + "line": 10, + "column": 45 } } }, { - "type": "Identifier", - "value": "HTMLButtonAttributes", + "type": "Punctuator", + "value": ")", "range": [ - 34, - 54 + 297, + 298 ], "loc": { "start": { - "line": 2, - "column": 15 + "line": 10, + "column": 45 }, "end": { - "line": 2, - "column": 35 + "line": 10, + "column": 46 } } }, { "type": "Punctuator", - "value": "}", + "value": ";", "range": [ - 55, - 56 + 298, + 299 ], "loc": { "start": { - "line": 2, - "column": 36 + "line": 10, + "column": 46 }, "end": { - "line": 2, - "column": 37 + "line": 10, + "column": 47 } } }, { - "type": "Identifier", - "value": "from", + "type": "Keyword", + "value": "return", "range": [ - 57, - 61 + 303, + 309 ], "loc": { "start": { - "line": 2, - "column": 38 + "line": 11, + "column": 3 }, "end": { - "line": 2, - "column": 42 + "line": 11, + "column": 9 } } }, { - "type": "String", - "value": "'svelte/elements'", + "type": "Identifier", + "value": "tooltip", "range": [ - 62, - 79 + 310, + 317 ], "loc": { "start": { - "line": 2, - "column": 43 + "line": 11, + "column": 10 }, "end": { - "line": 2, - "column": 60 + "line": 11, + "column": 17 } } }, { "type": "Punctuator", - "value": ";", + "value": ".", "range": [ - 79, - 80 + 317, + 318 ], "loc": { "start": { - "line": 2, - "column": 60 + "line": 11, + "column": 17 }, "end": { - "line": 2, - "column": 61 + "line": 11, + "column": 18 } } }, { - "type": "Keyword", - "value": "let", + "type": "Identifier", + "value": "destroy", "range": [ - 83, - 86 + 318, + 325 ], "loc": { "start": { - "line": 4, - "column": 1 + "line": 11, + "column": 18 }, "end": { - "line": 4, - "column": 4 + "line": 11, + "column": 25 } } }, { "type": "Punctuator", - "value": "{", + "value": ";", "range": [ - 87, - 88 + 325, + 326 ], "loc": { "start": { - "line": 4, - "column": 5 + "line": 11, + "column": 25 }, "end": { - "line": 4, - "column": 6 + "line": 11, + "column": 26 } } }, { - "type": "Identifier", - "value": "children", + "type": "Punctuator", + "value": "}", "range": [ - 89, - 97 + 329, + 330 ], "loc": { "start": { - "line": 4, - "column": 7 + "line": 12, + "column": 2 }, "end": { - "line": 4, - "column": 15 + "line": 12, + "column": 3 } } }, { "type": "Punctuator", - "value": ",", + "value": ";", + "range": [ + 330, + 331 + ], + "loc": { + "start": { + "line": 12, + "column": 3 + }, + "end": { + "line": 12, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "}", "range": [ - 97, - 98 + 333, + 334 ], "loc": { "start": { - "line": 4, - "column": 15 + "line": 13, + "column": 1 }, "end": { - "line": 4, - "column": 16 + "line": 13, + "column": 2 } } }, { "type": "Punctuator", - "value": "...", + "value": "<", "range": [ - 99, - 102 + 335, + 336 ], "loc": { "start": { - "line": 4, - "column": 17 + "line": 14, + "column": 0 }, "end": { - "line": 4, - "column": 20 + "line": 14, + "column": 1 } } }, { - "type": "Identifier", - "value": "props", + "type": "Punctuator", + "value": "/", "range": [ - 102, - 107 + 336, + 337 ], "loc": { "start": { - "line": 4, - "column": 20 + "line": 14, + "column": 1 }, "end": { - "line": 4, - "column": 25 + "line": 14, + "column": 2 } } }, { - "type": "Punctuator", - "value": "}", + "type": "HTMLIdentifier", + "value": "script", "range": [ - 108, - 109 + 337, + 343 ], "loc": { "start": { - "line": 4, - "column": 26 + "line": 14, + "column": 2 }, "end": { - "line": 4, - "column": 27 + "line": 14, + "column": 8 } } }, { "type": "Punctuator", - "value": ":", + "value": ">", "range": [ - 109, - 110 + 343, + 344 ], "loc": { "start": { - "line": 4, - "column": 27 + "line": 14, + "column": 8 }, "end": { - "line": 4, - "column": 28 + "line": 14, + "column": 9 } } }, { - "type": "Identifier", - "value": "HTMLButtonAttributes", + "type": "HTMLText", + "value": "\n\n", "range": [ - 111, - 131 + 344, + 346 ], "loc": { "start": { - "line": 4, - "column": 29 + "line": 14, + "column": 9 }, "end": { - "line": 4, - "column": 49 + "line": 16, + "column": 0 } } }, { "type": "Punctuator", - "value": "=", + "value": "<", "range": [ - 132, - 133 + 346, + 347 ], "loc": { "start": { - "line": 4, - "column": 50 + "line": 16, + "column": 0 }, "end": { - "line": 4, - "column": 51 + "line": 16, + "column": 1 } } }, { - "type": "Identifier", - "value": "$props", + "type": "HTMLIdentifier", + "value": "input", "range": [ - 134, - 140 + 347, + 352 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 16, + "column": 1 }, "end": { - "line": 4, - "column": 58 + "line": 16, + "column": 6 } } }, { - "type": "Punctuator", - "value": "(", + "type": "HTMLIdentifier", + "value": "bind", "range": [ - 140, - 141 + 353, + 357 ], "loc": { "start": { - "line": 4, - "column": 58 + "line": 16, + "column": 7 }, "end": { - "line": 4, - "column": 59 + "line": 16, + "column": 11 } } }, { "type": "Punctuator", - "value": ")", + "value": ":", "range": [ - 141, - 142 + 357, + 358 ], "loc": { "start": { - "line": 4, - "column": 59 + "line": 16, + "column": 11 }, "end": { - "line": 4, - "column": 60 + "line": 16, + "column": 12 } } }, { - "type": "Punctuator", - "value": ";", + "type": "HTMLIdentifier", + "value": "value", "range": [ - 142, - 143 + 358, + 363 ], "loc": { "start": { - "line": 4, - "column": 60 + "line": 16, + "column": 12 }, "end": { - "line": 4, - "column": 61 + "line": 16, + "column": 17 } } }, { "type": "Punctuator", - "value": "<", + "value": "=", "range": [ - 144, - 145 + 363, + 364 ], "loc": { "start": { - "line": 5, - "column": 0 + "line": 16, + "column": 17 }, "end": { - "line": 5, - "column": 1 + "line": 16, + "column": 18 } } }, { "type": "Punctuator", - "value": "/", + "value": "{", "range": [ - 145, - 146 + 364, + 365 ], "loc": { "start": { - "line": 5, - "column": 1 + "line": 16, + "column": 18 }, "end": { - "line": 5, - "column": 2 + "line": 16, + "column": 19 } } }, { - "type": "HTMLIdentifier", - "value": "script", + "type": "Identifier", + "value": "content", "range": [ - 146, - 152 + 365, + 372 ], "loc": { "start": { - "line": 5, - "column": 2 + "line": 16, + "column": 19 }, "end": { - "line": 5, - "column": 8 + "line": 16, + "column": 26 } } }, { "type": "Punctuator", - "value": ">", + "value": "}", "range": [ - 152, - 153 + 372, + 373 ], "loc": { "start": { - "line": 5, - "column": 8 + "line": 16, + "column": 26 }, "end": { - "line": 5, - "column": 9 + "line": 16, + "column": 27 } } }, { - "type": "HTMLText", - "value": "\n\n", + "type": "Punctuator", + "value": "/", "range": [ - 153, - 155 + 374, + 375 ], "loc": { "start": { - "line": 5, - "column": 9 + "line": 16, + "column": 28 }, "end": { - "line": 7, - "column": 0 + "line": 16, + "column": 29 } } }, { - "type": "HTMLComment", - "value": "", + "type": "Punctuator", + "value": ">", "range": [ - 155, - 192 + 375, + 376 ], "loc": { "start": { - "line": 7, - "column": 0 + "line": 16, + "column": 29 }, "end": { - "line": 7, - "column": 37 + "line": 16, + "column": 30 } } }, { "type": "HTMLText", - "value": "\n", + "value": "\n\n", "range": [ - 192, - 193 + 376, + 378 ], "loc": { "start": { - "line": 7, - "column": 37 + "line": 16, + "column": 30 }, "end": { - "line": 8, + "line": 18, "column": 0 } } @@ -1407,34 +2890,34 @@ "type": "Punctuator", "value": "<", "range": [ - 193, - 194 + 378, + 379 ], "loc": { "start": { - "line": 8, + "line": 18, "column": 0 }, "end": { - "line": 8, + "line": 18, "column": 1 } } }, { - "type": "HTMLIdentifier", - "value": "button", + "type": "Identifier", + "value": "Button", "range": [ - 194, - 200 + 379, + 385 ], "loc": { "start": { - "line": 8, + "line": 18, "column": 1 }, "end": { - "line": 8, + "line": 18, "column": 7 } } @@ -1443,233 +2926,215 @@ "type": "Punctuator", "value": "{", "range": [ - 201, - 202 + 386, + 387 ], "loc": { "start": { - "line": 8, + "line": 18, "column": 8 }, "end": { - "line": 8, + "line": 18, "column": 9 } } }, { - "type": "Punctuator", - "value": "...", + "type": "MustacheKeyword", + "value": "@attach", "range": [ - 202, - 205 + 387, + 394 ], "loc": { "start": { - "line": 8, + "line": 18, "column": 9 }, "end": { - "line": 8, - "column": 12 + "line": 18, + "column": 16 } } }, { "type": "Identifier", - "value": "props", - "range": [ - 205, - 210 - ], - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": "}", + "value": "tooltip", "range": [ - 210, - 211 + 395, + 402 ], "loc": { "start": { - "line": 8, + "line": 18, "column": 17 }, "end": { - "line": 8, - "column": 18 + "line": 18, + "column": 24 } } }, { "type": "Punctuator", - "value": ">", + "value": "(", "range": [ - 211, - 212 + 402, + 403 ], "loc": { "start": { - "line": 8, - "column": 18 + "line": 18, + "column": 24 }, "end": { - "line": 8, - "column": 19 + "line": 18, + "column": 25 } } }, { - "type": "HTMLText", - "value": "\n\t", + "type": "Identifier", + "value": "content", "range": [ - 212, - 214 + 403, + 410 ], "loc": { "start": { - "line": 8, - "column": 19 + "line": 18, + "column": 25 }, "end": { - "line": 9, - "column": 1 + "line": 18, + "column": 32 } } }, { "type": "Punctuator", - "value": "{", + "value": ")", "range": [ - 214, - 215 + 410, + 411 ], "loc": { "start": { - "line": 9, - "column": 1 + "line": 18, + "column": 32 }, "end": { - "line": 9, - "column": 2 + "line": 18, + "column": 33 } } }, { - "type": "MustacheKeyword", - "value": "@render", + "type": "Punctuator", + "value": "}", "range": [ - 215, - 222 + 411, + 412 ], "loc": { "start": { - "line": 9, - "column": 2 + "line": 18, + "column": 33 }, "end": { - "line": 9, - "column": 9 + "line": 18, + "column": 34 } } }, { - "type": "Identifier", - "value": "children", + "type": "Punctuator", + "value": ">", "range": [ - 223, - 231 + 412, + 413 ], "loc": { "start": { - "line": 9, - "column": 10 + "line": 18, + "column": 34 }, "end": { - "line": 9, - "column": 18 + "line": 18, + "column": 35 } } }, { - "type": "Punctuator", - "value": "?.", + "type": "HTMLText", + "value": "\n\t", "range": [ - 231, - 233 + 413, + 415 ], "loc": { "start": { - "line": 9, - "column": 18 + "line": 18, + "column": 35 }, "end": { - "line": 9, - "column": 20 + "line": 19, + "column": 1 } } }, { - "type": "Punctuator", - "value": "(", + "type": "HTMLText", + "value": "Hover", "range": [ - 233, - 234 + 415, + 420 ], "loc": { "start": { - "line": 9, - "column": 20 + "line": 19, + "column": 1 }, "end": { - "line": 9, - "column": 21 + "line": 19, + "column": 6 } } }, { - "type": "Punctuator", - "value": ")", + "type": "HTMLText", + "value": " ", "range": [ - 234, - 235 + 420, + 421 ], "loc": { "start": { - "line": 9, - "column": 21 + "line": 19, + "column": 6 }, "end": { - "line": 9, - "column": 22 + "line": 19, + "column": 7 } } }, { - "type": "Punctuator", - "value": "}", + "type": "HTMLText", + "value": "me", "range": [ - 235, - 236 + 421, + 423 ], "loc": { "start": { - "line": 9, - "column": 22 + "line": 19, + "column": 7 }, "end": { - "line": 9, - "column": 23 + "line": 19, + "column": 9 } } }, @@ -1677,16 +3142,16 @@ "type": "HTMLText", "value": "\n", "range": [ - 236, - 237 + 423, + 424 ], "loc": { "start": { - "line": 9, - "column": 23 + "line": 19, + "column": 9 }, "end": { - "line": 10, + "line": 20, "column": 0 } } @@ -1695,16 +3160,16 @@ "type": "Punctuator", "value": "<", "range": [ - 237, - 238 + 424, + 425 ], "loc": { "start": { - "line": 10, + "line": 20, "column": 0 }, "end": { - "line": 10, + "line": 20, "column": 1 } } @@ -1713,34 +3178,34 @@ "type": "Punctuator", "value": "/", "range": [ - 238, - 239 + 425, + 426 ], "loc": { "start": { - "line": 10, + "line": 20, "column": 1 }, "end": { - "line": 10, + "line": 20, "column": 2 } } }, { "type": "HTMLIdentifier", - "value": "button", + "value": "Button", "range": [ - 239, - 245 + 426, + 432 ], "loc": { "start": { - "line": 10, + "line": 20, "column": 2 }, "end": { - "line": 10, + "line": 20, "column": 8 } } @@ -1749,16 +3214,16 @@ "type": "Punctuator", "value": ">", "range": [ - 245, - 246 + 432, + 433 ], "loc": { "start": { - "line": 10, + "line": 20, "column": 8 }, "end": { - "line": 10, + "line": 20, "column": 9 } } @@ -1766,7 +3231,7 @@ ], "range": [ 0, - 246 + 433 ], "loc": { "start": { @@ -1774,7 +3239,7 @@ "column": 0 }, "end": { - "line": 10, + "line": 20, "column": 9 } } diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json b/tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json deleted file mode 100644 index 402c7fc4..00000000 --- a/tests/fixtures/parser/ast/svelte5/attach04-ts-prefer-const-result.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "ruleId": "prefer-const", - "code": "children", - "line": 4, - "column": 8 - }, - { - "ruleId": "prefer-const", - "code": "props", - "line": 4, - "column": 21 - } -] \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json index e2d18b10..12e1396d 100644 --- a/tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json +++ b/tests/fixtures/parser/ast/svelte5/attach04-ts-scope-output.json @@ -23,41 +23,23 @@ "name": "$state", "identifiers": [], "defs": [], - "references": [] - }, - { - "name": "$derived", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$effect", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$props", - "identifiers": [], - "defs": [], "references": [ { "identifier": { "type": "Identifier", - "name": "$props", + "name": "$state", "range": [ - 134, - 140 + 160, + 166 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 6, + "column": 15 }, "end": { - "line": 4, - "column": 58 + "line": 6, + "column": 21 } } }, @@ -67,6 +49,24 @@ } ] }, + { + "name": "$derived", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$effect", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "$props", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "$bindable", "identifiers": [], @@ -92,23 +92,23 @@ "type": "module", "variables": [ { - "name": "HTMLButtonAttributes", + "name": "tippy", "identifiers": [ { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "tippy", "range": [ - 34, - 54 + 27, + 32 ], "loc": { "start": { "line": 2, - "column": 15 + "column": 8 }, "end": { "line": 2, - "column": 35 + "column": 13 } } } @@ -118,73 +118,54 @@ "type": "ImportBinding", "name": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "tippy", "range": [ - 34, - 54 + 27, + 32 ], "loc": { "start": { "line": 2, - "column": 15 + "column": 8 }, "end": { "line": 2, - "column": 35 + "column": 13 } } }, "node": { - "type": "ImportSpecifier", - "importKind": "value", - "imported": { - "type": "Identifier", - "name": "HTMLButtonAttributes", - "range": [ - 34, - 54 - ], - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 35 - } - } - }, + "type": "ImportDefaultSpecifier", "local": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "tippy", "range": [ - 34, - 54 + 27, + 32 ], "loc": { "start": { "line": 2, - "column": 15 + "column": 8 }, "end": { "line": 2, - "column": 35 + "column": 13 } } }, "range": [ - 34, - 54 + 27, + 32 ], "loc": { "start": { "line": 2, - "column": 15 + "column": 8 }, "end": { "line": 2, - "column": 35 + "column": 13 } } } @@ -194,39 +175,39 @@ { "identifier": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "tippy", "range": [ - 111, - 131 + 271, + 276 ], "loc": { "start": { - "line": 4, - "column": 29 + "line": 10, + "column": 19 }, "end": { - "line": 4, - "column": 49 + "line": 10, + "column": 24 } } }, - "from": "module", + "from": "function", "init": null, "resolved": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "tippy", "range": [ - 34, - 54 + 27, + 32 ], "loc": { "start": { "line": 2, - "column": 15 + "column": 8 }, "end": { "line": 2, - "column": 35 + "column": 13 } } } @@ -234,263 +215,80 @@ ] }, { - "name": "children", + "name": "Button", "identifiers": [ { "type": "Identifier", - "name": "children", + "name": "Button", "range": [ - 89, - 97 + 58, + 64 ], "loc": { "start": { - "line": 4, - "column": 7 + "line": 3, + "column": 8 }, "end": { - "line": 4, - "column": 15 + "line": 3, + "column": 14 } } } ], "defs": [ { - "type": "Variable", + "type": "ImportBinding", "name": { "type": "Identifier", - "name": "children", + "name": "Button", "range": [ - 89, - 97 + 58, + 64 ], "loc": { "start": { - "line": 4, - "column": 7 + "line": 3, + "column": 8 }, "end": { - "line": 4, - "column": 15 + "line": 3, + "column": 14 } } }, "node": { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 102, - 107 - ], - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 25 - } - } - }, - "optional": false, - "range": [ - 99, - 107 - ], - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 25 - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeAnnotation", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "HTMLButtonAttributes", - "range": [ - 111, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, - "range": [ - 111, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, - "range": [ - 109, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, - "range": [ - 87, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [], - "callee": { - "type": "Identifier", - "name": "$props", - "range": [ - 134, - 140 - ], - "loc": { - "start": { - "line": 4, - "column": 52 - }, - "end": { - "line": 4, - "column": 58 - } - } - }, - "optional": false, + "type": "ImportDefaultSpecifier", + "local": { + "type": "Identifier", + "name": "Button", "range": [ - 134, - 142 + 58, + 64 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 3, + "column": 8 }, "end": { - "line": 4, - "column": 60 + "line": 3, + "column": 14 } } }, "range": [ - 87, - 142 + 58, + 64 ], "loc": { "start": { - "line": 4, - "column": 5 + "line": 3, + "column": 8 }, "end": { - "line": 4, - "column": 60 + "line": 3, + "column": 14 } } } @@ -500,59 +298,19 @@ { "identifier": { "type": "Identifier", - "name": "children", + "name": "Button", "range": [ - 89, - 97 + 379, + 385 ], "loc": { "start": { - "line": 4, - "column": 7 + "line": 18, + "column": 1 }, "end": { - "line": 4, - "column": 15 - } - } - }, - "from": "module", - "init": true, - "resolved": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, + "line": 18, "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "children", - "range": [ - 223, - 231 - ], - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 18 } } }, @@ -560,19 +318,19 @@ "init": null, "resolved": { "type": "Identifier", - "name": "children", + "name": "Button", "range": [ - 89, - 97 + 58, + 64 ], "loc": { "start": { - "line": 4, - "column": 7 + "line": 3, + "column": 8 }, "end": { - "line": 4, - "column": 15 + "line": 3, + "column": 14 } } } @@ -580,19 +338,19 @@ ] }, { - "name": "props", + "name": "Attachment", "identifiers": [ { "type": "Identifier", - "name": "props", + "name": "Attachment", "range": [ - 102, - 107 + 104, + 114 ], "loc": { "start": { "line": 4, - "column": 20 + "column": 15 }, "end": { "line": 4, @@ -603,18 +361,18 @@ ], "defs": [ { - "type": "Variable", + "type": "ImportBinding", "name": { "type": "Identifier", - "name": "props", + "name": "Attachment", "range": [ - 102, - 107 + 104, + 114 ], "loc": { "start": { "line": 4, - "column": 20 + "column": 15 }, "end": { "line": 4, @@ -623,220 +381,236 @@ } }, "node": { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 - } - } + "type": "ImportSpecifier", + "importKind": "value", + "imported": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 102, - 107 - ], - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 25 - } - } - }, - "optional": false, - "range": [ - 99, - 107 - ], - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 25 - } - } + "end": { + "line": 4, + "column": 25 } + } + }, + "local": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 ], - "typeAnnotation": { - "type": "TSTypeAnnotation", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "HTMLButtonAttributes", - "range": [ - 111, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 49 - } - } - }, - "range": [ - 111, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 49 - } - } + "loc": { + "start": { + "line": 4, + "column": 15 }, - "range": [ - 109, - 131 - ], - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 49 - } + "end": { + "line": 4, + "column": 25 } + } + }, + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 }, + "end": { + "line": 6, + "column": 12 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "content", "range": [ - 87, - 131 + 150, + 157 ], "loc": { "start": { - "line": 4, + "line": 6, "column": 5 }, "end": { - "line": 4, - "column": 49 + "line": 6, + "column": 12 } } }, "init": { "type": "CallExpression", - "arguments": [], + "arguments": [ + { + "type": "Literal", + "raw": "'Hello!'", + "value": "Hello!", + "range": [ + 167, + 175 + ], + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 30 + } + } + } + ], "callee": { "type": "Identifier", - "name": "$props", + "name": "$state", "range": [ - 134, - 140 + 160, + 166 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 6, + "column": 15 }, "end": { - "line": 4, - "column": 58 + "line": 6, + "column": 21 } } }, "optional": false, "range": [ - 134, - 142 + 160, + 176 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 6, + "column": 15 }, "end": { - "line": 4, - "column": 60 + "line": 6, + "column": 31 } } }, "range": [ - 87, - 142 + 150, + 176 ], "loc": { "start": { - "line": 4, + "line": 6, "column": 5 }, "end": { - "line": 4, - "column": 60 + "line": 6, + "column": 31 } } } @@ -846,19 +620,19 @@ { "identifier": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 102, - 107 + 150, + 157 ], "loc": { "start": { - "line": 4, - "column": 20 + "line": 6, + "column": 5 }, "end": { - "line": 4, - "column": 25 + "line": 6, + "column": 12 } } }, @@ -866,19 +640,19 @@ "init": true, "resolved": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 102, - 107 + 150, + 157 ], "loc": { "start": { - "line": 4, - "column": 20 + "line": 6, + "column": 5 }, "end": { - "line": 4, - "column": 25 + "line": 6, + "column": 12 } } } @@ -886,19 +660,19 @@ { "identifier": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 205, - 210 + 365, + 372 ], "loc": { "start": { - "line": 8, - "column": 12 + "line": 16, + "column": 19 }, "end": { - "line": 8, - "column": 17 + "line": 16, + "column": 26 } } }, @@ -906,83 +680,670 @@ "init": null, "resolved": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 102, - 107 + 150, + 157 ], "loc": { "start": { - "line": 4, - "column": 20 + "line": 6, + "column": 5 }, "end": { - "line": 4, + "line": 6, + "column": 12 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 403, + 410 + ], + "loc": { + "start": { + "line": 18, "column": 25 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "range": [ + 150, + 157 + ], + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 12 } } } } ] - } - ], - "references": [ + }, { - "identifier": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 15 + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } } } - }, - "from": "module", - "init": true, - "resolved": { - "type": "Identifier", - "name": "children", - "range": [ - 89, - 97 - ], - "loc": { - "start": { - "line": 4, - "column": 7 + ], + "defs": [ + { + "type": "FunctionName", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } }, - "end": { - "line": 4, - "column": 15 + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "range": [ + 230, + 331 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 4 + } + } + } + ], + "range": [ + 226, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 213, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 180, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } } } - } - }, + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 395, + 402 + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + } + } + ] + } + ], + "references": [ { "identifier": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 102, - 107 + 150, + 157 ], "loc": { "start": { - "line": 4, - "column": 20 + "line": 6, + "column": 5 }, "end": { - "line": 4, - "column": 25 + "line": 6, + "column": 12 } } }, @@ -990,19 +1351,19 @@ "init": true, "resolved": { "type": "Identifier", - "name": "props", + "name": "content", "range": [ - 102, - 107 + 150, + 157 ], "loc": { "start": { - "line": 4, - "column": 20 + "line": 6, + "column": 5 }, "end": { - "line": 4, - "column": 25 + "line": 6, + "column": 12 } } } @@ -1010,19 +1371,19 @@ { "identifier": { "type": "Identifier", - "name": "$props", + "name": "$state", "range": [ - 134, - 140 + 160, + 166 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 6, + "column": 15 }, "end": { - "line": 4, - "column": 58 + "line": 6, + "column": 21 } } }, @@ -1033,19 +1394,19 @@ { "identifier": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "content", "range": [ - 111, - 131 + 365, + 372 ], "loc": { "start": { - "line": 4, - "column": 29 + "line": 16, + "column": 19 }, "end": { - "line": 4, - "column": 49 + "line": 16, + "column": 26 } } }, @@ -1053,19 +1414,19 @@ "init": null, "resolved": { "type": "Identifier", - "name": "HTMLButtonAttributes", + "name": "content", "range": [ - 34, - 54 + 150, + 157 ], "loc": { "start": { - "line": 2, - "column": 15 + "line": 6, + "column": 5 }, "end": { - "line": 2, - "column": 35 + "line": 6, + "column": 12 } } } @@ -1073,19 +1434,19 @@ { "identifier": { "type": "Identifier", - "name": "props", + "name": "tooltip", "range": [ - 205, - 210 + 395, + 402 ], "loc": { "start": { - "line": 8, - "column": 12 + "line": 18, + "column": 17 }, "end": { - "line": 8, - "column": 17 + "line": 18, + "column": 24 } } }, @@ -1093,19 +1454,19 @@ "init": null, "resolved": { "type": "Identifier", - "name": "props", + "name": "tooltip", "range": [ - 102, - 107 + 189, + 196 ], "loc": { "start": { - "line": 4, - "column": 20 + "line": 8, + "column": 10 }, "end": { - "line": 4, - "column": 25 + "line": 8, + "column": 17 } } } @@ -1113,19 +1474,19 @@ { "identifier": { "type": "Identifier", - "name": "children", + "name": "content", "range": [ - 223, - 231 + 403, + 410 ], "loc": { "start": { - "line": 9, - "column": 10 + "line": 18, + "column": 25 }, "end": { - "line": 9, - "column": 18 + "line": 18, + "column": 32 } } }, @@ -1133,42 +1494,1969 @@ "init": null, "resolved": { "type": "Identifier", - "name": "children", + "name": "content", "range": [ - 89, - 97 + 150, + 157 ], "loc": { "start": { - "line": 4, - "column": 7 + "line": 6, + "column": 5 }, "end": { - "line": 4, - "column": 15 + "line": 6, + "column": 12 } } } - } - ], - "childScopes": [], - "through": [ + }, { "identifier": { "type": "Identifier", - "name": "$props", + "name": "Button", + "range": [ + 379, + 385 + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "from": "module", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Button", "range": [ - 134, - 140 + 58, + 64 ], "loc": { "start": { - "line": 4, - "column": 52 + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 14 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "arguments", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "content", + "identifiers": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "node": { + "type": "FunctionDeclaration", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "range": [ + 230, + 331 + ], + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 4 + } + } + } + ], + "range": [ + 226, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 47 + }, + "end": { + "line": 13, + "column": 2 + } + } + }, + "expression": false, + "generator": false, + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 189, + 196 + ], + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 17 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 213, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "range": [ + 180, + 334 + ], + "loc": { + "start": { + "line": 8, + "column": 1 + }, + "end": { + "line": 13, + "column": 2 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + } + ], + "childScopes": [ + { + "type": "function", + "variables": [ + { + "name": "element", + "identifiers": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "defs": [ + { + "type": "Parameter", + "name": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + }, + "node": { + "type": "ArrowFunctionExpression", + "async": false, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "kind": "const", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + ], + "range": [ + 255, + 299 + ], + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 47 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "optional": false, + "property": { + "type": "Identifier", + "name": "destroy", + "range": [ + 318, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 310, + 325 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 25 + } + } + }, + "range": [ + 303, + 326 + ], + "loc": { + "start": { + "line": 11, + "column": 3 + }, + "end": { + "line": 11, + "column": 26 + } + } + } + ], + "range": [ + 250, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 12, + "column": 3 + } + } + }, + "expression": false, + "generator": false, + "id": null, + "params": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + ], + "range": [ + 237, + 330 + ], + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 12, + "column": 3 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + } + ] + }, + { + "name": "tooltip", + "identifiers": [ + { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + ], + "defs": [ + { + "type": "Variable", + "name": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "node": { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "arguments": [ + { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "kind": "init", + "computed": false, + "key": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "method": false, + "shorthand": true, + "value": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + } + ], + "range": [ + 286, + 297 + ], + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 45 + } + } + } + ], + "callee": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "optional": false, + "range": [ + 271, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 46 + } + } + }, + "range": [ + 261, + 298 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 46 + } + } + } + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + } + ] + } + ], + "references": [ + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + }, + "from": "function", + "init": true, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "element", + "range": [ + 277, + 284 + ], + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "element", + "range": [ + 238, + 245 + ], + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 17 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 310, + 317 + ], + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tooltip", + "range": [ + 261, + 268 + ], + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 16 + } + } + } + } + ], + "childScopes": [], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "content", + "range": [ + 288, + 295 + ], + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 43 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "content", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "typeAnnotation": { + "type": "TSStringKeyword", + "range": [ + 206, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 204, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 33 + } + } + }, + "range": [ + 197, + 212 + ], + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 33 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 215, + 225 + ], + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 46 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "Attachment", + "range": [ + 104, + 114 + ], + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 25 + } + } + } + }, + { + "identifier": { + "type": "Identifier", + "name": "tippy", + "range": [ + 271, + 276 + ], + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + } + }, + "from": "function", + "init": null, + "resolved": { + "type": "Identifier", + "name": "tippy", + "range": [ + 27, + 32 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + } + ] + } + ], + "through": [ + { + "identifier": { + "type": "Identifier", + "name": "$state", + "range": [ + 160, + 166 + ], + "loc": { + "start": { + "line": 6, + "column": 15 }, "end": { - "line": 4, - "column": 58 + "line": 6, + "column": 21 } } }, diff --git a/tests/fixtures/parser/ast/svelte5/attach05-input.svelte b/tests/fixtures/parser/ast/svelte5/attach05-input.svelte deleted file mode 100644 index b600aa6e..00000000 --- a/tests/fixtures/parser/ast/svelte5/attach05-input.svelte +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-output.json b/tests/fixtures/parser/ast/svelte5/attach05-output.json deleted file mode 100644 index 3e4e49ba..00000000 --- a/tests/fixtures/parser/ast/svelte5/attach05-output.json +++ /dev/null @@ -1,2829 +0,0 @@ -{ - "type": "Program", - "body": [ - { - "type": "SvelteScriptElement", - "name": { - "type": "SvelteName", - "name": "script", - "range": [ - 1, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "startTag": { - "type": "SvelteStartTag", - "attributes": [], - "selfClosing": false, - "range": [ - 0, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "body": [ - { - "type": "ImportDeclaration", - "source": { - "type": "Literal", - "raw": "'tippy.js'", - "value": "tippy.js", - "range": [ - 28, - 38 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 29 - } - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - ], - "range": [ - 10, - 39 - ], - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 30 - } - } - }, - { - "type": "ImportDeclaration", - "source": { - "type": "Literal", - "raw": "'./Button.svelte'", - "value": "./Button.svelte", - "range": [ - 60, - 77 - ], - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 37 - } - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "Button", - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - }, - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - } - ], - "range": [ - 41, - 78 - ], - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 38 - } - } - }, - { - "type": "VariableDeclaration", - "kind": "let", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Literal", - "raw": "'Hello!'", - "value": "Hello!", - "range": [ - 102, - 110 - ], - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 30 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "$state", - "range": [ - 95, - 101 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, - "optional": false, - "range": [ - 95, - 111 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 31 - } - } - }, - "range": [ - 85, - 111 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 31 - } - } - } - ], - "range": [ - 81, - 112 - ], - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 32 - } - } - }, - { - "type": "FunctionDeclaration", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ArrowFunctionExpression", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "VariableDeclaration", - "kind": "const", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - } - ], - "range": [ - 294, - 305 - ], - "loc": { - "start": { - "line": 13, - "column": 34 - }, - "end": { - "line": 13, - "column": 45 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 279, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 46 - } - } - }, - "range": [ - 269, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 46 - } - } - } - ], - "range": [ - 263, - 307 - ], - "loc": { - "start": { - "line": 13, - "column": 3 - }, - "end": { - "line": 13, - "column": 47 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "destroy", - "range": [ - 326, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 318, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 311, - 334 - ], - "loc": { - "start": { - "line": 14, - "column": 3 - }, - "end": { - "line": 14, - "column": 26 - } - } - } - ], - "range": [ - 258, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 22 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - "expression": false, - "generator": false, - "id": null, - "params": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - } - ], - "range": [ - 245, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - "range": [ - 238, - 339 - ], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 15, - "column": 4 - } - } - } - ], - "range": [ - 234, - 342 - ], - "loc": { - "start": { - "line": 11, - "column": 27 - }, - "end": { - "line": 16, - "column": 2 - } - } - }, - "expression": false, - "generator": false, - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - } - ], - "range": [ - 208, - 342 - ], - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 16, - "column": 2 - } - } - } - ], - "endTag": { - "type": "SvelteEndTag", - "range": [ - 343, - 352 - ], - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "range": [ - 0, - 352 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - { - "type": "SvelteText", - "value": "\n\n", - "range": [ - 352, - 354 - ], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 19, - "column": 0 - } - } - }, - { - "type": "SvelteElement", - "kind": "html", - "name": { - "type": "SvelteName", - "name": "input", - "range": [ - 355, - 360 - ], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "startTag": { - "type": "SvelteStartTag", - "attributes": [ - { - "type": "SvelteDirective", - "kind": "Binding", - "key": { - "type": "SvelteDirectiveKey", - "name": { - "type": "SvelteName", - "name": "value", - "range": [ - 366, - 371 - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "modifiers": [], - "range": [ - 361, - 371 - ], - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "expression": { - "type": "Identifier", - "name": "content", - "range": [ - 373, - 380 - ], - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "shorthand": false, - "range": [ - 361, - 381 - ], - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 27 - } - } - } - ], - "selfClosing": true, - "range": [ - 354, - 384 - ], - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "children": [], - "endTag": null, - "range": [ - 354, - 384 - ], - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - { - "type": "SvelteText", - "value": "\n\n", - "range": [ - 384, - 386 - ], - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 21, - "column": 0 - } - } - }, - { - "type": "SvelteElement", - "kind": "component", - "name": { - "type": "Identifier", - "name": "Button", - "range": [ - 387, - 393 - ], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "startTag": { - "type": "SvelteStartTag", - "attributes": [ - { - "type": "SvelteAttachTag", - "expression": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "content", - "range": [ - 411, - 418 - ], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 32 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 403, - 410 - ], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 403, - 419 - ], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, - "range": [ - 394, - 420 - ], - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 34 - } - } - } - ], - "selfClosing": false, - "range": [ - 386, - 421 - ], - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "children": [ - { - "type": "SvelteText", - "value": "\n\tHover me\n", - "range": [ - 421, - 432 - ], - "loc": { - "start": { - "line": 21, - "column": 35 - }, - "end": { - "line": 23, - "column": 0 - } - } - } - ], - "endTag": { - "type": "SvelteEndTag", - "range": [ - 432, - 441 - ], - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 9 - } - } - }, - "range": [ - 386, - 441 - ], - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 23, - "column": 9 - } - } - } - ], - "sourceType": "module", - "comments": [ - { - "type": "Block", - "value": "*\n\t * @param {string} content\n\t * @returns {import('svelte/attachments').Attachment}\n\t ", - "range": [ - 115, - 206 - ], - "loc": { - "start": { - "line": 7, - "column": 1 - }, - "end": { - "line": 10, - "column": 4 - } - } - } - ], - "tokens": [ - { - "type": "Punctuator", - "value": "<", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "script", - "range": [ - 1, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 10, - 16 - ], - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - { - "type": "Identifier", - "value": "from", - "range": [ - 23, - 27 - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - } - }, - { - "type": "String", - "value": "'tippy.js'", - "range": [ - 28, - 38 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 29 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 38, - 39 - ], - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - } - } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 41, - 47 - ], - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "Button", - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "from", - "range": [ - 55, - 59 - ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - } - }, - { - "type": "String", - "value": "'./Button.svelte'", - "range": [ - 60, - 77 - ], - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 37 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 77, - 78 - ], - "loc": { - "start": { - "line": 3, - "column": 37 - }, - "end": { - "line": 3, - "column": 38 - } - } - }, - { - "type": "Keyword", - "value": "let", - "range": [ - 81, - 84 - ], - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 4 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 93, - 94 - ], - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "$state", - "range": [ - 95, - 101 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 101, - 102 - ], - "loc": { - "start": { - "line": 5, - "column": 21 - }, - "end": { - "line": 5, - "column": 22 - } - } - }, - { - "type": "String", - "value": "'Hello!'", - "range": [ - 102, - 110 - ], - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 30 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 110, - 111 - ], - "loc": { - "start": { - "line": 5, - "column": 30 - }, - "end": { - "line": 5, - "column": 31 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 111, - 112 - ], - "loc": { - "start": { - "line": 5, - "column": 31 - }, - "end": { - "line": 5, - "column": 32 - } - } - }, - { - "type": "Keyword", - "value": "function", - "range": [ - 208, - 216 - ], - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 11, - "column": 9 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 224, - 225 - ], - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 18 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 232, - 233 - ], - "loc": { - "start": { - "line": 11, - "column": 25 - }, - "end": { - "line": 11, - "column": 26 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 234, - 235 - ], - "loc": { - "start": { - "line": 11, - "column": 27 - }, - "end": { - "line": 11, - "column": 28 - } - } - }, - { - "type": "Keyword", - "value": "return", - "range": [ - 238, - 244 - ], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 8 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 245, - 246 - ], - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 253, - 254 - ], - "loc": { - "start": { - "line": 12, - "column": 17 - }, - "end": { - "line": 12, - "column": 18 - } - } - }, - { - "type": "Punctuator", - "value": "=>", - "range": [ - 255, - 257 - ], - "loc": { - "start": { - "line": 12, - "column": 19 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 258, - 259 - ], - "loc": { - "start": { - "line": 12, - "column": 22 - }, - "end": { - "line": 12, - "column": 23 - } - } - }, - { - "type": "Keyword", - "value": "const", - "range": [ - 263, - 268 - ], - "loc": { - "start": { - "line": 13, - "column": 3 - }, - "end": { - "line": 13, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 277, - 278 - ], - "loc": { - "start": { - "line": 13, - "column": 17 - }, - "end": { - "line": 13, - "column": 18 - } - } - }, - { - "type": "Identifier", - "value": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 284, - 285 - ], - "loc": { - "start": { - "line": 13, - "column": 24 - }, - "end": { - "line": 13, - "column": 25 - } - } - }, - { - "type": "Identifier", - "value": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - { - "type": "Punctuator", - "value": ",", - "range": [ - 292, - 293 - ], - "loc": { - "start": { - "line": 13, - "column": 32 - }, - "end": { - "line": 13, - "column": 33 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 294, - 295 - ], - "loc": { - "start": { - "line": 13, - "column": 34 - }, - "end": { - "line": 13, - "column": 35 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 304, - 305 - ], - "loc": { - "start": { - "line": 13, - "column": 44 - }, - "end": { - "line": 13, - "column": 45 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 305, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 45 - }, - "end": { - "line": 13, - "column": 46 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 306, - 307 - ], - "loc": { - "start": { - "line": 13, - "column": 46 - }, - "end": { - "line": 13, - "column": 47 - } - } - }, - { - "type": "Keyword", - "value": "return", - "range": [ - 311, - 317 - ], - "loc": { - "start": { - "line": 14, - "column": 3 - }, - "end": { - "line": 14, - "column": 9 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": ".", - "range": [ - 325, - 326 - ], - "loc": { - "start": { - "line": 14, - "column": 17 - }, - "end": { - "line": 14, - "column": 18 - } - } - }, - { - "type": "Identifier", - "value": "destroy", - "range": [ - 326, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 333, - 334 - ], - "loc": { - "start": { - "line": 14, - "column": 25 - }, - "end": { - "line": 14, - "column": 26 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 337, - 338 - ], - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 338, - 339 - ], - "loc": { - "start": { - "line": 15, - "column": 3 - }, - "end": { - "line": 15, - "column": 4 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 341, - 342 - ], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 2 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 343, - 344 - ], - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 1 - } - } - }, - { - "type": "Punctuator", - "value": "/", - "range": [ - 344, - 345 - ], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "script", - "range": [ - 345, - 351 - ], - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 351, - 352 - ], - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - { - "type": "HTMLText", - "value": "\n\n", - "range": [ - 352, - 354 - ], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 19, - "column": 0 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 354, - 355 - ], - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "input", - "range": [ - 355, - 360 - ], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "bind", - "range": [ - 361, - 365 - ], - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - { - "type": "Punctuator", - "value": ":", - "range": [ - 365, - 366 - ], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "value", - "range": [ - 366, - 371 - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 371, - 372 - ], - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 372, - 373 - ], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 373, - 380 - ], - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 380, - 381 - ], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 27 - } - } - }, - { - "type": "Punctuator", - "value": "/", - "range": [ - 382, - 383 - ], - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 383, - 384 - ], - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - { - "type": "HTMLText", - "value": "\n\n", - "range": [ - 384, - 386 - ], - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 21, - "column": 0 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 386, - 387 - ], - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - } - }, - { - "type": "Identifier", - "value": "Button", - "range": [ - 387, - 393 - ], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 394, - 395 - ], - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 9 - } - } - }, - { - "type": "Punctuator", - "value": "@", - "range": [ - 395, - 396 - ], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 396, - 397 - ], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 397, - 398 - ], - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 398, - 399 - ], - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 13 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 399, - 400 - ], - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 400, - 401 - ], - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 401, - 402 - ], - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 403, - 410 - ], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 410, - 411 - ], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 411, - 418 - ], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 32 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 418, - 419 - ], - "loc": { - "start": { - "line": 21, - "column": 32 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 419, - 420 - ], - "loc": { - "start": { - "line": 21, - "column": 33 - }, - "end": { - "line": 21, - "column": 34 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 420, - 421 - ], - "loc": { - "start": { - "line": 21, - "column": 34 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - { - "type": "HTMLText", - "value": "\n\t", - "range": [ - 421, - 423 - ], - "loc": { - "start": { - "line": 21, - "column": 35 - }, - "end": { - "line": 22, - "column": 1 - } - } - }, - { - "type": "HTMLText", - "value": "Hover", - "range": [ - 423, - 428 - ], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - { - "type": "HTMLText", - "value": " ", - "range": [ - 428, - 429 - ], - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 7 - } - } - }, - { - "type": "HTMLText", - "value": "me", - "range": [ - 429, - 431 - ], - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - { - "type": "HTMLText", - "value": "\n", - "range": [ - 431, - 432 - ], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 23, - "column": 0 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 432, - 433 - ], - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 1 - } - } - }, - { - "type": "Punctuator", - "value": "/", - "range": [ - 433, - 434 - ], - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "Button", - "range": [ - 434, - 440 - ], - "loc": { - "start": { - "line": 23, - "column": 2 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 440, - 441 - ], - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 9 - } - } - } - ], - "range": [ - 0, - 441 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 23, - "column": 9 - } - } -} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-scope-output.json b/tests/fixtures/parser/ast/svelte5/attach05-scope-output.json deleted file mode 100644 index 2388f9ba..00000000 --- a/tests/fixtures/parser/ast/svelte5/attach05-scope-output.json +++ /dev/null @@ -1,2906 +0,0 @@ -{ - "type": "global", - "variables": [ - { - "name": "$$slots", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$$props", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$$restProps", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$state", - "identifiers": [], - "defs": [], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "$state", - "range": [ - 95, - 101 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, - "from": "module", - "init": null, - "resolved": null - } - ] - }, - { - "name": "$derived", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$effect", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$props", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$bindable", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$inspect", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "$host", - "identifiers": [], - "defs": [], - "references": [] - } - ], - "references": [], - "childScopes": [ - { - "type": "module", - "variables": [ - { - "name": "tippy", - "identifiers": [ - { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - ], - "defs": [ - { - "type": "ImportBinding", - "name": { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - "node": { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - } - ] - }, - { - "name": "Button", - "identifiers": [ - { - "type": "Identifier", - "name": "Button", - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - } - ], - "defs": [ - { - "type": "ImportBinding", - "name": { - "type": "Identifier", - "name": "Button", - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - }, - "node": { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "Button", - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - }, - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - } - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "Button", - "range": [ - 387, - 393 - ], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "Button", - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - } - } - ] - }, - { - "name": "content", - "identifiers": [ - { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - } - ], - "defs": [ - { - "type": "Variable", - "name": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - }, - "node": { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Literal", - "raw": "'Hello!'", - "value": "Hello!", - "range": [ - 102, - 110 - ], - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 30 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "$state", - "range": [ - 95, - 101 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, - "optional": false, - "range": [ - 95, - 111 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 31 - } - } - }, - "range": [ - 85, - 111 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 31 - } - } - } - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - }, - "from": "module", - "init": true, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 373, - 380 - ], - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 411, - 418 - ], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 32 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - } - } - ] - }, - { - "name": "tooltip", - "identifiers": [ - { - "type": "Identifier", - "name": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - } - ], - "defs": [ - { - "type": "FunctionName", - "name": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - }, - "node": { - "type": "FunctionDeclaration", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ArrowFunctionExpression", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "VariableDeclaration", - "kind": "const", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - } - ], - "range": [ - 294, - 305 - ], - "loc": { - "start": { - "line": 13, - "column": 34 - }, - "end": { - "line": 13, - "column": 45 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 279, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 46 - } - } - }, - "range": [ - 269, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 46 - } - } - } - ], - "range": [ - 263, - 307 - ], - "loc": { - "start": { - "line": 13, - "column": 3 - }, - "end": { - "line": 13, - "column": 47 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "destroy", - "range": [ - 326, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 318, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 311, - 334 - ], - "loc": { - "start": { - "line": 14, - "column": 3 - }, - "end": { - "line": 14, - "column": 26 - } - } - } - ], - "range": [ - 258, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 22 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - "expression": false, - "generator": false, - "id": null, - "params": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - } - ], - "range": [ - 245, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - "range": [ - 238, - 339 - ], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 15, - "column": 4 - } - } - } - ], - "range": [ - 234, - 342 - ], - "loc": { - "start": { - "line": 11, - "column": 27 - }, - "end": { - "line": 16, - "column": 2 - } - } - }, - "expression": false, - "generator": false, - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - } - ], - "range": [ - 208, - 342 - ], - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 16, - "column": 2 - } - } - } - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 403, - 410 - ], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - } - } - ] - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - }, - "from": "module", - "init": true, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "$state", - "range": [ - 95, - 101 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, - "from": "module", - "init": null, - "resolved": null - }, - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 373, - 380 - ], - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 403, - 410 - ], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 411, - 418 - ], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 32 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 85, - 92 - ], - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 12 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "Button", - "range": [ - 387, - 393 - ], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "from": "module", - "init": null, - "resolved": { - "type": "Identifier", - "name": "Button", - "range": [ - 48, - 54 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - } - } - ], - "childScopes": [ - { - "type": "function", - "variables": [ - { - "name": "arguments", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "content", - "identifiers": [ - { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - } - ], - "defs": [ - { - "type": "Parameter", - "name": { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - }, - "node": { - "type": "FunctionDeclaration", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ArrowFunctionExpression", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "VariableDeclaration", - "kind": "const", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - } - ], - "range": [ - 294, - 305 - ], - "loc": { - "start": { - "line": 13, - "column": 34 - }, - "end": { - "line": 13, - "column": 45 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 279, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 46 - } - } - }, - "range": [ - 269, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 46 - } - } - } - ], - "range": [ - 263, - 307 - ], - "loc": { - "start": { - "line": 13, - "column": 3 - }, - "end": { - "line": 13, - "column": 47 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "destroy", - "range": [ - 326, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 318, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 311, - 334 - ], - "loc": { - "start": { - "line": 14, - "column": 3 - }, - "end": { - "line": 14, - "column": 26 - } - } - } - ], - "range": [ - 258, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 22 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - "expression": false, - "generator": false, - "id": null, - "params": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - } - ], - "range": [ - 245, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - "range": [ - 238, - 339 - ], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 15, - "column": 4 - } - } - } - ], - "range": [ - 234, - 342 - ], - "loc": { - "start": { - "line": 11, - "column": 27 - }, - "end": { - "line": 16, - "column": 2 - } - } - }, - "expression": false, - "generator": false, - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 217, - 224 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - } - ], - "range": [ - 208, - 342 - ], - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 16, - "column": 2 - } - } - } - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - } - } - ] - } - ], - "references": [], - "childScopes": [ - { - "type": "function", - "variables": [ - { - "name": "element", - "identifiers": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - } - ], - "defs": [ - { - "type": "Parameter", - "name": { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - }, - "node": { - "type": "ArrowFunctionExpression", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "VariableDeclaration", - "kind": "const", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - } - ], - "range": [ - 294, - 305 - ], - "loc": { - "start": { - "line": 13, - "column": 34 - }, - "end": { - "line": 13, - "column": 45 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 279, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 46 - } - } - }, - "range": [ - 269, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 46 - } - } - } - ], - "range": [ - 263, - 307 - ], - "loc": { - "start": { - "line": 13, - "column": 3 - }, - "end": { - "line": 13, - "column": 47 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "destroy", - "range": [ - 326, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 318, - 333 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - "range": [ - 311, - 334 - ], - "loc": { - "start": { - "line": 14, - "column": 3 - }, - "end": { - "line": 14, - "column": 26 - } - } - } - ], - "range": [ - 258, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 22 - }, - "end": { - "line": 15, - "column": 3 - } - } - }, - "expression": false, - "generator": false, - "id": null, - "params": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - } - ], - "range": [ - 245, - 338 - ], - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 15, - "column": 3 - } - } - } - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - } - } - ] - }, - { - "name": "tooltip", - "identifiers": [ - { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - } - ], - "defs": [ - { - "type": "Variable", - "name": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "node": { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - } - ], - "range": [ - 294, - 305 - ], - "loc": { - "start": { - "line": 13, - "column": 34 - }, - "end": { - "line": 13, - "column": 45 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 279, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 46 - } - } - }, - "range": [ - 269, - 306 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 46 - } - } - } - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "from": "function", - "init": true, - "resolved": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - } - } - ] - } - ], - "references": [ - { - "identifier": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - }, - "from": "function", - "init": true, - "resolved": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "element", - "range": [ - 285, - 292 - ], - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "element", - "range": [ - 246, - 253 - ], - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 17 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 269, - 276 - ], - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 16 - } - } - } - } - ], - "childScopes": [], - "through": [ - { - "identifier": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - }, - { - "identifier": { - "type": "Identifier", - "name": "content", - "range": [ - 296, - 303 - ], - "loc": { - "start": { - "line": 13, - "column": 36 - }, - "end": { - "line": 13, - "column": 43 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "content", - "range": [ - 225, - 232 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - } - } - ] - } - ], - "through": [ - { - "identifier": { - "type": "Identifier", - "name": "tippy", - "range": [ - 279, - 284 - ], - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 24 - } - } - }, - "from": "function", - "init": null, - "resolved": { - "type": "Identifier", - "name": "tippy", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - } - ] - } - ], - "through": [ - { - "identifier": { - "type": "Identifier", - "name": "$state", - "range": [ - 95, - 101 - ], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, - "from": "module", - "init": null, - "resolved": null - } - ] - } - ], - "through": [] -} \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte b/tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte deleted file mode 100644 index 5c0cd4d3..00000000 --- a/tests/fixtures/parser/ast/svelte5/attach05-ts-input.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tests/fixtures/parser/ast/svelte5/attach05-ts-output.json b/tests/fixtures/parser/ast/svelte5/attach05-ts-output.json deleted file mode 100644 index 1d58a645..00000000 --- a/tests/fixtures/parser/ast/svelte5/attach05-ts-output.json +++ /dev/null @@ -1,3354 +0,0 @@ -{ - "type": "Program", - "body": [ - { - "type": "SvelteScriptElement", - "name": { - "type": "SvelteName", - "name": "script", - "range": [ - 1, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "startTag": { - "type": "SvelteStartTag", - "attributes": [ - { - "type": "SvelteAttribute", - "key": { - "type": "SvelteName", - "name": "lang", - "range": [ - 8, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "boolean": false, - "value": [ - { - "type": "SvelteLiteral", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "range": [ - 8, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "selfClosing": false, - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "body": [ - { - "type": "ImportDeclaration", - "importKind": "value", - "source": { - "type": "Literal", - "raw": "'tippy.js'", - "value": "tippy.js", - "range": [ - 38, - 48 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 29 - } - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "tippy", - "range": [ - 27, - 32 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - "range": [ - 27, - 32 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - ], - "range": [ - 20, - 49 - ], - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 30 - } - } - }, - { - "type": "ImportDeclaration", - "importKind": "value", - "source": { - "type": "Literal", - "raw": "'./Button.svelte'", - "value": "./Button.svelte", - "range": [ - 70, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 37 - } - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "Button", - "range": [ - 58, - 64 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - }, - "range": [ - 58, - 64 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - } - ], - "range": [ - 51, - 88 - ], - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 38 - } - } - }, - { - "type": "ImportDeclaration", - "importKind": "type", - "source": { - "type": "Literal", - "raw": "'svelte/attachments'", - "value": "svelte/attachments", - "range": [ - 122, - 142 - ], - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 53 - } - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "importKind": "value", - "imported": { - "type": "Identifier", - "name": "Attachment", - "range": [ - 104, - 114 - ], - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 25 - } - } - }, - "local": { - "type": "Identifier", - "name": "Attachment", - "range": [ - 104, - 114 - ], - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 25 - } - } - }, - "range": [ - 104, - 114 - ], - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 25 - } - } - } - ], - "range": [ - 90, - 143 - ], - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 54 - } - } - }, - { - "type": "VariableDeclaration", - "kind": "let", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "content", - "range": [ - 150, - 157 - ], - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 12 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Literal", - "raw": "'Hello!'", - "value": "Hello!", - "range": [ - 167, - 175 - ], - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 30 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "$state", - "range": [ - 160, - 166 - ], - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 21 - } - } - }, - "optional": false, - "range": [ - 160, - 176 - ], - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 31 - } - } - }, - "range": [ - 150, - 176 - ], - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 31 - } - } - } - ], - "range": [ - 146, - 177 - ], - "loc": { - "start": { - "line": 6, - "column": 1 - }, - "end": { - "line": 6, - "column": 32 - } - } - }, - { - "type": "FunctionDeclaration", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ArrowFunctionExpression", - "async": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "VariableDeclaration", - "kind": "const", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 261, - 268 - ], - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 16 - } - } - }, - "init": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 277, - 284 - ], - "loc": { - "start": { - "line": 10, - "column": 25 - }, - "end": { - "line": 10, - "column": 32 - } - } - }, - { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "kind": "init", - "computed": false, - "key": { - "type": "Identifier", - "name": "content", - "range": [ - 288, - 295 - ], - "loc": { - "start": { - "line": 10, - "column": 36 - }, - "end": { - "line": 10, - "column": 43 - } - } - }, - "method": false, - "shorthand": true, - "value": { - "type": "Identifier", - "name": "content", - "range": [ - 288, - 295 - ], - "loc": { - "start": { - "line": 10, - "column": 36 - }, - "end": { - "line": 10, - "column": 43 - } - } - }, - "range": [ - 288, - 295 - ], - "loc": { - "start": { - "line": 10, - "column": 36 - }, - "end": { - "line": 10, - "column": 43 - } - } - } - ], - "range": [ - 286, - 297 - ], - "loc": { - "start": { - "line": 10, - "column": 34 - }, - "end": { - "line": 10, - "column": 45 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tippy", - "range": [ - 271, - 276 - ], - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 271, - 298 - ], - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 46 - } - } - }, - "range": [ - 261, - 298 - ], - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 46 - } - } - } - ], - "range": [ - 255, - 299 - ], - "loc": { - "start": { - "line": 10, - "column": 3 - }, - "end": { - "line": 10, - "column": 47 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 310, - 317 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - }, - "optional": false, - "property": { - "type": "Identifier", - "name": "destroy", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - }, - "range": [ - 310, - 325 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 25 - } - } - }, - "range": [ - 303, - 326 - ], - "loc": { - "start": { - "line": 11, - "column": 3 - }, - "end": { - "line": 11, - "column": 26 - } - } - } - ], - "range": [ - 250, - 330 - ], - "loc": { - "start": { - "line": 9, - "column": 22 - }, - "end": { - "line": 12, - "column": 3 - } - } - }, - "expression": false, - "generator": false, - "id": null, - "params": [ - { - "type": "Identifier", - "name": "element", - "range": [ - 238, - 245 - ], - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 17 - } - } - } - ], - "range": [ - 237, - 330 - ], - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 12, - "column": 3 - } - } - }, - "range": [ - 230, - 331 - ], - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 12, - "column": 4 - } - } - } - ], - "range": [ - 226, - 334 - ], - "loc": { - "start": { - "line": 8, - "column": 47 - }, - "end": { - "line": 13, - "column": 2 - } - } - }, - "expression": false, - "generator": false, - "id": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 189, - 196 - ], - "loc": { - "start": { - "line": 8, - "column": 10 - }, - "end": { - "line": 8, - "column": 17 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "content", - "typeAnnotation": { - "type": "TSTypeAnnotation", - "typeAnnotation": { - "type": "TSStringKeyword", - "range": [ - 206, - 212 - ], - "loc": { - "start": { - "line": 8, - "column": 27 - }, - "end": { - "line": 8, - "column": 33 - } - } - }, - "range": [ - 204, - 212 - ], - "loc": { - "start": { - "line": 8, - "column": 25 - }, - "end": { - "line": 8, - "column": 33 - } - } - }, - "range": [ - 197, - 212 - ], - "loc": { - "start": { - "line": 8, - "column": 18 - }, - "end": { - "line": 8, - "column": 33 - } - } - } - ], - "returnType": { - "type": "TSTypeAnnotation", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Attachment", - "range": [ - 215, - 225 - ], - "loc": { - "start": { - "line": 8, - "column": 36 - }, - "end": { - "line": 8, - "column": 46 - } - } - }, - "range": [ - 215, - 225 - ], - "loc": { - "start": { - "line": 8, - "column": 36 - }, - "end": { - "line": 8, - "column": 46 - } - } - }, - "range": [ - 213, - 225 - ], - "loc": { - "start": { - "line": 8, - "column": 34 - }, - "end": { - "line": 8, - "column": 46 - } - } - }, - "range": [ - 180, - 334 - ], - "loc": { - "start": { - "line": 8, - "column": 1 - }, - "end": { - "line": 13, - "column": 2 - } - } - } - ], - "endTag": { - "type": "SvelteEndTag", - "range": [ - 335, - 344 - ], - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 9 - } - } - }, - "range": [ - 0, - 344 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 14, - "column": 9 - } - } - }, - { - "type": "SvelteText", - "value": "\n\n", - "range": [ - 344, - 346 - ], - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 16, - "column": 0 - } - } - }, - { - "type": "SvelteElement", - "kind": "html", - "name": { - "type": "SvelteName", - "name": "input", - "range": [ - 347, - 352 - ], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 6 - } - } - }, - "startTag": { - "type": "SvelteStartTag", - "attributes": [ - { - "type": "SvelteDirective", - "kind": "Binding", - "key": { - "type": "SvelteDirectiveKey", - "name": { - "type": "SvelteName", - "name": "value", - "range": [ - 358, - 363 - ], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 17 - } - } - }, - "modifiers": [], - "range": [ - 353, - 363 - ], - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 17 - } - } - }, - "expression": { - "type": "Identifier", - "name": "content", - "range": [ - 365, - 372 - ], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - "shorthand": false, - "range": [ - 353, - 373 - ], - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 27 - } - } - } - ], - "selfClosing": true, - "range": [ - 346, - 376 - ], - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "children": [], - "endTag": null, - "range": [ - 346, - 376 - ], - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - { - "type": "SvelteText", - "value": "\n\n", - "range": [ - 376, - 378 - ], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 18, - "column": 0 - } - } - }, - { - "type": "SvelteElement", - "kind": "component", - "name": { - "type": "Identifier", - "name": "Button", - "range": [ - 379, - 385 - ], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "startTag": { - "type": "SvelteStartTag", - "attributes": [ - { - "type": "SvelteAttachTag", - "expression": { - "type": "CallExpression", - "arguments": [ - { - "type": "Identifier", - "name": "content", - "range": [ - 403, - 410 - ], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 32 - } - } - } - ], - "callee": { - "type": "Identifier", - "name": "tooltip", - "range": [ - 395, - 402 - ], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "optional": false, - "range": [ - 395, - 411 - ], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "range": [ - 386, - 412 - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 34 - } - } - } - ], - "selfClosing": false, - "range": [ - 378, - 413 - ], - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "children": [ - { - "type": "SvelteText", - "value": "\n\tHover me\n", - "range": [ - 413, - 424 - ], - "loc": { - "start": { - "line": 18, - "column": 35 - }, - "end": { - "line": 20, - "column": 0 - } - } - } - ], - "endTag": { - "type": "SvelteEndTag", - "range": [ - 424, - 433 - ], - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - "range": [ - 378, - 433 - ], - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 20, - "column": 9 - } - } - } - ], - "sourceType": "module", - "comments": [], - "tokens": [ - { - "type": "Punctuator", - "value": "<", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "script", - "range": [ - 1, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "lang", - "range": [ - 8, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "Punctuator", - "value": "\"", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "HTMLText", - "value": "ts", - "range": [ - 14, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": "\"", - "range": [ - 16, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 20, - 26 - ], - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "tippy", - "range": [ - 27, - 32 - ], - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - { - "type": "Identifier", - "value": "from", - "range": [ - 33, - 37 - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - } - }, - { - "type": "String", - "value": "'tippy.js'", - "range": [ - 38, - 48 - ], - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 29 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 48, - 49 - ], - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - } - } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 51, - 57 - ], - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "Button", - "range": [ - 58, - 64 - ], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "from", - "range": [ - 65, - 69 - ], - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - } - }, - { - "type": "String", - "value": "'./Button.svelte'", - "range": [ - 70, - 87 - ], - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 37 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 87, - 88 - ], - "loc": { - "start": { - "line": 3, - "column": 37 - }, - "end": { - "line": 3, - "column": 38 - } - } - }, - { - "type": "Keyword", - "value": "import", - "range": [ - 90, - 96 - ], - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 7 - } - } - }, - { - "type": "Identifier", - "value": "type", - "range": [ - 97, - 101 - ], - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 12 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 102, - 103 - ], - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "Attachment", - "range": [ - 104, - 114 - ], - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 25 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 115, - 116 - ], - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 27 - } - } - }, - { - "type": "Identifier", - "value": "from", - "range": [ - 117, - 121 - ], - "loc": { - "start": { - "line": 4, - "column": 28 - }, - "end": { - "line": 4, - "column": 32 - } - } - }, - { - "type": "String", - "value": "'svelte/attachments'", - "range": [ - 122, - 142 - ], - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 53 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 142, - 143 - ], - "loc": { - "start": { - "line": 4, - "column": 53 - }, - "end": { - "line": 4, - "column": 54 - } - } - }, - { - "type": "Keyword", - "value": "let", - "range": [ - 146, - 149 - ], - "loc": { - "start": { - "line": 6, - "column": 1 - }, - "end": { - "line": 6, - "column": 4 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 150, - 157 - ], - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 12 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 158, - 159 - ], - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "$state", - "range": [ - 160, - 166 - ], - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 21 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 166, - 167 - ], - "loc": { - "start": { - "line": 6, - "column": 21 - }, - "end": { - "line": 6, - "column": 22 - } - } - }, - { - "type": "String", - "value": "'Hello!'", - "range": [ - 167, - 175 - ], - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 30 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 175, - 176 - ], - "loc": { - "start": { - "line": 6, - "column": 30 - }, - "end": { - "line": 6, - "column": 31 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 176, - 177 - ], - "loc": { - "start": { - "line": 6, - "column": 31 - }, - "end": { - "line": 6, - "column": 32 - } - } - }, - { - "type": "Keyword", - "value": "function", - "range": [ - 180, - 188 - ], - "loc": { - "start": { - "line": 8, - "column": 1 - }, - "end": { - "line": 8, - "column": 9 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 189, - 196 - ], - "loc": { - "start": { - "line": 8, - "column": 10 - }, - "end": { - "line": 8, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 196, - 197 - ], - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 18 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 197, - 204 - ], - "loc": { - "start": { - "line": 8, - "column": 18 - }, - "end": { - "line": 8, - "column": 25 - } - } - }, - { - "type": "Punctuator", - "value": ":", - "range": [ - 204, - 205 - ], - "loc": { - "start": { - "line": 8, - "column": 25 - }, - "end": { - "line": 8, - "column": 26 - } - } - }, - { - "type": "Identifier", - "value": "string", - "range": [ - 206, - 212 - ], - "loc": { - "start": { - "line": 8, - "column": 27 - }, - "end": { - "line": 8, - "column": 33 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 212, - 213 - ], - "loc": { - "start": { - "line": 8, - "column": 33 - }, - "end": { - "line": 8, - "column": 34 - } - } - }, - { - "type": "Punctuator", - "value": ":", - "range": [ - 213, - 214 - ], - "loc": { - "start": { - "line": 8, - "column": 34 - }, - "end": { - "line": 8, - "column": 35 - } - } - }, - { - "type": "Identifier", - "value": "Attachment", - "range": [ - 215, - 225 - ], - "loc": { - "start": { - "line": 8, - "column": 36 - }, - "end": { - "line": 8, - "column": 46 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 226, - 227 - ], - "loc": { - "start": { - "line": 8, - "column": 47 - }, - "end": { - "line": 8, - "column": 48 - } - } - }, - { - "type": "Keyword", - "value": "return", - "range": [ - 230, - 236 - ], - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 8 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 237, - 238 - ], - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "element", - "range": [ - 238, - 245 - ], - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 245, - 246 - ], - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 18 - } - } - }, - { - "type": "Punctuator", - "value": "=>", - "range": [ - 247, - 249 - ], - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 21 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 250, - 251 - ], - "loc": { - "start": { - "line": 9, - "column": 22 - }, - "end": { - "line": 9, - "column": 23 - } - } - }, - { - "type": "Keyword", - "value": "const", - "range": [ - 255, - 260 - ], - "loc": { - "start": { - "line": 10, - "column": 3 - }, - "end": { - "line": 10, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 261, - 268 - ], - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 269, - 270 - ], - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 10, - "column": 18 - } - } - }, - { - "type": "Identifier", - "value": "tippy", - "range": [ - 271, - 276 - ], - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 24 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 276, - 277 - ], - "loc": { - "start": { - "line": 10, - "column": 24 - }, - "end": { - "line": 10, - "column": 25 - } - } - }, - { - "type": "Identifier", - "value": "element", - "range": [ - 277, - 284 - ], - "loc": { - "start": { - "line": 10, - "column": 25 - }, - "end": { - "line": 10, - "column": 32 - } - } - }, - { - "type": "Punctuator", - "value": ",", - "range": [ - 284, - 285 - ], - "loc": { - "start": { - "line": 10, - "column": 32 - }, - "end": { - "line": 10, - "column": 33 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 286, - 287 - ], - "loc": { - "start": { - "line": 10, - "column": 34 - }, - "end": { - "line": 10, - "column": 35 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 288, - 295 - ], - "loc": { - "start": { - "line": 10, - "column": 36 - }, - "end": { - "line": 10, - "column": 43 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 296, - 297 - ], - "loc": { - "start": { - "line": 10, - "column": 44 - }, - "end": { - "line": 10, - "column": 45 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 297, - 298 - ], - "loc": { - "start": { - "line": 10, - "column": 45 - }, - "end": { - "line": 10, - "column": 46 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 298, - 299 - ], - "loc": { - "start": { - "line": 10, - "column": 46 - }, - "end": { - "line": 10, - "column": 47 - } - } - }, - { - "type": "Keyword", - "value": "return", - "range": [ - 303, - 309 - ], - "loc": { - "start": { - "line": 11, - "column": 3 - }, - "end": { - "line": 11, - "column": 9 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 310, - 317 - ], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": ".", - "range": [ - 317, - 318 - ], - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 18 - } - } - }, - { - "type": "Identifier", - "value": "destroy", - "range": [ - 318, - 325 - ], - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 25 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 325, - 326 - ], - "loc": { - "start": { - "line": 11, - "column": 25 - }, - "end": { - "line": 11, - "column": 26 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 329, - 330 - ], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 3 - } - } - }, - { - "type": "Punctuator", - "value": ";", - "range": [ - 330, - 331 - ], - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 12, - "column": 4 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 333, - 334 - ], - "loc": { - "start": { - "line": 13, - "column": 1 - }, - "end": { - "line": 13, - "column": 2 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 335, - 336 - ], - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - } - } - }, - { - "type": "Punctuator", - "value": "/", - "range": [ - 336, - 337 - ], - "loc": { - "start": { - "line": 14, - "column": 1 - }, - "end": { - "line": 14, - "column": 2 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "script", - "range": [ - 337, - 343 - ], - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 8 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 343, - 344 - ], - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 9 - } - } - }, - { - "type": "HTMLText", - "value": "\n\n", - "range": [ - 344, - 346 - ], - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 16, - "column": 0 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 346, - 347 - ], - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "input", - "range": [ - 347, - 352 - ], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 6 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "bind", - "range": [ - 353, - 357 - ], - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 11 - } - } - }, - { - "type": "Punctuator", - "value": ":", - "range": [ - 357, - 358 - ], - "loc": { - "start": { - "line": 16, - "column": 11 - }, - "end": { - "line": 16, - "column": 12 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "value", - "range": [ - 358, - 363 - ], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 17 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 363, - 364 - ], - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 18 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 364, - 365 - ], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 19 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 365, - 372 - ], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 372, - 373 - ], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - { - "type": "Punctuator", - "value": "/", - "range": [ - 374, - 375 - ], - "loc": { - "start": { - "line": 16, - "column": 28 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 375, - 376 - ], - "loc": { - "start": { - "line": 16, - "column": 29 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - { - "type": "HTMLText", - "value": "\n\n", - "range": [ - 376, - 378 - ], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 18, - "column": 0 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 378, - 379 - ], - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 18, - "column": 1 - } - } - }, - { - "type": "Identifier", - "value": "Button", - "range": [ - 379, - 385 - ], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 386, - 387 - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - { - "type": "Punctuator", - "value": "@", - "range": [ - 387, - 388 - ], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 388, - 389 - ], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 389, - 390 - ], - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - { - "type": "Identifier", - "value": "t", - "range": [ - 390, - 391 - ], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 391, - 392 - ], - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "c", - "range": [ - 392, - 393 - ], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "Identifier", - "value": "h", - "range": [ - 393, - 394 - ], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - { - "type": "Identifier", - "value": "tooltip", - "range": [ - 395, - 402 - ], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - { - "type": "Punctuator", - "value": "(", - "range": [ - 402, - 403 - ], - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - { - "type": "Identifier", - "value": "content", - "range": [ - 403, - 410 - ], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 410, - 411 - ], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 411, - 412 - ], - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 412, - 413 - ], - "loc": { - "start": { - "line": 18, - "column": 34 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - { - "type": "HTMLText", - "value": "\n\t", - "range": [ - 413, - 415 - ], - "loc": { - "start": { - "line": 18, - "column": 35 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - { - "type": "HTMLText", - "value": "Hover", - "range": [ - 415, - 420 - ], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - { - "type": "HTMLText", - "value": " ", - "range": [ - 420, - 421 - ], - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - { - "type": "HTMLText", - "value": "me", - "range": [ - 421, - 423 - ], - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - { - "type": "HTMLText", - "value": "\n", - "range": [ - 423, - 424 - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 20, - "column": 0 - } - } - }, - { - "type": "Punctuator", - "value": "<", - "range": [ - 424, - 425 - ], - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 20, - "column": 1 - } - } - }, - { - "type": "Punctuator", - "value": "/", - "range": [ - 425, - 426 - ], - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - { - "type": "HTMLIdentifier", - "value": "Button", - "range": [ - 426, - 432 - ], - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - { - "type": "Punctuator", - "value": ">", - "range": [ - 432, - 433 - ], - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 9 - } - } - } - ], - "range": [ - 0, - 433 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 20, - "column": 9 - } - } -} \ No newline at end of file