Make Evaluable trait
This commit is contained in:
parent
16e8d969be
commit
5a9ebb188d
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user