From c3d233b1e210922ac6f29afca796b66964e499de Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 15 Jan 2014 15:39:10 +0000 Subject: expr: relational: don't surpress '==' for LHS binops in output This patch changes the output of relational expressions to not surpress the '==' when the LHS is a binop, f.i. ... meta mark & 0x00000003 0x00000001 becomes ... meta mark & 0x00000003 == 0x00000001 Signed-off-by: Patrick McHardy --- src/expression.c | 6 ++++-- 1 file 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(" "); -- cgit v1.2.3