summaryrefslogtreecommitdiffstats
path: root/src/expression.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expression.c')
-rw-r--r--src/expression.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expression.c b/src/expression.c
index 71154cc6..518f71c8 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -356,7 +356,7 @@ const char *expr_op_symbols[] = {
[OP_XOR] = "^",
[OP_LSHIFT] = "<<",
[OP_RSHIFT] = ">>",
- [OP_EQ] = NULL,
+ [OP_EQ] = "==",
[OP_NEQ] = "!=",
[OP_LT] = "<",
[OP_GT] = ">",
@@ -407,7 +407,9 @@ struct expr *unary_expr_alloc(const struct location *loc,
static void binop_expr_print(const struct expr *expr)
{
expr_print(expr->left);
- if (expr_op_symbols[expr->op] != NULL)
+ if (expr_op_symbols[expr->op] &&
+ (expr->op != OP_EQ ||
+ expr->left->ops->type == EXPR_BINOP))
printf(" %s ", expr_op_symbols[expr->op]);
else
printf(" ");