Skip to content

Commit 01595dc

Browse files
committed
feat: merge body type and tag tag, allow override tag types
1 parent fdd70bf commit 01595dc

File tree

240 files changed

+850
-921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+850
-921
lines changed
Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,44 @@
11
1╭─ <${x}(y)/>
2-
│ │ ││ ╰─ openTagEnd(${x}) "/>"
2+
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
33
│ │ │├─ tagArgs.value
44
│ │ │╰─ tagName.quasis[1]
55
│ │ ╰─ tagArgs "(y)"
66
│ ├─ tagName.expressions[0] "${x}"
77
│ ├─ tagName.quasis[0]
88
╰─ ╰─ tagName "${x}"
99
2╭─ <${x}|y|/>
10-
│ ││ ││ ╰─ openTagEnd(${x}) "/>"
11-
│ ││ │├─ tagParams.value
12-
│ ││ │╰─ tagName.quasis[1]
13-
│ ││ ╰─ tagParams "|y|"
14-
│ │├─ tagName.expressions[0] "${x}"
15-
│ │├─ tagName.quasis[0]
16-
│ │╰─ tagName "${x}"
17-
╰─ ╰─ closeTag(${x})
10+
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
11+
│ │ │├─ tagParams.value
12+
│ │ │╰─ tagName.quasis[1]
13+
│ │ ╰─ tagParams "|y|"
14+
│ ├─ tagName.expressions[0] "${x}"
15+
│ ├─ tagName.quasis[0]
16+
╰─ ╰─ tagName "${x}"
1817
3╭─ <tag.x(y)/>
19-
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
20-
│ ││ │││╰─ tagArgs.value
21-
│ ││ ││╰─ tagArgs "(y)"
22-
│ ││ │╰─ tagShorthandClass.quasis[0]
23-
│ ││ ╰─ tagShorthandClass ".x"
24-
│ │╰─ tagName "tag"
25-
╰─ ╰─ closeTag(${x})
18+
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
19+
│ │ │││╰─ tagArgs.value
20+
│ │ ││╰─ tagArgs "(y)"
21+
│ │ │╰─ tagShorthandClass.quasis[0]
22+
│ │ ╰─ tagShorthandClass ".x"
23+
╰─ ╰─ tagName "tag"
2624
4╭─ <tag.x|y|/>
27-
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
28-
│ ││ │││╰─ tagParams.value
29-
│ ││ ││╰─ tagParams "|y|"
30-
│ ││ │╰─ tagShorthandClass.quasis[0]
31-
│ ││ ╰─ tagShorthandClass ".x"
32-
│ │╰─ tagName "tag"
33-
╰─ ╰─ closeTag(tag)
25+
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
26+
│ │ │││╰─ tagParams.value
27+
│ │ ││╰─ tagParams "|y|"
28+
│ │ │╰─ tagShorthandClass.quasis[0]
29+
│ │ ╰─ tagShorthandClass ".x"
30+
╰─ ╰─ tagName "tag"
3431
5╭─ <tag#x(y)/>
35-
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
36-
│ ││ │││╰─ tagArgs.value
37-
│ ││ ││╰─ tagArgs "(y)"
38-
│ ││ │╰─ tagShorthandId.quasis[0]
39-
│ ││ ╰─ tagShorthandId "#x"
40-
│ │╰─ tagName "tag"
41-
╰─ ╰─ closeTag(tag)
32+
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
33+
│ │ │││╰─ tagArgs.value
34+
│ │ ││╰─ tagArgs "(y)"
35+
│ │ │╰─ tagShorthandId.quasis[0]
36+
│ │ ╰─ tagShorthandId "#x"
37+
╰─ ╰─ tagName "tag"
4238
6╭─ <tag#x|y|/>
43-
│ ││ ││││ │ ╰─ closeTag(tag)
44-
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
45-
│ ││ │││╰─ tagParams.value
46-
│ ││ ││╰─ tagParams "|y|"
47-
│ ││ │╰─ tagShorthandId.quasis[0]
48-
│ ││ ╰─ tagShorthandId "#x"
49-
│ │╰─ tagName "tag"
50-
╰─ ╰─ closeTag(tag)
39+
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
40+
│ │ │││╰─ tagParams.value
41+
│ │ ││╰─ tagParams "|y|"
42+
│ │ │╰─ tagShorthandId.quasis[0]
43+
│ │ ╰─ tagShorthandId "#x"
44+
╰─ ╰─ tagName "tag"

src/__tests__/fixtures/argument-attr-extra-whitespace/__snapshots__/argument-attr-extra-whitespace.expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1╭─ <div if (x > y)>
2-
│ │ │ ││ ╰─ openTagEnd(div)
2+
│ │ │ ││ ╰─ openTagEnd
33
│ │ │ │╰─ attrArgs.value "x > y"
44
│ │ │ ╰─ attrArgs "(x > y)"
55
│ │ ╰─ attrName "if"

src/__tests__/fixtures/argument-attr/__snapshots__/argument-attr.expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ <div if(x > y)></div>
22
│ │ │ ││ ││ ╰─ closeTag(div).value "div"
33
│ │ │ ││ │╰─ closeTag(div) "</div>"
4-
│ │ │ ││ ╰─ openTagEnd(div)
4+
│ │ │ ││ ╰─ openTagEnd
55
│ │ │ │╰─ attrArgs.value "x > y"
66
│ │ │ ╰─ attrArgs "(x > y)"
77
│ │ ╰─ attrName "if"

src/__tests__/fixtures/argument-tag-attr/__snapshots__/argument-tag-attr.expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ <for(var i = 0; i < 10; i++) if(x > y)></for>
22
│ │ ││ │ ││ ││ ╰─ closeTag(for).value "for"
33
│ │ ││ │ ││ │╰─ closeTag(for) "</for>"
4-
│ │ ││ │ ││ ╰─ openTagEnd(for)
4+
│ │ ││ │ ││ ╰─ openTagEnd
55
│ │ ││ │ │╰─ attrArgs.value "x > y"
66
│ │ ││ │ ╰─ attrArgs "(x > y)"
77
│ │ ││ ╰─ attrName "if"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ <for (x in ["Hello ${name}!", "(World)"])></for>
22
│ │ ││ ││ ╰─ closeTag(for).value "for"
33
│ │ ││ │╰─ closeTag(for) "</for>"
4-
│ │ ││ ╰─ openTagEnd(for)
4+
│ │ ││ ╰─ openTagEnd
55
│ │ │╰─ tagArgs.value "x in [\"Hello ${name}!\", \"(World)\"]"
66
│ │ ╰─ tagArgs "(x in [\"Hello ${name}!\", \"(World)\"])"
77
╰─ ╰─ tagName "for"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
1╭─ <for (x in y)></for>
22
│ │ ││ ││ ╰─ closeTag(for).value "for"
33
│ │ ││ │╰─ closeTag(for) "</for>"
4-
│ │ ││ ╰─ openTagEnd(for)
4+
│ │ ││ ╰─ openTagEnd
55
│ │ │╰─ tagArgs.value "x in y"
66
│ │ ╰─ tagArgs "(x in y)"
77
╰─ ╰─ tagName "for"

src/__tests__/fixtures/argument-tag-nested-parens/__snapshots__/argument-tag-nested-parens.expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
1╭─ ---
22
2╭─ <if(notEmpty(data.colors))>
3-
│ ││ ││ ╰─ openTagEnd(if)
3+
│ ││ ││ ╰─ openTagEnd
44
│ ││ │╰─ tagArgs.value "notEmpty(data.colors)"
55
│ ││ ╰─ tagArgs "(notEmpty(data.colors))"
66
│ │╰─ tagName "if"
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
1╭─ <for(x in y)></for>
22
│ │ ││ ││ ╰─ closeTag(for).value "for"
33
│ │ ││ │╰─ closeTag(for) "</for>"
4-
│ │ ││ ╰─ openTagEnd(for)
4+
│ │ ││ ╰─ openTagEnd
55
│ │ │╰─ tagArgs.value "x in y"
66
│ │ ╰─ tagArgs "(x in y)"
77
╰─ ╰─ tagName "for"
88
2╭─ <ab('c')/>
9-
│ │ ││ ╰─ openTagEnd(ab) "/>"
9+
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
1010
│ │ │╰─ tagArgs.value "'c'"
1111
│ │ ╰─ tagArgs "('c')"
1212
╰─ ╰─ tagName "ab"
1313
3╭─ <a('b')/>
14-
│ ││││ ╰─ openTagEnd(a) "/>"
15-
│ │││╰─ tagArgs.value "'b'"
16-
│ ││╰─ tagArgs "('b')"
17-
│ │╰─ tagName
18-
╰─ ╰─ closeTag(ab)
19-
4╭─
20-
╰─ ╰─ closeTag(a)
14+
│ │││ ╰─ openTagEnd:selfClosed "/>"
15+
│ ││╰─ tagArgs.value "'b'"
16+
│ │╰─ tagArgs "('b')"
17+
╰─ ╰─ tagName
18+
4╰─

