mild cleanup
parent
0ef99c9095
commit
e24bbe91ca
25
src/main.rs
25
src/main.rs
|
|
@ -63,16 +63,16 @@ impl Program<'_> {
|
|||
return program
|
||||
}
|
||||
|
||||
fn should_skip(term: &str) -> bool {
|
||||
if term == "program" {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
fn digest(&self, tree: &ParseTree) {
|
||||
|
||||
if tree.lhs.to_string() == "<program$1>" {
|
||||
self.digest_1(tree);
|
||||
return;
|
||||
} else if tree.lhs.to_string() == "<unit>" {
|
||||
self.digest_unit(tree);
|
||||
return;
|
||||
}
|
||||
|
||||
println!("Program::digest {}", tree.lhs.to_string());
|
||||
// mut because that recursion could get nasty.
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ impl Program<'_> {
|
|||
continue;
|
||||
}
|
||||
if tree.lhs.to_string() == "<program$1>" {
|
||||
self.digest_1(tree);
|
||||
self.digest(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -105,12 +105,7 @@ impl Program<'_> {
|
|||
if tree.lhs.to_string().starts_with("<_") {
|
||||
continue;
|
||||
}
|
||||
if tree.lhs.to_string() == "<program$1>" {
|
||||
self.digest_1(tree);
|
||||
}
|
||||
if tree.lhs.to_string() == "<unit>" {
|
||||
self.digest_unit(tree);
|
||||
}
|
||||
self.digest(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue