mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Add support for pattern matching on numbers
This commit is contained in:
parent
0062e83d03
commit
6afeedf10e
3 changed files with 118 additions and 1 deletions
|
@ -101,6 +101,7 @@ pub enum Problem {
|
|||
TypeMismatch(String),
|
||||
ReassignedVarName(String),
|
||||
WrongArity(u32 /* Expected */, u32 /* Provided */),
|
||||
NotEqual, // Used when (for example) a string literal pattern match fails
|
||||
NoBranchesMatched,
|
||||
}
|
||||
|
||||
|
@ -108,6 +109,8 @@ pub enum Problem {
|
|||
pub enum Pattern {
|
||||
Identifier(String),
|
||||
Variant(String, Option<Vec<Pattern>>),
|
||||
Integer(i64),
|
||||
Fraction(i64, u64),
|
||||
EmptyRecord,
|
||||
Underscore
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue