Skip to content

Commit

Permalink
feat: merge body type and tag tag, allow override tag types
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Apr 4, 2022
1 parent fdd70bf commit 01595dc
Show file tree
Hide file tree
Showing 240 changed files with 850 additions and 921 deletions.
Original file line number Diff line number Diff line change
@@ -1,50 +1,44 @@
1╭─ <${x}(y)/>
│ │ ││ ╰─ openTagEnd(${x}) "/>"
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
│ │ │├─ tagArgs.value
│ │ │╰─ tagName.quasis[1]
│ │ ╰─ tagArgs "(y)"
│ ├─ tagName.expressions[0] "${x}"
│ ├─ tagName.quasis[0]
╰─ ╰─ tagName "${x}"
2╭─ <${x}|y|/>
│ ││ ││ ╰─ openTagEnd(${x}) "/>"
│ ││ │├─ tagParams.value
│ ││ │╰─ tagName.quasis[1]
│ ││ ╰─ tagParams "|y|"
│ │├─ tagName.expressions[0] "${x}"
│ │├─ tagName.quasis[0]
│ │╰─ tagName "${x}"
╰─ ╰─ closeTag(${x})
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
│ │ │├─ tagParams.value
│ │ │╰─ tagName.quasis[1]
│ │ ╰─ tagParams "|y|"
│ ├─ tagName.expressions[0] "${x}"
│ ├─ tagName.quasis[0]
╰─ ╰─ tagName "${x}"
3╭─ <tag.x(y)/>
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
│ ││ │││╰─ tagArgs.value
│ ││ ││╰─ tagArgs "(y)"
│ ││ │╰─ tagShorthandClass.quasis[0]
│ ││ ╰─ tagShorthandClass ".x"
│ │╰─ tagName "tag"
╰─ ╰─ closeTag(${x})
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
│ │ │││╰─ tagArgs.value
│ │ ││╰─ tagArgs "(y)"
│ │ │╰─ tagShorthandClass.quasis[0]
│ │ ╰─ tagShorthandClass ".x"
╰─ ╰─ tagName "tag"
4╭─ <tag.x|y|/>
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
│ ││ │││╰─ tagParams.value
│ ││ ││╰─ tagParams "|y|"
│ ││ │╰─ tagShorthandClass.quasis[0]
│ ││ ╰─ tagShorthandClass ".x"
│ │╰─ tagName "tag"
╰─ ╰─ closeTag(tag)
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
│ │ │││╰─ tagParams.value
│ │ ││╰─ tagParams "|y|"
│ │ │╰─ tagShorthandClass.quasis[0]
│ │ ╰─ tagShorthandClass ".x"
╰─ ╰─ tagName "tag"
5╭─ <tag#x(y)/>
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
│ ││ │││╰─ tagArgs.value
│ ││ ││╰─ tagArgs "(y)"
│ ││ │╰─ tagShorthandId.quasis[0]
│ ││ ╰─ tagShorthandId "#x"
│ │╰─ tagName "tag"
╰─ ╰─ closeTag(tag)
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
│ │ │││╰─ tagArgs.value
│ │ ││╰─ tagArgs "(y)"
│ │ │╰─ tagShorthandId.quasis[0]
│ │ ╰─ tagShorthandId "#x"
╰─ ╰─ tagName "tag"
6╭─ <tag#x|y|/>
│ ││ ││││ │ ╰─ closeTag(tag)
│ ││ ││││ ╰─ openTagEnd(tag) "/>"
│ ││ │││╰─ tagParams.value
│ ││ ││╰─ tagParams "|y|"
│ ││ │╰─ tagShorthandId.quasis[0]
│ ││ ╰─ tagShorthandId "#x"
│ │╰─ tagName "tag"
╰─ ╰─ closeTag(tag)
│ │ ││││ ╰─ openTagEnd:selfClosed "/>"
│ │ │││╰─ tagParams.value
│ │ ││╰─ tagParams "|y|"
│ │ │╰─ tagShorthandId.quasis[0]
│ │ ╰─ tagShorthandId "#x"
╰─ ╰─ tagName "tag"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1╭─ <div if (x > y)>
│ │ │ ││ ╰─ openTagEnd(div)
│ │ │ ││ ╰─ openTagEnd
│ │ │ │╰─ attrArgs.value "x > y"
│ │ │ ╰─ attrArgs "(x > y)"
│ │ ╰─ attrName "if"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1╭─ <div if(x > y)></div>
│ │ │ ││ ││ ╰─ closeTag(div).value "div"
│ │ │ ││ │╰─ closeTag(div) "</div>"
│ │ │ ││ ╰─ openTagEnd(div)
│ │ │ ││ ╰─ openTagEnd
│ │ │ │╰─ attrArgs.value "x > y"
│ │ │ ╰─ attrArgs "(x > y)"
│ │ ╰─ attrName "if"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1╭─ <for(var i = 0; i < 10; i++) if(x > y)></for>
│ │ ││ │ ││ ││ ╰─ closeTag(for).value "for"
│ │ ││ │ ││ │╰─ closeTag(for) "</for>"
│ │ ││ │ ││ ╰─ openTagEnd(for)
│ │ ││ │ ││ ╰─ openTagEnd
│ │ ││ │ │╰─ attrArgs.value "x > y"
│ │ ││ │ ╰─ attrArgs "(x > y)"
│ │ ││ ╰─ attrName "if"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1╭─ <for (x in ["Hello ${name}!", "(World)"])></for>
│ │ ││ ││ ╰─ closeTag(for).value "for"
│ │ ││ │╰─ closeTag(for) "</for>"
│ │ ││ ╰─ openTagEnd(for)
│ │ ││ ╰─ openTagEnd
│ │ │╰─ tagArgs.value "x in [\"Hello ${name}!\", \"(World)\"]"
│ │ ╰─ tagArgs "(x in [\"Hello ${name}!\", \"(World)\"])"
╰─ ╰─ tagName "for"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1╭─ <for (x in y)></for>
│ │ ││ ││ ╰─ closeTag(for).value "for"
│ │ ││ │╰─ closeTag(for) "</for>"
│ │ ││ ╰─ openTagEnd(for)
│ │ ││ ╰─ openTagEnd
│ │ │╰─ tagArgs.value "x in y"
│ │ ╰─ tagArgs "(x in y)"
╰─ ╰─ tagName "for"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1╭─ ---
2╭─ <if(notEmpty(data.colors))>
│ ││ ││ ╰─ openTagEnd(if)
│ ││ ││ ╰─ openTagEnd
│ ││ │╰─ tagArgs.value "notEmpty(data.colors)"
│ ││ ╰─ tagArgs "(notEmpty(data.colors))"
│ │╰─ tagName "if"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
1╭─ <for(x in y)></for>
│ │ ││ ││ ╰─ closeTag(for).value "for"
│ │ ││ │╰─ closeTag(for) "</for>"
│ │ ││ ╰─ openTagEnd(for)
│ │ ││ ╰─ openTagEnd
│ │ │╰─ tagArgs.value "x in y"
│ │ ╰─ tagArgs "(x in y)"
╰─ ╰─ tagName "for"
2╭─ <ab('c')/>
│ │ ││ ╰─ openTagEnd(ab) "/>"
│ │ ││ ╰─ openTagEnd:selfClosed "/>"
│ │ │╰─ tagArgs.value "'c'"
│ │ ╰─ tagArgs "('c')"
╰─ ╰─ tagName "ab"
3╭─ <a('b')/>
│ ││││ ╰─ openTagEnd(a) "/>"
│ │││╰─ tagArgs.value "'b'"
│ ││╰─ tagArgs "('b')"
│ │╰─ tagName
╰─ ╰─ closeTag(ab)
4╭─
╰─ ╰─ closeTag(a)
│ │││ ╰─ openTagEnd:selfClosed "/>"
│ ││╰─ tagArgs.value "'b'"
│ │╰─ tagArgs "('b')"
╰─ ╰─ tagName
4╰─
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
│ │ ││ │ ││ │ ╰─ closeTag(a).value
│ │ ││ │ ││ ╰─ closeTag(a) "</a>"
│ │ ││ │ │╰─ text "test"
│ │ ││ │ ╰─ openTagEnd(a)
│ │ ││ │ ╰─ openTagEnd
│ │ ││ ╰─ attrValue:bound.value "foo"
│ │ │╰─ attrValue:bound ":=foo"
│ │ ╰─ attrName
Expand All @@ -11,7 +11,7 @@
│ │ │ │ │ ││ │ ╰─ closeTag(a).value
│ │ │ │ │ ││ ╰─ closeTag(a) "</a>"
│ │ │ │ │ │╰─ text "test"
│ │ │ │ │ ╰─ openTagEnd(a)
│ │ │ │ │ ╰─ openTagEnd
│ │ │ │ ╰─ attrValue:bound.value "foo"
│ │ │ ╰─ attrValue:bound ":= foo"
│ │ ╰─ attrName
Expand All @@ -20,7 +20,7 @@
│ ││ │ ││ │ ╰─ closeTag(a).value
│ ││ │ ││ ╰─ closeTag(a) "</a>"
│ ││ │ │╰─ text "test"
│ ││ │ ╰─ openTagEnd(a)
│ ││ │ ╰─ openTagEnd
│ ││ ╰─ attrValue:bound.value "foo"
│ │├─ attrValue:bound ":=foo"
│ │╰─ attrName
Expand All @@ -29,7 +29,7 @@
│ │ │ │ ││ │ ╰─ closeTag(a).value
│ │ │ │ ││ ╰─ closeTag(a) "</a>"
│ │ │ │ │╰─ text "test"
│ │ │ │ ╰─ openTagEnd(a)
│ │ │ │ ╰─ openTagEnd
│ │ │ ╰─ attrValue:bound.value "foo"
│ │ ├─ attrValue:bound ":= foo"
│ │ ╰─ attrName
Expand All @@ -38,7 +38,7 @@
│ │││ │ │ ││ │ ╰─ closeTag(a).value
│ │││ │ │ ││ ╰─ closeTag(a) "</a>"
│ │││ │ │ │╰─ text "test"
│ │││ │ │ ╰─ openTagEnd(a)
│ │││ │ │ ╰─ openTagEnd
│ │││ │ ╰─ attrValue:bound.value "foo"
│ │││ ├─ attrValue:bound ":=foo"
│ │││ ╰─ attrName
Expand All @@ -49,7 +49,7 @@
│ │││ │ │ ││ │ ╰─ closeTag(a).value
│ │││ │ │ ││ ╰─ closeTag(a) "</a>"
│ │││ │ │ │╰─ text "test"
│ │││ │ │ ╰─ openTagEnd(a)
│ │││ │ │ ╰─ openTagEnd
│ │││ │ ╰─ attrValue:bound.value "foo"
│ │││ ├─ attrValue:bound ":= foo"
│ │││ ╰─ attrName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
6╭─ -- This is the body of the a tag
│ │ │ ╰─ closeTag(a)
│ │ ╰─ text "This is the body of the a tag"
╰─ ╰─ openTagEnd(a)
╰─ ╰─ openTagEnd
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
│ │ │ ╰─ attrValue "= (x) => { console.log(\"y\") }"
│ │ ╰─ attrName
│ ├─ closeTag(tag)
│ ├─ openTagEnd(tag)
│ ├─ openTagEnd
╰─ ╰─ tagName "tag"
3╭─ tag a = x => { console.log("y") } b
│ │ │ │ │ ╰─ attrName
│ │ │ │ ╰─ attrValue.value "x => { console.log(\"y\") }"
│ │ │ ╰─ attrValue "= x => { console.log(\"y\") }"
│ │ ╰─ attrName
│ ├─ closeTag(tag)
│ ├─ openTagEnd(tag)
│ ├─ openTagEnd
╰─ ╰─ tagName "tag"
4╭─ tag a = async x => { console.log("y") } b
│ │ │ │ │ ╰─ attrName
│ │ │ │ ╰─ attrValue.value "async x => { console.log(\"y\") }"
│ │ │ ╰─ attrValue "= async x => { console.log(\"y\") }"
│ │ ╰─ attrName
│ ├─ closeTag(tag)
│ ├─ openTagEnd(tag)
│ ├─ openTagEnd
╰─ ╰─ tagName "tag"
5╭─ tag a = async function (x) { console.log("y") } b
│ │ │ │ │ │├─ closeTag(tag)
│ │ │ │ │ │╰─ openTagEnd(tag)
│ │ │ │ │ │╰─ openTagEnd
│ │ │ │ │ ╰─ attrName
│ │ │ │ ╰─ attrValue.value "async function (x) { console.log(\"y\") }"
│ │ │ ╰─ attrValue "= async function (x) { console.log(\"y\") }"
│ │ ╰─ attrName
│ ├─ closeTag(tag)
│ ├─ openTagEnd(tag)
│ ├─ openTagEnd
╰─ ╰─ tagName "tag"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
│ │ ╰─ attrName
╰─ ╰─ tagName "var"
2╭─
╰─ ╰─ openTagEnd(var)
╰─ ╰─ openTagEnd
3╭─ tag a = 'foo' instanceof = String
│ │ │ │ │ │ │ ╰─ attrValue.value "String"
│ │ │ │ │ │ ╰─ attrValue "= String"
Expand All @@ -22,7 +22,7 @@
│ │ │ ╰─ attrValue "= 'foo'"
│ │ ╰─ attrName
│ ├─ closeTag(tag)
│ ├─ openTagEnd(tag)
│ ├─ openTagEnd
╰─ ╰─ tagName "tag"
5╭─ tag a = 'foo' instanceof= String
│ │ │ │ │ │ │ ╰─ attrValue.value "String"
Expand All @@ -32,18 +32,18 @@
│ │ │ ╰─ attrValue "= 'foo'"
│ │ ╰─ attrName
│ ├─ closeTag(tag)
│ ├─ openTagEnd(tag)
│ ├─ openTagEnd
╰─ ╰─ tagName "tag"
6╭─ tag a = 'foo' instanceof;
│ │ │ │ │ ╰─ attrName "instanceof"
│ │ │ │ ╰─ attrValue.value "'foo'"
│ │ │ ╰─ attrValue "= 'foo'"
│ │ ╰─ attrName
│ ├─ closeTag(tag)
│ ├─ openTagEnd(tag)
│ ├─ openTagEnd
╰─ ╰─ tagName "tag"
7╭─
╰─ ╰─ openTagEnd(tag)
╰─ ╰─ openTagEnd
8╭─ tag a = 'foo' instanceof, b
│ │ │ │ │ │ ╰─ attrName
│ │ │ │ │ ╰─ attrName "instanceof"
Expand All @@ -53,20 +53,19 @@
│ ├─ closeTag(tag)
╰─ ╰─ tagName "tag"
9╭─
╰─ ╰─ openTagEnd(tag)
╰─ ╰─ openTagEnd
10╭─ <tag a = 'foo' instanceof></tag>
│ ││ │ │ │ │ ││ ╰─ closeTag(tag).value "tag"
│ ││ │ │ │ │ │╰─ closeTag(tag) "</tag>"
│ ││ │ │ │ │ ╰─ openTagEnd(tag)
│ ││ │ │ │ │ ╰─ openTagEnd
│ ││ │ │ │ ╰─ attrName "instanceof"
│ ││ │ │ ╰─ attrValue.value "'foo'"
│ ││ │ ╰─ attrValue "= 'foo'"
│ ││ ╰─ attrName
│ │╰─ tagName "tag"
╰─ ╰─ closeTag(tag)
11╭─ <tag a = 'foo' instanceof/>
│ │ │ │ │ │ │ ╰─ closeTag(tag)
│ │ │ │ │ │ ╰─ openTagEnd(tag) "/>"
│ │ │ │ │ │ ╰─ openTagEnd:selfClosed "/>"
│ │ │ │ │ ╰─ attrName "instanceof"
│ │ │ │ ╰─ attrValue.value "'foo'"
│ │ │ ╰─ attrValue "= 'foo'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
│ │ │││ │ ││ │ ││ │ ╰─ closeTag(a).value
│ │ │││ │ ││ │ ││ ╰─ closeTag(a) "</a>"
│ │ │││ │ ││ │ │╰─ text "test"
│ │ │││ │ ││ │ ╰─ openTagEnd(a)
│ │ │││ │ ││ │ ╰─ openTagEnd
│ │ │││ │ ││ ╰─ attrValue.value "d=(a + (1/2) /* comment */)"
│ │ │││ │ │╰─ attrValue "= d=(a + (1/2) /* comment */)"
│ │ │││ │ ╰─ attrName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1╭─ <div foo='\"hello\"'>
│ │ │ ││ ╰─ openTagEnd(div)
│ │ │ ││ ╰─ openTagEnd
│ │ │ │╰─ attrValue.value "'\\\"hello\\\"'"
│ │ │ ╰─ attrValue "='\\\"hello\\\"'"
│ │ ╰─ attrName "foo"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1╭─ <span data-foo="\$name"></span>
│ │ │ ││ ││ ╰─ closeTag(span).value "span"
│ │ │ ││ │╰─ closeTag(span) "</span>"
│ │ │ ││ ╰─ openTagEnd(span)
│ │ │ ││ ╰─ openTagEnd
│ │ │ │╰─ attrValue.value "\"\\$name\""
│ │ │ ╰─ attrValue "=\"\\$name\""
│ │ ╰─ attrName "data-foo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
5╭─ -- This is the body of the a tag
│ │ │ ╰─ closeTag(a)
│ │ ╰─ text "This is the body of the a tag"
╰─ ╰─ openTagEnd(a)
╰─ ╰─ openTagEnd
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
5╭─ -- This is the body of the a tag
│ │ │ ╰─ closeTag(a)
│ │ ╰─ text "This is the body of the a tag"
╰─ ╰─ openTagEnd(a)
╰─ ╰─ openTagEnd
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
5╭─ -- This is the body of the a tag
│ │ │ ╰─ closeTag(a)
│ │ ╰─ text "This is the body of the a tag"
╰─ ╰─ openTagEnd(a)
╰─ ╰─ openTagEnd
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
4╭─ -- This is the body of the a tag
│ │ │ ╰─ closeTag(a)
│ │ ╰─ text "This is the body of the a tag"
╰─ ╰─ openTagEnd(a)
╰─ ╰─ openTagEnd
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
5╭─ -- This is the body of the a tag
│ │ │ ╰─ closeTag(a)
│ │ ╰─ text "This is the body of the a tag"
╰─ ╰─ openTagEnd(a)
╰─ ╰─ openTagEnd
Loading

0 comments on commit 01595dc

Please sign in to comment.