-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Implement OR match pattern #4348
Merged
Merged
Conversation
This file contains 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
IGI-111
force-pushed
the
IGI-111/or-match-pattern
branch
3 times, most recently
from
March 27, 2023 09:06
0b08704
to
b0d9a17
Compare
mohammadfawaz
added
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler: parser
Everything to do with the parser
labels
Apr 6, 2023
IGI-111
force-pushed
the
IGI-111/or-match-pattern
branch
5 times, most recently
from
April 12, 2023 13:37
ef3e4b8
to
de96d33
Compare
IGI-111
force-pushed
the
IGI-111/or-match-pattern
branch
4 times, most recently
from
April 12, 2023 22:54
92892e3
to
a561a3f
Compare
JoshuaBatty
reviewed
Apr 12, 2023
JoshuaBatty
reviewed
Apr 12, 2023
sway-core/src/semantic_analysis/ast_node/expression/match_expression/analysis/witness_report.rs
Outdated
Show resolved
Hide resolved
IGI-111
force-pushed
the
IGI-111/or-match-pattern
branch
from
April 12, 2023 23:15
30b611f
to
632d331
Compare
Allow users to specify match patters such as: ```sway let x = 1; match x { 0 | 1 => true, _ => false } ``` We also check that all patterns in a disjunction declare the same set of variables (not doing so is an error). Fix #769 This requires a change in the pattern matching analysis to remove the assumption that a specialized matrix of a vector pattern is always a vector, which is now no longer true because or patterns can generate multiple branches and therefore multiple rows.
IGI-111
force-pushed
the
IGI-111/or-match-pattern
branch
from
April 12, 2023 23:27
632d331
to
9007612
Compare
JoshuaBatty
approved these changes
Apr 13, 2023
tritao
approved these changes
Apr 17, 2023
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.
Didn't review the matrix code as I'm not familiar with that part of the code, but everything else lgtm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler: parser
Everything to do with the parser
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.
Description
Allow users to specify match patters such as:
We also check that all patterns in a disjunction declare the same set of
variables (not doing so is an error).
Fix #769
This requires a change in the pattern matching analysis to remove the
assumption that a specialized matrix of a vector pattern is always a
vector, which is now no longer true because or patterns can generate
multiple branches and therefore multiple rows.
Checklist
Breaking*
orNew Feature
labels where relevant.