Properly parenthesise unary operators

This commit is contained in:
Nick Gasson 2008-07-04 11:17:24 +01:00
parent 409fc4dc19
commit 88816e150a
1 changed files with 2 additions and 0 deletions

View File

@ -655,12 +655,14 @@ vhdl_unaryop_expr::~vhdl_unaryop_expr()
void vhdl_unaryop_expr::emit(std::ostream &of, int level) const
{
of << "(";
switch (op_) {
case VHDL_UNARYOP_NOT:
of << "not ";
break;
}
operand_->emit(of, level);
of << ")";
}
vhdl_binop_expr::vhdl_binop_expr(vhdl_expr *left, vhdl_binop_t op,