diff --git a/src/eval.rs b/src/eval.rs index c322dbd..60a76d0 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -203,7 +203,7 @@ impl Evaluator { (Call(name, args), None) } } - Conditional(_, _, _) => unimplemented!(), + Conditional(box test, then_block, else_block) => unimplemented!(), } } diff --git a/src/parser.rs b/src/parser.rs index 23de52d..a39b5a0 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -45,7 +45,7 @@ pub enum Expression { Variable(String), BinExp(String, Box, Box), Call(String, Vec), - Conditional(Box, Box>, Option>>), + Conditional(Box, Vec, Option>), } impl fmt::Display for ASTNode { @@ -349,13 +349,13 @@ impl Parser { } } } - Some(Box::new(else_exprs)) + Some(else_exprs) } else { None }; expect!(self, Keyword(Kw::End)); - Ok(Expression::Conditional(Box::new(test), Box::new(then_block), else_block)) + Ok(Expression::Conditional(Box::new(test), then_block, else_block)) } fn identifier_expr(&mut self) -> ParseResult {