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

Loosen the restrictions around directly assignable expressions #324

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

alex-pinkus
Copy link
Owner

@alex-pinkus alex-pinkus commented Oct 8, 2023

We currently only allow a subset of expressions to be used as the target of assignment. The Swift compiler also only allows a subset, but keeping track of their subset is hard. For example, in #321 we see that an optional expression can be used for assignment but we don't currently support that.

Let's get out of that game. All expressions can be assignments now! Sure, that doesn't work for the real swift compiler, but that's not our circus, and furthermore, not our monkeys.

Fixes #321

We currently only allow a subset of expressions to be used as the target
of assignment. The Swift compiler also only allows a subset, but keeping
track of their subset is hard. For example, in #321 we see that an
optional expression can be used for assignment but we don't currently
support that.

Let's get out of that game. All expressions can be assignments now!
Sure, that doesn't work for the real swift compiler, but that's not our
circus, and furthermore, not our monkeys.
@alex-pinkus alex-pinkus merged commit 597d544 into main Oct 9, 2023
@alex-pinkus alex-pinkus deleted the optional-assignment branch October 9, 2023 00:41
@nmote
Copy link
Contributor

nmote commented Oct 9, 2023

Well, that's a lot simpler than what I tried! Makes sense to me. Thanks so much for addressing this!

nmote added a commit to semgrep/ocaml-tree-sitter-semgrep that referenced this pull request Oct 9, 2023
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.

Optional assignment fails to parse
2 participants