mild cleanup

stable
Ivory 2023-06-03 23:08:46 -04:00
parent 0ef99c9095
commit e24bbe91ca
1 changed files with 10 additions and 15 deletions

View File

@ -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);
}
}
}