diff --git a/schala-lang/src/reduced_ast.rs b/schala-lang/src/reduced_ast.rs index 5cf92e3..3eb7bf2 100644 --- a/schala-lang/src/reduced_ast.rs +++ b/schala-lang/src/reduced_ast.rs @@ -58,6 +58,7 @@ pub enum Expr { #[derive(Debug, Clone)] pub struct Alternative { pub tag: Option, + pub guard: Option, pub bound_vars: Vec>>, //remember that order matters here pub item: Vec, } @@ -159,6 +160,7 @@ fn reduce_if_expression(discriminator: &Discriminator, body: &IfExpressionBody, pat.to_alternative(then_clause, symbol_table), Alternative { tag: None, + guard: None, bound_vars: vec![], item: else_clause, }, @@ -201,6 +203,7 @@ impl Pattern { }).collect(); Alternative { tag: Some(tag), + guard: None, bound_vars, item, }