diff --git a/.changeset/fluffy-emus-try.md b/.changeset/fluffy-emus-try.md new file mode 100644 index 00000000..43ccc6c0 --- /dev/null +++ b/.changeset/fluffy-emus-try.md @@ -0,0 +1,5 @@ +--- +"htmljs-parser": patch +--- + +Parse tag variable type as an continuable expression. diff --git a/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt b/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt index b8e9b621..19ebb1ac 100644 --- a/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt +++ b/src/__tests__/fixtures/tag-var-declaration/__snapshots__/tag-var-declaration.expected.txt @@ -33,51 +33,81 @@ │ │ ╰─ tagVar "/foo" ╰─ ╰─ tagName "let" 7╭─ - │ │ ││ │ │╰─ openTagEnd:selfClosed "/>" - │ │ ││ │ ╰─ attrName - │ │ ││ ╰─ attrName - │ │ │╰─ tagVar.value "foo" - │ │ ╰─ tagVar "/foo" + │ │ ││ ╰─ openTagEnd:selfClosed "/>" + │ │ │╰─ tagVar.value "foo + 1" + │ │ ╰─ tagVar "/foo + 1" ╰─ ╰─ tagName "let" -8╭─ - │ │ ││ ╰─ openTagEnd:selfClosed "/>" - │ │ │╰─ tagVar.value "{ x, y }" - │ │ ╰─ tagVar "/{ x, y }" +8╭─ + │ │ ││ ╰─ openTagEnd:selfClosed "/>" + │ │ │╰─ tagVar.value "foo:string" + │ │ ╰─ tagVar "/foo:string" ╰─ ╰─ tagName "let" -9├─ -10╭─