Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

put parseTagName at toplevel #545

Closed
wants to merge 4 commits into from
Closed

put parseTagName at toplevel #545

wants to merge 4 commits into from

Conversation

cristianoc
Copy link
Contributor

Continuation of #540

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually needs to be specified in order for parseRegion to work.

@@ -336,6 +338,7 @@ let isListElement grammar token =
| JsxAttribute -> isJsxAttributeStart token
| JsFfiImport -> isJsFfiImportStart token
| AttributePayload -> token = Lparen
| TagNames -> token = Hash
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not currently used, as when returning None the current token won't be Hash, but it's good to have it here for later in case the parse tag function changes and does some more refined error recovery after #.

@@ -4995,6 +4983,20 @@ and parsePolymorphicVariantType ~attrs p =
Parser.expect Rbracket p;
variant

and parseTagName p =
Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants