Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parse ambiguity with types in navigation expressions #360

Closed
wants to merge 1 commit into from

Conversation

alex-pinkus
Copy link
Owner

No description provided.

@alex-pinkus
Copy link
Owner Author

Ok, let’s come back to this then lol

alex-pinkus added a commit that referenced this pull request Mar 3, 2024
In #353, adding `_parenthesized_type` caused new parse failures where
the parser now resolved away from `tuple_type` too early. Specifically,
when parsing an expression like `[(any Foo) ...`, the `tuple_type`
interpretation must still be valid at that point in the expression in
case we're about to see a `?`.

The truly robust thing to do would be to support `$.tuple_type` as the
target of the navigation expression. However, this leads to a large
number of additional parse failures, as seen in #360. To avoid all of
that, we add support in the opposite direction: allow `tuple_type` to be
resolved using `_parenthesized_type`, so that the parser seeing the
latter does not cause it to invalidate the former.
alex-pinkus added a commit that referenced this pull request Mar 3, 2024
In #353, adding `_parenthesized_type` caused new parse failures where
the parser now resolved away from `tuple_type` too early. Specifically,
when parsing an expression like `[(any Foo) ...`, the `tuple_type`
interpretation must still be valid at that point in the expression in
case we're about to see a `?`.

The truly robust thing to do would be to support `$.tuple_type` as the
target of the navigation expression. However, this leads to a large
number of additional parse failures, as seen in #360. To avoid all of
that, we add support in the opposite direction: allow `tuple_type` to be
resolved using `_parenthesized_type`, so that the parser seeing the
latter does not cause it to invalidate the former.
@alex-pinkus alex-pinkus deleted the types-in-navigation branch March 3, 2024 23:32
@alex-pinkus
Copy link
Owner Author

Fixed in #366

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

Successfully merging this pull request may close these issues.

1 participant