use crate::ast;
pub(crate) trait SigStatement {
fn significant(&self) -> bool;
}
impl SigStatement for ast::Seq {
fn significant(&self) -> bool {
for sub in &self.subnodes {
if sub.significant() {
return true;
}
}
false
}
}
impl SigStatement for ast::Body {
fn significant(&self) -> bool {
use ast::Body::*;
match self {
Bare(s) => s.significant(),
Single(_, s) => s.significant(),
Guard(_, s) => s.significant(),
}
}
}
impl SigStatement for ast::Statement {
fn significant(&self) -> bool {
use ast::Statement::*;
matches!(self, Print(_) | Read(_) | Write(_) | Exec(_))
}
}