src/__tests__/fixtures/attr-bound/__snapshots__/attr-bound.expected.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
│ │ ││ │ ││ │ ╰─ closeTag(a).value
33
│ │ ││ │ ││ ╰─ closeTag(a) "</a>"
44
│ │ ││ │ │╰─ text "test"
5-
│ │ ││ │ ╰─ openTagEnd(a)
5+
│ │ ││ │ ╰─ openTagEnd
66
│ │ ││ ╰─ attrValue:bound.value "foo"
77
│ │ │╰─ attrValue:bound ":=foo"
88
│ │ ╰─ attrName
@@ -11,7 +11,7 @@
1111
│ │ │ │ │ ││ │ ╰─ closeTag(a).value
1212
│ │ │ │ │ ││ ╰─ closeTag(a) "</a>"
1313
│ │ │ │ │ │╰─ text "test"
14-
│ │ │ │ │ ╰─ openTagEnd(a)
14+
│ │ │ │ │ ╰─ openTagEnd
1515
│ │ │ │ ╰─ attrValue:bound.value "foo"
1616
│ │ │ ╰─ attrValue:bound ":= foo"
1717
│ │ ╰─ attrName
@@ -20,7 +20,7 @@
2020
│ ││ │ ││ │ ╰─ closeTag(a).value
2121
│ ││ │ ││ ╰─ closeTag(a) "</a>"
2222
│ ││ │ │╰─ text "test"
23-
│ ││ │ ╰─ openTagEnd(a)
23+
│ ││ │ ╰─ openTagEnd
2424
│ ││ ╰─ attrValue:bound.value "foo"
2525
│ │├─ attrValue:bound ":=foo"
2626
│ │╰─ attrName
@@ -29,7 +29,7 @@
2929
│ │ │ │ ││ │ ╰─ closeTag(a).value
3030
│ │ │ │ ││ ╰─ closeTag(a) "</a>"
3131
│ │ │ │ │╰─ text "test"
32-
│ │ │ │ ╰─ openTagEnd(a)
32+
│ │ │ │ ╰─ openTagEnd
3333
│ │ │ ╰─ attrValue:bound.value "foo"
3434
│ │ ├─ attrValue:bound ":= foo"
3535
│ │ ╰─ attrName
@@ -38,7 +38,7 @@
3838
│ │││ │ │ ││ │ ╰─ closeTag(a).value
3939
│ │││ │ │ ││ ╰─ closeTag(a) "</a>"
4040
│ │││ │ │ │╰─ text "test"
41-
│ │││ │ │ ╰─ openTagEnd(a)
41+
│ │││ │ │ ╰─ openTagEnd
4242
│ │││ │ ╰─ attrValue:bound.value "foo"
4343
│ │││ ├─ attrValue:bound ":=foo"
4444
│ │││ ╰─ attrName
@@ -49,7 +49,7 @@
4949
│ │││ │ │ ││ │ ╰─ closeTag(a).value
5050
│ │││ │ │ ││ ╰─ closeTag(a) "</a>"
5151
│ │││ │ │ │╰─ text "test"
52-
│ │││ │ │ ╰─ openTagEnd(a)
52+
│ │││ │ │ ╰─ openTagEnd
5353
│ │││ │ ╰─ attrValue:bound.value "foo"
5454
│ │││ ├─ attrValue:bound ":= foo"
5555
│ │││ ╰─ attrName

src/__tests__/fixtures/attr-comma-multiline/__snapshots__/attr-comma-multiline.expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
6╭─ -- This is the body of the a tag
2121
│ │ │ ╰─ closeTag(a)
2222
│ │ ╰─ text "This is the body of the a tag"
23-
╰─ ╰─ openTagEnd(a)
23+
╰─ ╰─ openTagEnd

0 commit comments

Comments
 (0)