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 <kaber@trash.net>
[OP_XOR] = "^",
[OP_LSHIFT] = "<<",
[OP_RSHIFT] = ">>",
- [OP_EQ] = NULL,
+ [OP_EQ] = "==",
[OP_NEQ] = "!=",
[OP_LT] = "<",
[OP_GT] = ">",
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(" ");