Make Evaluable trait

This commit is contained in:
greg 2016-01-19 01:30:48 -08:00
parent 16e8d969be
commit 5a9ebb188d

View File

@ -17,6 +17,12 @@ impl Evaluator {
} }
} }
trait Evaluable {
type Output;
fn is_reducible(&self) -> bool;
fn reduce(self) -> Self::Output;
}
impl Evaluator { impl Evaluator {
fn reduce_node(&mut self, mut node: ASTNode) -> String { fn reduce_node(&mut self, mut node: ASTNode) -> String {
loop { loop {