Don't bother emitting else part if it's empty

This commit is contained in:
Nick Gasson 2008-06-16 19:53:42 +01:00
parent 8d0afa632d
commit ae0b09dd3a
1 changed files with 4 additions and 2 deletions

View File

@ -631,8 +631,10 @@ void vhdl_if_stmt::emit(std::ofstream &of, int level) const
test_->emit(of, level);
of << " then";
then_part_.emit(of, level);
of << "else";
else_part_.emit(of, level);
if (!else_part_.empty()) {
of << "else";
else_part_.emit(of, level);
}
of << "end if;";
}