Skip to content

Commit aafeb17

Browse files
committed
chore: update fixtures script
1 parent a27697a commit aafeb17

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

src/visitor-keys.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const svelteKeys: SvelteKeysType = {
4545
SvelteDirective: ["key", "expression"],
4646
SvelteStyleDirective: ["key", "value"],
4747
SvelteSpecialDirective: ["key", "expression"],
48-
SvelteGenericsDirective: ["params"],
48+
SvelteGenericsDirective: ["key", "params"],
4949
SvelteDirectiveKey: ["name"],
5050
SvelteSpecialDirectiveKey: [],
5151
SvelteText: [],

tests/src/parser/test-utils.ts

+27-26
Original file line numberDiff line numberDiff line change
@@ -610,16 +610,20 @@ type SvelteKeysType<T extends SvelteNode = SvelteNode> = {
610610
type KeyofObject<T> = { [key in keyof T]: key }[keyof T];
611611
const nodeToKeys: SvelteKeysType = {
612612
Program: ["body", "sourceType", "comments", "tokens"],
613-
SvelteAttribute: ["key", "boolean", "value"],
614-
SvelteAwaitBlock: ["expression", "pending", "then", "catch"],
615-
SvelteAwaitCatchBlock: ["awaitCatch", "error", "children"],
616-
SvelteAwaitPendingBlock: ["children"],
617-
SvelteAwaitThenBlock: ["awaitThen", "value", "children"],
613+
SvelteScriptElement: ["name", "startTag", "body", "endTag"],
614+
SvelteStyleElement: ["name", "startTag", "children", "endTag"],
615+
SvelteElement: ["name", "startTag", "children", "endTag"],
616+
SvelteStartTag: ["attributes", "selfClosing"],
617+
SvelteEndTag: [],
618+
SvelteName: [],
619+
SvelteMemberExpressionName: ["object", "property"],
620+
SvelteLiteral: [],
621+
SvelteMustacheTag: ["expression"],
618622
SvelteDebugTag: ["identifiers"],
619623
SvelteConstTag: ["declaration"],
620-
SvelteDirective: ["key", "intro", "outro", "expression"],
621-
SvelteStyleDirective: ["key", "shorthand", "value"],
622-
SvelteDirectiveKey: ["name", "modifiers"],
624+
SvelteRenderTag: ["expression"],
625+
SvelteIfBlock: ["elseif", "expression", "children", "else"],
626+
SvelteElseBlock: ["elseif", "children"],
623627
SvelteEachBlock: [
624628
"expression",
625629
"context",
@@ -628,27 +632,24 @@ const nodeToKeys: SvelteKeysType = {
628632
"children",
629633
"else",
630634
],
631-
SvelteElement: ["kind", "name", "startTag", "children", "endTag"],
632-
SvelteElseBlock: ["elseif", "children"],
633-
SvelteEndTag: [],
634-
SvelteHTMLComment: ["value"],
635-
SvelteIfBlock: ["elseif", "expression", "children", "else"],
635+
SvelteAwaitBlock: ["expression", "pending", "then", "catch"],
636+
SvelteAwaitPendingBlock: ["children"],
637+
SvelteAwaitThenBlock: ["awaitThen", "value", "children"],
638+
SvelteAwaitCatchBlock: ["awaitCatch", "error", "children"],
636639
SvelteKeyBlock: ["expression", "children"],
637-
SvelteLiteral: ["value"],
638-
SvelteMustacheTag: ["kind", "expression"],
639-
SvelteName: ["name"],
640-
SvelteMemberExpressionName: ["object", "property"],
641-
SvelteReactiveStatement: ["label", "body"],
642-
SvelteScriptElement: ["name", "startTag", "body", "endTag"],
640+
SvelteSnippetBlock: ["id", "params", "children"],
641+
SvelteAttribute: ["key", "boolean", "value"],
643642
SvelteShorthandAttribute: ["key", "value"],
644-
SvelteSpecialDirective: ["kind", "key", "expression"],
645-
SvelteSpecialDirectiveKey: [],
646643
SvelteSpreadAttribute: ["argument"],
647-
SvelteStartTag: ["attributes", "selfClosing"],
648-
SvelteStyleElement: ["name", "startTag", "children", "endTag"],
649-
SvelteText: ["value"],
650-
SvelteRenderTag: ["expression"],
651-
SvelteSnippetBlock: ["id", "params", "children"],
644+
SvelteDirective: ["key", "intro", "outro", "expression"],
645+
SvelteStyleDirective: ["key", "shorthand", "value"],
646+
SvelteSpecialDirective: ["key", "expression"],
647+
SvelteGenericsDirective: ["key", "params"],
648+
SvelteDirectiveKey: ["name"],
649+
SvelteSpecialDirectiveKey: [],
650+
SvelteText: [],
651+
SvelteHTMLComment: [],
652+
SvelteReactiveStatement: ["label", "body"],
652653
};
653654

654655
function normalizeObject(value: any) {

0 commit comments

Comments
 (0)