From 12fee6158cf98f5fe9de6983f7ab140c94a6c4d8 Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 30 Dec 2016 18:27:34 -0800 Subject: [PATCH] Vector'd expressions don't need to be boxed --- src/eval.rs | 2 +- src/parser.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 {