Vector'd expressions don't need to be boxed
This commit is contained in:
parent
2d21de7cc3
commit
12fee6158c
@ -203,7 +203,7 @@ impl Evaluator {
|
||||
(Call(name, args), None)
|
||||
}
|
||||
}
|
||||
Conditional(_, _, _) => unimplemented!(),
|
||||
Conditional(box test, then_block, else_block) => unimplemented!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ pub enum Expression {
|
||||
Variable(String),
|
||||
BinExp(String, Box<Expression>, Box<Expression>),
|
||||
Call(String, Vec<Expression>),
|
||||
Conditional(Box<Expression>, Box<Vec<Expression>>, Option<Box<Vec<Expression>>>),
|
||||
Conditional(Box<Expression>, Vec<Expression>, Option<Vec<Expression>>),
|
||||
}
|
||||
|
||||
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<Expression> {
|
||||
|
Loading…
Reference in New Issue
Block a user