diff --git a/.gitignore b/.gitignore index 052b68756..39e5add71 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ coverage.lcov test/sourcemaps/samples/*/output.js test/sourcemaps/samples/*/output.js.map _actual.* +_actual-v2.* _actual-bundle.* src/generators/dom/shared.ts package-lock.json diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index e1dbfcf6c..d2f4f8a70 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -295,19 +295,50 @@ function readAttribute(parser: Parser, uniqueNames: Set) { if (parser.eat(parser.v2 ? '{' : '{{')) { parser.allowWhitespace(); - parser.eat('...', true, 'Expected spread operator (...)'); - const expression = readExpression(parser); + const spread = parser.eat('...'); - parser.allowWhitespace(); - parser.eat(parser.v2 ? '}' : '}}', true); + if (parser.eat('...')) { + const expression = readExpression(parser); - return { - start, - end: parser.index, - type: 'Spread', - expression - }; + parser.allowWhitespace(); + parser.eat(parser.v2 ? '}' : '}}', true); + + return { + start, + end: parser.index, + type: 'Spread', + expression + }; + } else { + if (!parser.v2) { + parser.error('Expected spread operator (...)'); + } + + const valueStart = parser.index; + + const name = parser.readIdentifier(); + parser.allowWhitespace(); + parser.eat('}', true); + + return { + start, + end: parser.index, + type: 'Attribute', + name, + value: [{ + start: valueStart, + end: valueStart + name.length, + type: 'AttributeShorthand', + expression: { + start: valueStart, + end: valueStart + name.length, + type: 'Identifier', + name + } + }] + }; + } } let name = parser.readUntil(/(\s|=|\/|>)/); diff --git a/test/parser/samples/action-with-call/_actual-v2.json b/test/parser/samples/action-with-call/_actual-v2.json deleted file mode 100644 index b7bc908e2..000000000 --- a/test/parser/samples/action-with-call/_actual-v2.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "hash": "1eefngx", - "html": { - "start": 0, - "end": 38, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 38, - "type": "Element", - "name": "input", - "attributes": [ - { - "start": 7, - "end": 37, - "type": "Action", - "name": "tooltip", - "expression": { - "type": "CallExpression", - "start": 20, - "end": 36, - "callee": { - "type": "Identifier", - "start": 20, - "end": 21, - "name": "t" - }, - "arguments": [ - { - "type": "Literal", - "start": 22, - "end": 35, - "value": "tooltip msg", - "raw": "'tooltip msg'" - } - ] - } - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/action-with-identifier/_actual-v2.json b/test/parser/samples/action-with-identifier/_actual-v2.json deleted file mode 100644 index 6c6daa34b..000000000 --- a/test/parser/samples/action-with-identifier/_actual-v2.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "hash": "1vce0rr", - "html": { - "start": 0, - "end": 29, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 29, - "type": "Element", - "name": "input", - "attributes": [ - { - "start": 7, - "end": 28, - "type": "Action", - "name": "tooltip", - "expression": { - "type": "Identifier", - "start": 20, - "end": 27, - "name": "message" - } - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/action-with-literal/_actual-v2.json b/test/parser/samples/action-with-literal/_actual-v2.json deleted file mode 100644 index 472b5a306..000000000 --- a/test/parser/samples/action-with-literal/_actual-v2.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "hash": "1pm9eh0", - "html": { - "start": 0, - "end": 35, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 35, - "type": "Element", - "name": "input", - "attributes": [ - { - "start": 7, - "end": 34, - "type": "Action", - "name": "tooltip", - "expression": { - "type": "Literal", - "start": 20, - "end": 33, - "value": "tooltip msg", - "raw": "'tooltip msg'" - } - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/action/_actual-v2.json b/test/parser/samples/action/_actual-v2.json deleted file mode 100644 index 0746bd601..000000000 --- a/test/parser/samples/action/_actual-v2.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "hash": "1e3ix5", - "html": { - "start": 0, - "end": 21, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 21, - "type": "Element", - "name": "input", - "attributes": [ - { - "start": 7, - "end": 20, - "type": "Action", - "name": "autofocus", - "expression": null - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-dynamic-boolean/_actual-v2.json b/test/parser/samples/attribute-dynamic-boolean/_actual-v2.json deleted file mode 100644 index 4d08df34a..000000000 --- a/test/parser/samples/attribute-dynamic-boolean/_actual-v2.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "hash": "7xolfv", - "html": { - "start": 0, - "end": 41, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 41, - "type": "Element", - "name": "textarea", - "attributes": [ - { - "start": 10, - "end": 29, - "type": "Attribute", - "name": "readonly", - "value": [ - { - "start": 19, - "end": 29, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 20, - "end": 28, - "name": "readonly" - } - } - ] - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-dynamic-reserved/_actual-v2.json b/test/parser/samples/attribute-dynamic-reserved/_actual-v2.json deleted file mode 100644 index 4b6506b0c..000000000 --- a/test/parser/samples/attribute-dynamic-reserved/_actual-v2.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "hash": "l0cddf", - "html": { - "start": 0, - "end": 25, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 25, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 18, - "type": "Attribute", - "name": "class", - "value": [ - { - "start": 11, - "end": 18, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 12, - "end": 17, - "name": "class" - } - } - ] - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-dynamic/_actual-v2.json b/test/parser/samples/attribute-dynamic/_actual-v2.json deleted file mode 100644 index 7ccb40d31..000000000 --- a/test/parser/samples/attribute-dynamic/_actual-v2.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "hash": "ehtsx6", - "html": { - "start": 0, - "end": 42, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 42, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 28, - "type": "Attribute", - "name": "style", - "value": [ - { - "start": 12, - "end": 19, - "type": "Text", - "data": "color: " - }, - { - "start": 19, - "end": 26, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 20, - "end": 25, - "name": "color" - } - }, - { - "start": 26, - "end": 27, - "type": "Text", - "data": ";" - } - ] - } - ], - "children": [ - { - "start": 29, - "end": 36, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 30, - "end": 35, - "name": "color" - } - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-escaped/_actual-v2.json b/test/parser/samples/attribute-escaped/_actual-v2.json deleted file mode 100644 index d048a3d94..000000000 --- a/test/parser/samples/attribute-escaped/_actual-v2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "hash": "pv50w6", - "html": { - "start": 0, - "end": 41, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 41, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 34, - "type": "Attribute", - "name": "data-foo", - "value": [ - { - "start": 15, - "end": 33, - "type": "Text", - "data": "\"quoted\"" - } - ] - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-multiple/_actual-v2.json b/test/parser/samples/attribute-multiple/_actual-v2.json deleted file mode 100644 index b185127d5..000000000 --- a/test/parser/samples/attribute-multiple/_actual-v2.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "hash": "8dvm3u", - "html": { - "start": 0, - "end": 28, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 28, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 11, - "type": "Attribute", - "name": "id", - "value": [ - { - "start": 9, - "end": 10, - "type": "Text", - "data": "x" - } - ] - }, - { - "start": 12, - "end": 21, - "type": "Attribute", - "name": "class", - "value": [ - { - "start": 19, - "end": 20, - "type": "Text", - "data": "y" - } - ] - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-shorthand/_actual-v2.json b/test/parser/samples/attribute-shorthand/_actual-v2.json deleted file mode 100644 index 01b3ae38b..000000000 --- a/test/parser/samples/attribute-shorthand/_actual-v2.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "hash": "s7nwuc", - "html": { - "start": 0, - "end": 10, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 10, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 8, - "type": "Attribute", - "name": "id", - "value": [ - { - "type": "AttributeShorthand", - "start": 6, - "end": 8, - "expression": { - "type": "Identifier", - "start": 6, - "end": 8, - "name": "id" - } - } - ] - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-shorthand/input-v2.html b/test/parser/samples/attribute-shorthand/input-v2.html index e26deafb3..35468de00 100644 --- a/test/parser/samples/attribute-shorthand/input-v2.html +++ b/test/parser/samples/attribute-shorthand/input-v2.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/test/parser/samples/attribute-shorthand/output-v2.json b/test/parser/samples/attribute-shorthand/output-v2.json index b6578c13e..598356350 100644 --- a/test/parser/samples/attribute-shorthand/output-v2.json +++ b/test/parser/samples/attribute-shorthand/output-v2.json @@ -2,18 +2,18 @@ "hash": 1705925892, "html": { "start": 0, - "end": 10, + "end": 11, "type": "Fragment", "children": [ { "start": 0, - "end": 10, + "end": 11, "type": "Element", "name": "div", "attributes": [ { "start": 5, - "end": 8, + "end": 9, "type": "Attribute", "name": "id", "value": [ diff --git a/test/parser/samples/attribute-static-boolean/_actual-v2.json b/test/parser/samples/attribute-static-boolean/_actual-v2.json deleted file mode 100644 index a70a135f2..000000000 --- a/test/parser/samples/attribute-static-boolean/_actual-v2.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "hash": "a1b7fo", - "html": { - "start": 0, - "end": 30, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 30, - "type": "Element", - "name": "textarea", - "attributes": [ - { - "start": 10, - "end": 18, - "type": "Attribute", - "name": "readonly", - "value": true - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-static/_actual-v2.json b/test/parser/samples/attribute-static/_actual-v2.json deleted file mode 100644 index 28dc91df4..000000000 --- a/test/parser/samples/attribute-static/_actual-v2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "hash": "op11m5", - "html": { - "start": 0, - "end": 23, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 23, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 16, - "type": "Attribute", - "name": "class", - "value": [ - { - "start": 12, - "end": 15, - "type": "Text", - "data": "foo" - } - ] - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/attribute-unquoted/_actual-v2.json b/test/parser/samples/attribute-unquoted/_actual-v2.json deleted file mode 100644 index 583e8814d..000000000 --- a/test/parser/samples/attribute-unquoted/_actual-v2.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "hash": "1lozhxt", - "html": { - "start": 0, - "end": 21, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 21, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 14, - "type": "Attribute", - "name": "class", - "value": [ - { - "start": 11, - "end": 14, - "type": "Text", - "data": "foo" - } - ] - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/await-then-catch/_actual-v2.json b/test/parser/samples/await-then-catch/_actual-v2.json deleted file mode 100644 index 22ad4242e..000000000 --- a/test/parser/samples/await-then-catch/_actual-v2.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "hash": "1b28gs9", - "html": { - "start": 0, - "end": 148, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 148, - "type": "AwaitBlock", - "expression": { - "type": "Identifier", - "start": 8, - "end": 18, - "name": "thePromise" - }, - "value": "theValue", - "error": "theError", - "pending": { - "start": 19, - "end": 39, - "type": "PendingBlock", - "children": [ - { - "start": 19, - "end": 21, - "type": "Text", - "data": "\n\t" - }, - { - "start": 21, - "end": 38, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 24, - "end": 34, - "type": "Text", - "data": "loading..." - } - ] - }, - { - "start": 38, - "end": 39, - "type": "Text", - "data": "\n" - } - ] - }, - "then": { - "start": 39, - "end": 88, - "type": "ThenBlock", - "children": [ - { - "start": 55, - "end": 57, - "type": "Text", - "data": "\n\t" - }, - { - "start": 57, - "end": 87, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 60, - "end": 73, - "type": "Text", - "data": "the value is " - }, - { - "start": 73, - "end": 83, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 74, - "end": 82, - "name": "theValue" - } - } - ] - }, - { - "start": 87, - "end": 88, - "type": "Text", - "data": "\n" - } - ] - }, - "catch": { - "start": 88, - "end": 140, - "type": "CatchBlock", - "children": [ - { - "start": 105, - "end": 107, - "type": "Text", - "data": "\n\t" - }, - { - "start": 107, - "end": 139, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 110, - "end": 117, - "type": "Text", - "data": "oh no! " - }, - { - "start": 117, - "end": 135, - "type": "MustacheTag", - "expression": { - "type": "MemberExpression", - "start": 118, - "end": 134, - "object": { - "type": "Identifier", - "start": 118, - "end": 126, - "name": "theError" - }, - "property": { - "type": "Identifier", - "start": 127, - "end": 134, - "name": "message" - }, - "computed": false - } - } - ] - }, - { - "start": 139, - "end": 140, - "type": "Text", - "data": "\n" - } - ] - } - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/binding-shorthand/_actual-v2.json b/test/parser/samples/binding-shorthand/_actual-v2.json deleted file mode 100644 index de159d651..000000000 --- a/test/parser/samples/binding-shorthand/_actual-v2.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "hash": "1f31b7d", - "html": { - "start": 0, - "end": 18, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 18, - "type": "Element", - "name": "Widget", - "attributes": [ - { - "start": 8, - "end": 16, - "type": "Binding", - "name": "foo", - "value": { - "type": "Identifier", - "start": 13, - "end": 16, - "name": "foo" - } - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/binding/_actual-v2.json b/test/parser/samples/binding/_actual-v2.json deleted file mode 100644 index c124e9caf..000000000 --- a/test/parser/samples/binding/_actual-v2.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "hash": "w1d13d", - "html": { - "start": 0, - "end": 25, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 25, - "type": "Element", - "name": "input", - "attributes": [ - { - "start": 7, - "end": 24, - "type": "Binding", - "name": "value", - "value": { - "type": "Identifier", - "start": 19, - "end": 23, - "name": "name" - } - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/comment/_actual-v2.json b/test/parser/samples/comment/_actual-v2.json deleted file mode 100644 index 3dde7da39..000000000 --- a/test/parser/samples/comment/_actual-v2.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "hash": "1ihizni", - "html": { - "start": 0, - "end": 18, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 18, - "type": "Comment", - "data": " a comment " - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/component-dynamic/_actual-v2.json b/test/parser/samples/component-dynamic/_actual-v2.json deleted file mode 100644 index 6080a11e9..000000000 --- a/test/parser/samples/component-dynamic/_actual-v2.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "hash": "7yh2k2", - "html": { - "start": 0, - "end": 55, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 55, - "type": "Element", - "name": "svelte:component", - "attributes": [], - "children": [], - "expression": { - "type": "ConditionalExpression", - "start": 19, - "end": 34, - "test": { - "type": "Identifier", - "start": 19, - "end": 22, - "name": "foo" - }, - "consequent": { - "type": "Identifier", - "start": 25, - "end": 28, - "name": "Foo" - }, - "alternate": { - "type": "Identifier", - "start": 31, - "end": 34, - "name": "Bar" - } - } - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/convert-entities-in-element/_actual-v2.json b/test/parser/samples/convert-entities-in-element/_actual-v2.json deleted file mode 100644 index 4946333f3..000000000 --- a/test/parser/samples/convert-entities-in-element/_actual-v2.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "hash": "134kmw9", - "html": { - "start": 0, - "end": 24, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 24, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 3, - "end": 20, - "type": "Text", - "data": "Hello & World" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/convert-entities/_actual-v2.json b/test/parser/samples/convert-entities/_actual-v2.json deleted file mode 100644 index 2a2deedc9..000000000 --- a/test/parser/samples/convert-entities/_actual-v2.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "hash": "2lbrq0", - "html": { - "start": 0, - "end": 17, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 17, - "type": "Text", - "data": "Hello & World" - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/css-ref-selector/_actual-v2.json b/test/parser/samples/css-ref-selector/_actual-v2.json deleted file mode 100644 index 5edf24cd1..000000000 --- a/test/parser/samples/css-ref-selector/_actual-v2.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "hash": "i9aush", - "html": { - "start": 0, - "end": 14, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 14, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 12, - "type": "Ref", - "name": "foo" - } - ], - "children": [] - }, - { - "start": 14, - "end": 16, - "type": "Text", - "data": "\n\n" - } - ] - }, - "css": { - "start": 16, - "end": 60, - "attributes": [], - "children": [ - { - "type": "Rule", - "selector": { - "type": "SelectorList", - "children": [ - { - "type": "Selector", - "children": [ - { - "type": "RefSelector", - "start": 25, - "end": 32, - "name": "foo" - } - ], - "start": 25, - "end": 32 - } - ], - "start": 25, - "end": 32 - }, - "block": { - "type": "Block", - "children": [ - { - "type": "Declaration", - "important": false, - "property": "color", - "value": { - "type": "Value", - "children": [ - { - "type": "Identifier", - "name": "red", - "start": 44, - "end": 47 - } - ], - "start": 43, - "end": 47 - }, - "start": 37, - "end": 47 - } - ], - "start": 33, - "end": 51 - }, - "start": 25, - "end": 51 - } - ], - "content": { - "start": 23, - "end": 52, - "styles": "\n\tref:foo {\n\t\tcolor: red;\n\t}\n" - } - }, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/css/_actual-v2.json b/test/parser/samples/css/_actual-v2.json deleted file mode 100644 index 316e6e72a..000000000 --- a/test/parser/samples/css/_actual-v2.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "hash": "iz4x8b", - "html": { - "start": 0, - "end": 14, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 14, - "type": "Element", - "name": "div", - "attributes": [], - "children": [ - { - "start": 5, - "end": 8, - "type": "Text", - "data": "foo" - } - ] - }, - { - "start": 14, - "end": 16, - "type": "Text", - "data": "\n\n" - } - ] - }, - "css": { - "start": 16, - "end": 56, - "attributes": [], - "children": [ - { - "type": "Rule", - "selector": { - "type": "SelectorList", - "children": [ - { - "type": "Selector", - "children": [ - { - "type": "TypeSelector", - "name": "div", - "start": 25, - "end": 28 - } - ], - "start": 25, - "end": 28 - } - ], - "start": 25, - "end": 28 - }, - "block": { - "type": "Block", - "children": [ - { - "type": "Declaration", - "important": false, - "property": "color", - "value": { - "type": "Value", - "children": [ - { - "type": "Identifier", - "name": "red", - "start": 40, - "end": 43 - } - ], - "start": 39, - "end": 43 - }, - "start": 33, - "end": 43 - } - ], - "start": 29, - "end": 47 - }, - "start": 25, - "end": 47 - } - ], - "content": { - "start": 23, - "end": 48, - "styles": "\n\tdiv {\n\t\tcolor: red;\n\t}\n" - } - }, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/dynamic-import/_actual-v2.json b/test/parser/samples/dynamic-import/_actual-v2.json deleted file mode 100644 index 5a1b7b068..000000000 --- a/test/parser/samples/dynamic-import/_actual-v2.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "hash": "uvuf1h", - "html": { - "start": null, - "end": null, - "type": "Fragment", - "children": [] - }, - "css": null, - "js": { - "start": 0, - "end": 131, - "attributes": [], - "content": { - "type": "Program", - "start": 8, - "end": 122, - "body": [ - { - "type": "ExportDefaultDeclaration", - "start": 10, - "end": 121, - "declaration": { - "type": "ObjectExpression", - "start": 25, - "end": 121, - "properties": [ - { - "type": "Property", - "start": 29, - "end": 118, - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 29, - "end": 37, - "name": "oncreate" - }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 37, - "end": 118, - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 40, - "end": 118, - "body": [ - { - "type": "ExpressionStatement", - "start": 45, - "end": 114, - "expression": { - "type": "CallExpression", - "start": 45, - "end": 113, - "callee": { - "type": "MemberExpression", - "start": 45, - "end": 68, - "object": { - "type": "CallExpression", - "start": 45, - "end": 63, - "callee": { - "type": "Import", - "start": 45, - "end": 51 - }, - "arguments": [ - { - "type": "Literal", - "start": 52, - "end": 62, - "value": "./foo.js", - "raw": "'./foo.js'" - } - ] - }, - "property": { - "type": "Identifier", - "start": 64, - "end": 68, - "name": "then" - }, - "computed": false - }, - "arguments": [ - { - "type": "ArrowFunctionExpression", - "start": 69, - "end": 112, - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 69, - "end": 72, - "name": "foo" - } - ], - "body": { - "type": "BlockStatement", - "start": 76, - "end": 112, - "body": [ - { - "type": "ExpressionStatement", - "start": 82, - "end": 107, - "expression": { - "type": "CallExpression", - "start": 82, - "end": 106, - "callee": { - "type": "MemberExpression", - "start": 82, - "end": 93, - "object": { - "type": "Identifier", - "start": 82, - "end": 89, - "name": "console" - }, - "property": { - "type": "Identifier", - "start": 90, - "end": 93, - "name": "log" - }, - "computed": false - }, - "arguments": [ - { - "type": "MemberExpression", - "start": 94, - "end": 105, - "object": { - "type": "Identifier", - "start": 94, - "end": 97, - "name": "foo" - }, - "property": { - "type": "Identifier", - "start": 98, - "end": 105, - "name": "default" - }, - "computed": false - } - ] - } - } - ] - } - } - ] - } - } - ] - } - } - } - ] - } - } - ], - "sourceType": "module" - } - } -} \ No newline at end of file diff --git a/test/parser/samples/each-block-destructured/_actual-v2.json b/test/parser/samples/each-block-destructured/_actual-v2.json deleted file mode 100644 index 38d5ddc77..000000000 --- a/test/parser/samples/each-block-destructured/_actual-v2.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "hash": "gtdm5e", - "html": { - "start": 0, - "end": 62, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 62, - "type": "EachBlock", - "expression": { - "type": "Identifier", - "start": 7, - "end": 14, - "name": "animals" - }, - "children": [ - { - "start": 33, - "end": 54, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 36, - "end": 41, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 37, - "end": 40, - "name": "key" - } - }, - { - "start": 41, - "end": 43, - "type": "Text", - "data": ": " - }, - { - "start": 43, - "end": 50, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 44, - "end": 49, - "name": "value" - } - } - ] - } - ], - "destructuredContexts": [ - "key", - "value" - ], - "context": "key_value" - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/each-block-else/_actual-v2.json b/test/parser/samples/each-block-else/_actual-v2.json deleted file mode 100644 index 9f8c5da79..000000000 --- a/test/parser/samples/each-block-else/_actual-v2.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "hash": "ljl07n", - "html": { - "start": 0, - "end": 77, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 77, - "type": "EachBlock", - "expression": { - "type": "Identifier", - "start": 7, - "end": 14, - "name": "animals" - }, - "children": [ - { - "start": 27, - "end": 42, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 30, - "end": 38, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 31, - "end": 37, - "name": "animal" - } - } - ] - } - ], - "context": "animal", - "else": { - "start": 50, - "end": 70, - "type": "ElseBlock", - "children": [ - { - "start": 52, - "end": 69, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 55, - "end": 65, - "type": "Text", - "data": "no animals" - } - ] - } - ] - } - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/each-block-indexed/_actual-v2.json b/test/parser/samples/each-block-indexed/_actual-v2.json deleted file mode 100644 index 9ffa02aaa..000000000 --- a/test/parser/samples/each-block-indexed/_actual-v2.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "hash": "1143n2g", - "html": { - "start": 0, - "end": 58, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 58, - "type": "EachBlock", - "expression": { - "type": "Identifier", - "start": 7, - "end": 14, - "name": "animals" - }, - "children": [ - { - "start": 30, - "end": 50, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 33, - "end": 36, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 34, - "end": 35, - "name": "i" - } - }, - { - "start": 36, - "end": 38, - "type": "Text", - "data": ": " - }, - { - "start": 38, - "end": 46, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 39, - "end": 45, - "name": "animal" - } - } - ] - } - ], - "context": "animal", - "index": "i" - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/each-block-keyed/_actual-v2.json b/test/parser/samples/each-block-keyed/_actual-v2.json deleted file mode 100644 index 514682b77..000000000 --- a/test/parser/samples/each-block-keyed/_actual-v2.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "hash": "3sm0ec", - "html": { - "start": 0, - "end": 56, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 56, - "type": "EachBlock", - "expression": { - "type": "Identifier", - "start": 7, - "end": 12, - "name": "todos" - }, - "children": [ - { - "start": 35, - "end": 48, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 38, - "end": 44, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 39, - "end": 43, - "name": "todo" - } - } - ] - } - ], - "context": "todo", - "key": "id" - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/each-block/_actual-v2.json b/test/parser/samples/each-block/_actual-v2.json deleted file mode 100644 index 7df4a20eb..000000000 --- a/test/parser/samples/each-block/_actual-v2.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "hash": "mzeq0s", - "html": { - "start": 0, - "end": 50, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 50, - "type": "EachBlock", - "expression": { - "type": "Identifier", - "start": 7, - "end": 14, - "name": "animals" - }, - "children": [ - { - "start": 27, - "end": 42, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 30, - "end": 38, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 31, - "end": 37, - "name": "animal" - } - } - ] - } - ], - "context": "animal" - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/element-with-mustache/_actual-v2.json b/test/parser/samples/element-with-mustache/_actual-v2.json deleted file mode 100644 index a65459a20..000000000 --- a/test/parser/samples/element-with-mustache/_actual-v2.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "hash": "9fs56", - "html": { - "start": 0, - "end": 22, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 22, - "type": "Element", - "name": "h1", - "attributes": [], - "children": [ - { - "start": 4, - "end": 10, - "type": "Text", - "data": "hello " - }, - { - "start": 10, - "end": 16, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 11, - "end": 15, - "name": "name" - } - }, - { - "start": 16, - "end": 17, - "type": "Text", - "data": "!" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/element-with-text/_actual-v2.json b/test/parser/samples/element-with-text/_actual-v2.json deleted file mode 100644 index ee940e82e..000000000 --- a/test/parser/samples/element-with-text/_actual-v2.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "hash": "a3xqjm", - "html": { - "start": 0, - "end": 17, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 17, - "type": "Element", - "name": "span", - "attributes": [], - "children": [ - { - "start": 6, - "end": 10, - "type": "Text", - "data": "test" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/elements/_actual-v2.json b/test/parser/samples/elements/_actual-v2.json deleted file mode 100644 index 14de5ea00..000000000 --- a/test/parser/samples/elements/_actual-v2.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "hash": "dni3s5", - "html": { - "start": 0, - "end": 15, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 15, - "type": "Element", - "name": "!doctype", - "attributes": [ - { - "start": 10, - "end": 14, - "type": "Attribute", - "name": "html", - "value": true - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/event-handler/_actual-v2.json b/test/parser/samples/event-handler/_actual-v2.json deleted file mode 100644 index 0d98c325c..000000000 --- a/test/parser/samples/event-handler/_actual-v2.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "hash": "qi54it", - "html": { - "start": 0, - "end": 97, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 61, - "type": "Element", - "name": "button", - "attributes": [ - { - "start": 8, - "end": 45, - "type": "EventHandler", - "name": "click", - "expression": { - "type": "CallExpression", - "start": 18, - "end": 44, - "callee": { - "type": "Identifier", - "start": 18, - "end": 21, - "name": "set" - }, - "arguments": [ - { - "type": "ObjectExpression", - "start": 22, - "end": 43, - "properties": [ - { - "type": "Property", - "start": 24, - "end": 41, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 24, - "end": 31, - "name": "visible" - }, - "value": { - "type": "UnaryExpression", - "start": 33, - "end": 41, - "operator": "!", - "prefix": true, - "argument": { - "type": "Identifier", - "start": 34, - "end": 41, - "name": "visible" - } - }, - "kind": "init" - } - ] - } - ] - } - } - ], - "children": [ - { - "start": 46, - "end": 52, - "type": "Text", - "data": "toggle" - } - ] - }, - { - "start": 61, - "end": 63, - "type": "Text", - "data": "\n\n" - }, - { - "start": 63, - "end": 97, - "type": "IfBlock", - "expression": { - "type": "Identifier", - "start": 68, - "end": 75, - "name": "visible" - }, - "children": [ - { - "start": 78, - "end": 91, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 81, - "end": 87, - "type": "Text", - "data": "hello!" - } - ] - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/if-block-else/_actual-v2.json b/test/parser/samples/if-block-else/_actual-v2.json deleted file mode 100644 index b922778f7..000000000 --- a/test/parser/samples/if-block-else/_actual-v2.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "hash": "dbh411", - "html": { - "start": 0, - "end": 51, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 51, - "type": "IfBlock", - "expression": { - "type": "Identifier", - "start": 5, - "end": 8, - "name": "foo" - }, - "children": [ - { - "start": 11, - "end": 21, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 14, - "end": 17, - "type": "Text", - "data": "foo" - } - ] - } - ], - "else": { - "start": 29, - "end": 46, - "type": "ElseBlock", - "children": [ - { - "start": 31, - "end": 45, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 34, - "end": 41, - "type": "Text", - "data": "not foo" - } - ] - } - ] - } - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/if-block-elseif/_actual-v2.json b/test/parser/samples/if-block-elseif/_actual-v2.json deleted file mode 100644 index 758e3ee17..000000000 --- a/test/parser/samples/if-block-elseif/_actual-v2.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "hash": "tzpuwu", - "html": { - "start": 0, - "end": 88, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 88, - "type": "IfBlock", - "expression": { - "type": "BinaryExpression", - "start": 5, - "end": 11, - "left": { - "type": "Identifier", - "start": 5, - "end": 6, - "name": "x" - }, - "operator": ">", - "right": { - "type": "Literal", - "start": 9, - "end": 11, - "value": 10, - "raw": "10" - } - }, - "children": [ - { - "start": 14, - "end": 41, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 17, - "end": 37, - "type": "Text", - "data": "x is greater than 10" - } - ] - } - ], - "else": { - "start": 57, - "end": 83, - "type": "ElseBlock", - "children": [ - { - "start": 57, - "end": 88, - "type": "IfBlock", - "elseif": true, - "expression": { - "type": "BinaryExpression", - "start": 51, - "end": 56, - "left": { - "type": "Identifier", - "start": 51, - "end": 52, - "name": "x" - }, - "operator": "<", - "right": { - "type": "Literal", - "start": 55, - "end": 56, - "value": 5, - "raw": "5" - } - }, - "children": [ - { - "start": 59, - "end": 82, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 62, - "end": 78, - "type": "Text", - "data": "x is less than 5" - } - ] - } - ] - } - ] - } - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/if-block/_actual-v2.json b/test/parser/samples/if-block/_actual-v2.json deleted file mode 100644 index 25ac00f73..000000000 --- a/test/parser/samples/if-block/_actual-v2.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "hash": "w7ju0y", - "html": { - "start": 0, - "end": 17, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 17, - "type": "IfBlock", - "expression": { - "type": "Identifier", - "start": 5, - "end": 8, - "name": "foo" - }, - "children": [ - { - "start": 9, - "end": 12, - "type": "Text", - "data": "bar" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/implicitly-closed-li/_actual-v2.json b/test/parser/samples/implicitly-closed-li/_actual-v2.json deleted file mode 100644 index 883505ace..000000000 --- a/test/parser/samples/implicitly-closed-li/_actual-v2.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "hash": "232dvg", - "html": { - "start": 0, - "end": 31, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 31, - "type": "Element", - "name": "ul", - "attributes": [], - "children": [ - { - "start": 4, - "end": 6, - "type": "Text", - "data": "\n\t" - }, - { - "start": 6, - "end": 13, - "type": "Element", - "name": "li", - "attributes": [], - "children": [ - { - "start": 10, - "end": 13, - "type": "Text", - "data": "a\n\t" - } - ] - }, - { - "start": 13, - "end": 20, - "type": "Element", - "name": "li", - "attributes": [], - "children": [ - { - "start": 17, - "end": 20, - "type": "Text", - "data": "b\n\t" - } - ] - }, - { - "start": 20, - "end": 26, - "type": "Element", - "name": "li", - "attributes": [], - "children": [ - { - "start": 24, - "end": 26, - "type": "Text", - "data": "c\n" - } - ] - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/nbsp/_actual-v2.json b/test/parser/samples/nbsp/_actual-v2.json deleted file mode 100644 index 48f4643a9..000000000 --- a/test/parser/samples/nbsp/_actual-v2.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "hash": "1uypmr0", - "html": { - "start": 0, - "end": 19, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 19, - "type": "Element", - "name": "span", - "attributes": [], - "children": [ - { - "start": 6, - "end": 12, - "type": "Text", - "data": " " - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/raw-mustaches/_actual-v2.json b/test/parser/samples/raw-mustaches/_actual-v2.json deleted file mode 100644 index 983b40196..000000000 --- a/test/parser/samples/raw-mustaches/_actual-v2.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "hash": "9m9gjd", - "html": { - "start": 0, - "end": 34, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 34, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 3, - "end": 4, - "type": "Text", - "data": " " - }, - { - "start": 4, - "end": 16, - "type": "RawMustacheTag", - "expression": { - "type": "Identifier", - "start": 11, - "end": 15, - "name": "raw1" - } - }, - { - "start": 16, - "end": 17, - "type": "Text", - "data": " " - }, - { - "start": 17, - "end": 29, - "type": "RawMustacheTag", - "expression": { - "type": "Identifier", - "start": 24, - "end": 28, - "name": "raw2" - } - }, - { - "start": 29, - "end": 30, - "type": "Text", - "data": " " - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/refs/_actual-v2.json b/test/parser/samples/refs/_actual-v2.json deleted file mode 100644 index 72d1c864c..000000000 --- a/test/parser/samples/refs/_actual-v2.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "hash": "e2azib", - "html": { - "start": 0, - "end": 25, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 25, - "type": "Element", - "name": "canvas", - "attributes": [ - { - "start": 8, - "end": 15, - "type": "Ref", - "name": "foo" - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/script-comment-only/_actual-v2.json b/test/parser/samples/script-comment-only/_actual-v2.json deleted file mode 100644 index a1371cc31..000000000 --- a/test/parser/samples/script-comment-only/_actual-v2.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "hash": "1l2u88a", - "html": { - "start": 0, - "end": 11, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 11, - "type": "Element", - "name": "div", - "attributes": [], - "children": [] - }, - { - "start": 11, - "end": 13, - "type": "Text", - "data": "\n\n" - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/script-comment-trailing-multiline/_actual-v2.json b/test/parser/samples/script-comment-trailing-multiline/_actual-v2.json deleted file mode 100644 index 4517795aa..000000000 --- a/test/parser/samples/script-comment-trailing-multiline/_actual-v2.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "hash": "lvjec0", - "html": { - "start": 0, - "end": 22, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 22, - "type": "Element", - "name": "h1", - "attributes": [], - "children": [ - { - "start": 4, - "end": 10, - "type": "Text", - "data": "Hello " - }, - { - "start": 10, - "end": 16, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 11, - "end": 15, - "name": "name" - } - }, - { - "start": 16, - "end": 17, - "type": "Text", - "data": "!" - } - ] - }, - { - "start": 22, - "end": 24, - "type": "Text", - "data": "\n\n" - } - ] - }, - "css": null, - "js": { - "start": 24, - "end": 141, - "attributes": [], - "content": { - "type": "Program", - "start": 32, - "end": 132, - "body": [ - { - "type": "ExportDefaultDeclaration", - "start": 34, - "end": 93, - "declaration": { - "type": "ObjectExpression", - "start": 49, - "end": 92, - "properties": [ - { - "type": "Property", - "start": 53, - "end": 89, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 53, - "end": 57, - "name": "data" - }, - "value": { - "type": "ArrowFunctionExpression", - "start": 59, - "end": 89, - "id": null, - "generator": false, - "expression": true, - "async": false, - "params": [], - "body": { - "type": "ObjectExpression", - "start": 66, - "end": 88, - "properties": [ - { - "type": "Property", - "start": 71, - "end": 84, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 71, - "end": 75, - "name": "name" - }, - "value": { - "type": "Literal", - "start": 77, - "end": 84, - "value": "world", - "raw": "'world'" - }, - "kind": "init" - } - ] - } - }, - "kind": "init" - } - ] - } - } - ], - "sourceType": "module" - } - } -} \ No newline at end of file diff --git a/test/parser/samples/script-comment-trailing/_actual-v2.json b/test/parser/samples/script-comment-trailing/_actual-v2.json deleted file mode 100644 index 0ec47a455..000000000 --- a/test/parser/samples/script-comment-trailing/_actual-v2.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "hash": "19sno7e", - "html": { - "start": 0, - "end": 22, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 22, - "type": "Element", - "name": "h1", - "attributes": [], - "children": [ - { - "start": 4, - "end": 10, - "type": "Text", - "data": "Hello " - }, - { - "start": 10, - "end": 16, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 11, - "end": 15, - "name": "name" - } - }, - { - "start": 16, - "end": 17, - "type": "Text", - "data": "!" - } - ] - }, - { - "start": 22, - "end": 24, - "type": "Text", - "data": "\n\n" - } - ] - }, - "css": null, - "js": { - "start": 24, - "end": 130, - "attributes": [], - "content": { - "type": "Program", - "start": 32, - "end": 121, - "body": [ - { - "type": "ExportDefaultDeclaration", - "start": 34, - "end": 93, - "declaration": { - "type": "ObjectExpression", - "start": 49, - "end": 92, - "properties": [ - { - "type": "Property", - "start": 53, - "end": 89, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 53, - "end": 57, - "name": "data" - }, - "value": { - "type": "ArrowFunctionExpression", - "start": 59, - "end": 89, - "id": null, - "generator": false, - "expression": true, - "async": false, - "params": [], - "body": { - "type": "ObjectExpression", - "start": 66, - "end": 88, - "properties": [ - { - "type": "Property", - "start": 71, - "end": 84, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 71, - "end": 75, - "name": "name" - }, - "value": { - "type": "Literal", - "start": 77, - "end": 84, - "value": "world", - "raw": "'world'" - }, - "kind": "init" - } - ] - } - }, - "kind": "init" - } - ] - } - } - ], - "sourceType": "module" - } - } -} \ No newline at end of file diff --git a/test/parser/samples/script/_actual-v2.json b/test/parser/samples/script/_actual-v2.json deleted file mode 100644 index 1a68ead9b..000000000 --- a/test/parser/samples/script/_actual-v2.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "hash": "6jy7zq", - "html": { - "start": 0, - "end": 22, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 22, - "type": "Element", - "name": "h1", - "attributes": [], - "children": [ - { - "start": 4, - "end": 10, - "type": "Text", - "data": "Hello " - }, - { - "start": 10, - "end": 16, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 11, - "end": 15, - "name": "name" - } - }, - { - "start": 16, - "end": 17, - "type": "Text", - "data": "!" - } - ] - }, - { - "start": 22, - "end": 24, - "type": "Text", - "data": "\n\n" - } - ] - }, - "css": null, - "js": { - "start": 24, - "end": 103, - "attributes": [], - "content": { - "type": "Program", - "start": 32, - "end": 94, - "body": [ - { - "type": "ExportDefaultDeclaration", - "start": 34, - "end": 93, - "declaration": { - "type": "ObjectExpression", - "start": 49, - "end": 92, - "properties": [ - { - "type": "Property", - "start": 53, - "end": 89, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 53, - "end": 57, - "name": "data" - }, - "value": { - "type": "ArrowFunctionExpression", - "start": 59, - "end": 89, - "id": null, - "generator": false, - "expression": true, - "async": false, - "params": [], - "body": { - "type": "ObjectExpression", - "start": 66, - "end": 88, - "properties": [ - { - "type": "Property", - "start": 71, - "end": 84, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 71, - "end": 75, - "name": "name" - }, - "value": { - "type": "Literal", - "start": 77, - "end": 84, - "value": "world", - "raw": "'world'" - }, - "kind": "init" - } - ] - } - }, - "kind": "init" - } - ] - } - } - ], - "sourceType": "module" - } - } -} \ No newline at end of file diff --git a/test/parser/samples/self-closing-element/_actual-v2.json b/test/parser/samples/self-closing-element/_actual-v2.json deleted file mode 100644 index f36d243df..000000000 --- a/test/parser/samples/self-closing-element/_actual-v2.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "hash": "1xgowd3", - "html": { - "start": 0, - "end": 6, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 6, - "type": "Element", - "name": "div", - "attributes": [], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/self-reference/_actual-v2.json b/test/parser/samples/self-reference/_actual-v2.json deleted file mode 100644 index ced5eabc4..000000000 --- a/test/parser/samples/self-reference/_actual-v2.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "hash": "1wh7lqr", - "html": { - "start": 0, - "end": 57, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 57, - "type": "IfBlock", - "expression": { - "type": "BinaryExpression", - "start": 5, - "end": 14, - "left": { - "type": "Identifier", - "start": 5, - "end": 10, - "name": "depth" - }, - "operator": ">", - "right": { - "type": "Literal", - "start": 13, - "end": 14, - "value": 1, - "raw": "1" - } - }, - "children": [ - { - "start": 17, - "end": 51, - "type": "Element", - "name": "svelte:self", - "attributes": [ - { - "start": 30, - "end": 49, - "type": "Attribute", - "name": "depth", - "value": [ - { - "start": 37, - "end": 48, - "type": "MustacheTag", - "expression": { - "type": "BinaryExpression", - "start": 38, - "end": 47, - "left": { - "type": "Identifier", - "start": 38, - "end": 43, - "name": "depth" - }, - "operator": "-", - "right": { - "type": "Literal", - "start": 46, - "end": 47, - "value": 1, - "raw": "1" - } - } - } - ] - } - ], - "children": [] - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/space-between-mustaches/_actual-v2.json b/test/parser/samples/space-between-mustaches/_actual-v2.json deleted file mode 100644 index b6b5c1a4d..000000000 --- a/test/parser/samples/space-between-mustaches/_actual-v2.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "hash": "1n7rpsi", - "html": { - "start": 0, - "end": 24, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 24, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 3, - "end": 4, - "type": "Text", - "data": " " - }, - { - "start": 4, - "end": 7, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 5, - "end": 6, - "name": "a" - } - }, - { - "start": 7, - "end": 8, - "type": "Text", - "data": " " - }, - { - "start": 8, - "end": 11, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 9, - "end": 10, - "name": "b" - } - }, - { - "start": 11, - "end": 14, - "type": "Text", - "data": " : " - }, - { - "start": 14, - "end": 17, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 15, - "end": 16, - "name": "c" - } - }, - { - "start": 17, - "end": 20, - "type": "Text", - "data": " : " - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/spread/_actual-v2.json b/test/parser/samples/spread/_actual-v2.json deleted file mode 100644 index e9c53e744..000000000 --- a/test/parser/samples/spread/_actual-v2.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "hash": "z82kse", - "html": { - "start": 0, - "end": 22, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 22, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 15, - "type": "Spread", - "expression": { - "type": "Identifier", - "start": 9, - "end": 14, - "name": "props" - } - } - ], - "children": [] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/textarea-children/_actual-v2.json b/test/parser/samples/textarea-children/_actual-v2.json deleted file mode 100644 index 2e219bb75..000000000 --- a/test/parser/samples/textarea-children/_actual-v2.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "hash": "1uyqul7", - "html": { - "start": 0, - "end": 61, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 61, - "type": "Element", - "name": "textarea", - "attributes": [], - "children": [ - { - "start": 10, - "end": 40, - "type": "Text", - "data": "\n\t

not actually an element. " - }, - { - "start": 40, - "end": 45, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 41, - "end": 44, - "name": "foo" - } - }, - { - "start": 45, - "end": 50, - "type": "Text", - "data": "

\n" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/transition-intro-no-params/_actual-v2.json b/test/parser/samples/transition-intro-no-params/_actual-v2.json deleted file mode 100644 index 6c3b0f0c2..000000000 --- a/test/parser/samples/transition-intro-no-params/_actual-v2.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "hash": "8bm3vr", - "html": { - "start": 0, - "end": 27, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 27, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 12, - "type": "Transition", - "name": "fade", - "expression": null, - "intro": true, - "outro": false - } - ], - "children": [ - { - "start": 13, - "end": 21, - "type": "Text", - "data": "fades in" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/transition-intro/_actual-v2.json b/test/parser/samples/transition-intro/_actual-v2.json deleted file mode 100644 index 655d06c8f..000000000 --- a/test/parser/samples/transition-intro/_actual-v2.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "hash": "1ppqq8i", - "html": { - "start": 0, - "end": 43, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 43, - "type": "Element", - "name": "div", - "attributes": [ - { - "start": 5, - "end": 28, - "type": "Transition", - "name": "style", - "expression": { - "type": "ObjectExpression", - "start": 15, - "end": 27, - "properties": [ - { - "type": "Property", - "start": 16, - "end": 26, - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "start": 16, - "end": 23, - "name": "opacity" - }, - "value": { - "type": "Literal", - "start": 25, - "end": 26, - "value": 0, - "raw": "0" - }, - "kind": "init" - } - ] - }, - "intro": true, - "outro": false - } - ], - "children": [ - { - "start": 29, - "end": 37, - "type": "Text", - "data": "fades in" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/unusual-identifier/_actual-v2.json b/test/parser/samples/unusual-identifier/_actual-v2.json deleted file mode 100644 index e4a290c0a..000000000 --- a/test/parser/samples/unusual-identifier/_actual-v2.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "hash": "8weqxs", - "html": { - "start": 0, - "end": 41, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 41, - "type": "EachBlock", - "expression": { - "type": "Identifier", - "start": 7, - "end": 13, - "name": "things" - }, - "children": [ - { - "start": 22, - "end": 33, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 25, - "end": 29, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 26, - "end": 28, - "name": "𐊧" - } - } - ] - } - ], - "context": "𐊧" - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/whitespace-leading-trailing/_actual-v2.json b/test/parser/samples/whitespace-leading-trailing/_actual-v2.json deleted file mode 100644 index 432480cf6..000000000 --- a/test/parser/samples/whitespace-leading-trailing/_actual-v2.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "hash": "70xqns", - "html": { - "start": 6, - "end": 36, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 6, - "type": "Text", - "data": "\n\n\t\t\t\t" - }, - { - "start": 6, - "end": 36, - "type": "Element", - "name": "p", - "attributes": [], - "children": [ - { - "start": 9, - "end": 32, - "type": "Text", - "data": "just chillin' over here" - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/whitespace-normal/_actual-v2.json b/test/parser/samples/whitespace-normal/_actual-v2.json deleted file mode 100644 index e9d6a39b0..000000000 --- a/test/parser/samples/whitespace-normal/_actual-v2.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "hash": "1827l8g", - "html": { - "start": 0, - "end": 65, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 65, - "type": "Element", - "name": "h1", - "attributes": [], - "children": [ - { - "start": 4, - "end": 10, - "type": "Text", - "data": "Hello " - }, - { - "start": 10, - "end": 35, - "type": "Element", - "name": "strong", - "attributes": [], - "children": [ - { - "start": 18, - "end": 24, - "type": "MustacheTag", - "expression": { - "type": "Identifier", - "start": 19, - "end": 23, - "name": "name" - } - }, - { - "start": 24, - "end": 26, - "type": "Text", - "data": "! " - } - ] - }, - { - "start": 35, - "end": 60, - "type": "Element", - "name": "span", - "attributes": [], - "children": [ - { - "start": 41, - "end": 53, - "type": "Text", - "data": "How are you?" - } - ] - } - ] - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file diff --git a/test/parser/samples/yield/_actual-v2.json b/test/parser/samples/yield/_actual-v2.json deleted file mode 100644 index da5ed52d0..000000000 --- a/test/parser/samples/yield/_actual-v2.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "hash": "1na2f8c", - "html": { - "start": 0, - "end": 7, - "type": "Fragment", - "children": [ - { - "start": 0, - "end": 7, - "type": "MustacheTag", - "expression": { - "start": 1, - "end": 6, - "type": "Identifier", - "name": "yield" - } - } - ] - }, - "css": null, - "js": null -} \ No newline at end of file