mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Add variants
This commit is contained in:
parent
1aaab2dc17
commit
7aab332650
3 changed files with 91 additions and 14 deletions
|
@ -19,6 +19,10 @@ pub enum Expr {
|
|||
Operator(Box<Expr>, Operator, Box<Expr>),
|
||||
Closure(Vec<Pattern>, Box<Expr>),
|
||||
|
||||
// Sum Types
|
||||
ApplyVariant(String, Option<Vec<Expr>>),
|
||||
|
||||
|
||||
If(Box<Expr>, Box<Expr>, Box<Expr>),
|
||||
Error(Problem),
|
||||
}
|
||||
|
@ -80,6 +84,7 @@ pub enum Problem {
|
|||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Pattern {
|
||||
Identifier(String),
|
||||
Variant(String, Option<Vec<Pattern>>),
|
||||
Underscore
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue