Pattern Matching and Match Statements
sunjay opened this issue · comments
Pretty much required to make #41 usable.
- new match statement added to grammar
- pattern matching on struct fields, tuples, enum variants, etc.
- Ignore struct fields with
..
- Wildcard
_
or identifier to match all - Multiple patterns separated by
|
- Bind names with
@
- irrefutable patterns can be used in assignment or as function parameters
Reference: