-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: more expression parsing improvements
- Loading branch information
1 parent
e38b29e
commit 102346d
Showing
9 changed files
with
1,223 additions
and
62 deletions.
There are no files selected for viewing
319 changes: 319 additions & 0 deletions
319
...fixtures/attr-operators-space-after/__snapshots__/attr-operators-space-after.expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,319 @@ | ||
1╭─ a=x! y | ||
│ ││╰─ attrValue.value "x! y" | ||
│ │├─ attrValue "=x! y" | ||
│ │╰─ attrName | ||
╰─ ╰─ tagName | ||
2╭─ a=x* y | ||
│ ││╰─ attrValue.value "x* y" | ||
│ │├─ attrValue "=x* y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
3╭─ a=x** y | ||
│ ││╰─ attrValue.value "x** y" | ||
│ │├─ attrValue "=x** y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
4╭─ a=x% y | ||
│ ││╰─ attrValue.value "x% y" | ||
│ │├─ attrValue "=x% y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
5╭─ a=x& y | ||
│ ││╰─ attrValue.value "x& y" | ||
│ │├─ attrValue "=x& y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
6╭─ a=x&& y | ||
│ ││╰─ attrValue.value "x&& y" | ||
│ │├─ attrValue "=x&& y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
7╭─ a=x^ y | ||
│ ││╰─ attrValue.value "x^ y" | ||
│ │├─ attrValue "=x^ y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
8╭─ a=x~ y | ||
│ ││╰─ attrValue.value "x~ y" | ||
│ │├─ attrValue "=x~ y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
9╭─ a=x| y | ||
│ ││╰─ attrValue.value "x| y" | ||
│ │├─ attrValue "=x| y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
10╭─ a=x|| y | ||
│ ││╰─ attrValue.value "x|| y" | ||
│ │├─ attrValue "=x|| y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
11╭─ a=x?? y | ||
│ ││╰─ attrValue.value "x?? y" | ||
│ │├─ attrValue "=x?? y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
12╭─ a=x? y : z | ||
│ ││╰─ attrValue.value "x? y : z" | ||
│ │├─ attrValue "=x? y : z" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
13╭─ a=x== y | ||
│ ││╰─ attrValue.value "x== y" | ||
│ │├─ attrValue "=x== y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
14╭─ a=x=== y | ||
│ ││╰─ attrValue.value "x=== y" | ||
│ │├─ attrValue "=x=== y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
15╭─ a=x!= y | ||
│ ││╰─ attrValue.value "x!= y" | ||
│ │├─ attrValue "=x!= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
16╭─ a=x!== y | ||
│ ││╰─ attrValue.value "x!== y" | ||
│ │├─ attrValue "=x!== y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
17╭─ a=x<= y | ||
│ ││╰─ attrValue.value "x<= y" | ||
│ │├─ attrValue "=x<= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
18╭─ a=x>= y | ||
│ ││╰─ attrValue.value "x>= y" | ||
│ │├─ attrValue "=x>= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
19╭─ a=x&= y | ||
│ ││╰─ attrValue.value "x&= y" | ||
│ │├─ attrValue "=x&= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
20╭─ a=x&&= y | ||
│ ││╰─ attrValue.value "x&&= y" | ||
│ │├─ attrValue "=x&&= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
21╭─ a=x|= y | ||
│ ││╰─ attrValue.value "x|= y" | ||
│ │├─ attrValue "=x|= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
22╭─ a=x||= y | ||
│ ││╰─ attrValue.value "x||= y" | ||
│ │├─ attrValue "=x||= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
23╭─ a=x^= y | ||
│ ││╰─ attrValue.value "x^= y" | ||
│ │├─ attrValue "=x^= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
24╭─ a=x~= y | ||
│ ││╰─ attrValue.value "x~= y" | ||
│ │├─ attrValue "=x~= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
25╭─ a=x>>= y | ||
│ ││╰─ attrValue.value "x>>= y" | ||
│ │├─ attrValue "=x>>= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
26╭─ a=x>>>= y | ||
│ ││╰─ attrValue.value "x>>>= y" | ||
│ │├─ attrValue "=x>>>= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
27╭─ a=x-= y | ||
│ ││╰─ attrValue.value "x-= y" | ||
│ │├─ attrValue "=x-= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
28╭─ a=x/= y | ||
│ ││╰─ attrValue.value "x/= y" | ||
│ │├─ attrValue "=x/= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
29╭─ a=x*= y | ||
│ ││╰─ attrValue.value "x*= y" | ||
│ │├─ attrValue "=x*= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
30╭─ a=x**= y | ||
│ ││╰─ attrValue.value "x**= y" | ||
│ │├─ attrValue "=x**= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
31╭─ a=x%= y | ||
│ ││╰─ attrValue.value "x%= y" | ||
│ │├─ attrValue "=x%= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
32╭─ a=x+= y | ||
│ ││╰─ attrValue.value "x+= y" | ||
│ │├─ attrValue "=x+= y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
33╭─ a=x. y | ||
│ ││╰─ attrValue.value "x. y" | ||
│ │├─ attrValue "=x. y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
34╭─ a=x++ +y | ||
│ ││╰─ attrValue.value "x++ +y" | ||
│ │├─ attrValue "=x++ +y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
35╭─ a=x+ ++y | ||
│ ││╰─ attrValue.value "x+ ++y" | ||
│ │├─ attrValue "=x+ ++y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
36╭─ a=x> y | ||
│ ││╰─ attrValue.value "x> y" | ||
│ │├─ attrValue "=x> y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
37╭─ a=x>> y | ||
│ ││╰─ attrValue.value "x>> y" | ||
│ │├─ attrValue "=x>> y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
38╭─ a=x>>> y | ||
│ ││╰─ attrValue.value "x>>> y" | ||
│ │├─ attrValue "=x>>> y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
39╭─ a=x( y ) | ||
│ ││╰─ attrValue.value "x( y )" | ||
│ │├─ attrValue "=x( y )" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
40╭─ a=z { y } | ||
│ ││╰─ attrValue.value "z { y }" | ||
│ │├─ attrValue "=z { y }" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
41╭─ <a=x[ y ]/> | ||
│ ││││ ╰─ openTagEnd(a) "/>" | ||
│ │││╰─ attrValue.value "x[ y ]" | ||
│ ││├─ attrValue "=x[ y ]" | ||
│ ││╰─ attrName | ||
│ │╰─ tagName | ||
│ ├─ closeTag(a) | ||
╰─ ╰─ openTagEnd(a) | ||
42╭─ a=x=> y z | ||
│ │││ ╰─ attrName | ||
│ ││╰─ attrValue.value "x=> y" | ||
│ │├─ attrValue "=x=> y" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
╰─ ╰─ tagName | ||
43╭─ a=x=> ( y ) z | ||
│ │││ ╰─ attrName | ||
│ ││╰─ attrValue.value "x=> ( y )" | ||
│ │├─ attrValue "=x=> ( y )" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
44╭─ a=x=> { y } z | ||
│ │││ ╰─ attrName | ||
│ ││╰─ attrValue.value "x=> { y }" | ||
│ │├─ attrValue "=x=> { y }" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName | ||
45╭─ a=( x ){ y } z | ||
│ │││ │├─ closeTag(a) | ||
│ │││ │╰─ openTagEnd(a) | ||
│ │││ ╰─ attrName | ||
│ ││╰─ attrValue.value "( x ){ y }" | ||
│ │├─ attrValue "=( x ){ y }" | ||
│ │╰─ attrName | ||
│ ├─ closeTag(a) | ||
│ ├─ openTagEnd(a) | ||
╰─ ╰─ tagName |
45 changes: 45 additions & 0 deletions
45
src/__tests__/fixtures/attr-operators-space-after/input.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
a=x! y | ||
a=x* y | ||
a=x** y | ||
a=x% y | ||
a=x& y | ||
a=x&& y | ||
a=x^ y | ||
a=x~ y | ||
a=x| y | ||
a=x|| y | ||
a=x?? y | ||
a=x? y : z | ||
a=x== y | ||
a=x=== y | ||
a=x!= y | ||
a=x!== y | ||
a=x<= y | ||
a=x>= y | ||
a=x&= y | ||
a=x&&= y | ||
a=x|= y | ||
a=x||= y | ||
a=x^= y | ||
a=x~= y | ||
a=x>>= y | ||
a=x>>>= y | ||
a=x-= y | ||
a=x/= y | ||
a=x*= y | ||
a=x**= y | ||
a=x%= y | ||
a=x+= y | ||
a=x. y | ||
a=x++ +y | ||
a=x+ ++y | ||
a=x> y | ||
a=x>> y | ||
a=x>>> y | ||
a=x( y ) | ||
a=z { y } | ||
<a=x[ y ]/> | ||
a=x=> y z | ||
a=x=> ( y ) z | ||
a=x=> { y } z | ||
a=( x ){ y } z |
Oops, something went wrong.