-
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: ensure type args directly follow tag name (#152)
* fix: ensure type args directly follow tag name
- Loading branch information
1 parent
210427c
commit ea65c9f
Showing
13 changed files
with
226 additions
and
211 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"htmljs-parser": minor | ||
--- | ||
|
||
Improve handling ambiguity with tag type args vs type params. Type args must now always be directly adjacent the tag name, otherwise it will become type params. |
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
6 changes: 1 addition & 5 deletions
6
..._/fixtures/attr-name-with-html-chars/__snapshots__/attr-name-with-html-chars.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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
1╭─ tagname <span>hello frank</span> | ||
│ │ ││ │ │ ╰─ error(INVALID_ATTR_TYPE_PARAMS:Attribute cannot contain type parameters unless it is a shorthand method) "/span" | ||
│ │ ││ │ ╰─ attrName "frank" | ||
│ │ ││ ╰─ attrName "hello" | ||
│ │ │╰─ tagTypeArgs.value "span" | ||
│ │ ╰─ tagTypeArgs "<span>" | ||
│ │ ╰─ error(INVALID_TAG_TYPES:Unexpected types. Type arguments must directly follow a tag name and type paremeters must precede a method or tag parameters.) "span" | ||
╰─ ╰─ tagName "tagname" |
2 changes: 1 addition & 1 deletion
2
...alid-multiple-tag-type-params/__snapshots__/invalid-multiple-tag-type-params.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
7 changes: 7 additions & 0 deletions
7
...es/invalid-type-args-after-space/__snapshots__/invalid-type-args-after-space.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,7 @@ | ||
1╭─ <foo <A>> | ||
│ ││ ╰─ error(INVALID_TAG_TYPES:Unexpected types. Type arguments must directly follow a tag name and type paremeters must precede a method or tag parameters.) | ||
│ │╰─ tagName "foo" | ||
╰─ ╰─ openTagStart | ||
2├─ hi | ||
3├─ </> | ||
4╰─ |
3 changes: 3 additions & 0 deletions
3
src/__tests__/fixtures/invalid-type-args-after-space/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,3 @@ | ||
<foo <A>> | ||
hi | ||
</> |
2 changes: 1 addition & 1 deletion
2
.../invalid-type-params-after-args/__snapshots__/invalid-type-params-after-args.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
2 changes: 1 addition & 1 deletion
2
...alid-type-params-after-params/__snapshots__/invalid-type-params-after-params.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
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
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
Oops, something went wrong.