hotfix:ast:conditional statement display method

This commit is contained in:
detailyang 2021-07-08 16:15:46 +08:00
parent d6c3aec431
commit 85b47651a5

View File

@ -31,7 +31,7 @@ impl fmt::Display for ConditionalStatement {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "if ({}) {}", self.condition, self.block)?;
match self.next.clone() {
Some(n_or_e) => write!(f, " {}", n_or_e),
Some(n_or_e) => write!(f, " else {}", n_or_e),
None => write!(f, ""),
}
}