This repository was archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
put parseTagName at toplevel #545
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -58,6 +58,7 @@ type t = | |
| JsFfiImport | ||
| Pattern | ||
| AttributePayload | ||
| TagNames | ||
|
||
let toString = function | ||
| OpenDescription -> "an open description" | ||
|
@@ -118,6 +119,7 @@ let toString = function | |
| Pattern -> "pattern" | ||
| ExprFor -> "a for expression" | ||
| AttributePayload -> "an attribute payload" | ||
| TagNames -> "tag names" | ||
|
||
let isSignatureItemStart = function | ||
| Token.At | ||
|
@@ -336,6 +338,7 @@ let isListElement grammar token = | |
| JsxAttribute -> isJsxAttributeStart token | ||
| JsFfiImport -> isJsFfiImportStart token | ||
| AttributePayload -> token = Lparen | ||
| TagNames -> token = Hash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not currently used, as when returning |
||
| _ -> false | ||
|
||
let isListTerminator grammar token = | ||
|
@@ -361,6 +364,7 @@ let isListTerminator grammar token = | |
| PackageConstraint, token when token <> And -> true | ||
| ConstructorDeclaration, token when token <> Bar -> true | ||
| AttributePayload, Rparen -> true | ||
| TagNames, Rbracket -> true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This actually needs to be specified in order for |
||
|
||
| _ -> false | ||
|
||
|
9 changes: 9 additions & 0 deletions
9
tests/parsing/infiniteLoops/expected/polymorphicVariantType.res.txt
This file contains hidden or 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,9 @@ | ||
|
||
Syntax error! | ||
tests/parsing/infiniteLoops/polymorphicVariantType.res:1:14 | ||
|
||
1 │ type x = [<y> | ||
|
||
Did you forget a `]` here? | ||
|
||
type nonrec x = [< y] |
This file contains hidden or 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 @@ | ||
type x = [<y> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be at toplevel for the analysis to find them.
The restriction seems OK for this use case.