mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Introduce Pattern
This commit is contained in:
parent
89c71e9c1d
commit
91aac9a86e
3 changed files with 53 additions and 32 deletions
10
src/expr.rs
10
src/expr.rs
|
@ -8,7 +8,8 @@ pub enum Expr {
|
|||
Char(char),
|
||||
|
||||
Var(String),
|
||||
Let(String, Box<Expr>, Box<Expr>),
|
||||
Let(Pattern, Box<Expr>, Box<Expr>),
|
||||
Pattern(Pattern),
|
||||
|
||||
// Functions
|
||||
Func(String, Box<Expr>),
|
||||
|
@ -18,6 +19,13 @@ pub enum Expr {
|
|||
If(Box<Expr>, Box<Expr>, Box<Expr>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Pattern {
|
||||
Identifier(String),
|
||||
Underscore
|
||||
}
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub enum Operator {
|
||||
Plus, Minus, Star, Slash, DoubleSlash, Equals,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue