Skip to content

Emulate the Structure of Pattern Binding Conditions #729

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

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Sep 8, 2022

The expression parser has to go out of its way to parse all the way down to primary expressions before realizing that the expression pattern it was after isn't actually an expression pattern. This involves setting a bit of ambient state, that we have to plumb down expression parsing.

This is pretty gross, but it emulates what the legacy parser was doing here.

Fixes #724

rdar://99669036

The expression parser has to go out of its way to parse all the
way down to primary expressions before realizing that the expression
pattern it was after isn't actually an expression pattern. This involves
setting a bit of ambient state, that we have to plumb down expression parsing.

This is pretty gross, but it emulates what the legacy parser was doing here.

Fixes swiftlang#724

rdar://99669036
@CodaFi CodaFi requested a review from ahoppen as a code owner September 8, 2022 01:19
@CodaFi
Copy link
Contributor Author

CodaFi commented Sep 8, 2022

@swift-ci test

@CodaFi CodaFi merged commit 23a9650 into swiftlang:main Sep 8, 2022
@CodaFi CodaFi deleted the concrete-structure branch September 8, 2022 04:22
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.

OptionalBindingConditions contain ExpressionPatternSyntaxes instead of IdentifierPatternSyntaxes
1 participant