From 0ad681ccf658256732870b4c59819567e22497c5 Mon Sep 17 00:00:00 2001 From: belliash Date: Thu, 12 Jul 2018 16:15:27 +0200 Subject: [PATCH] There is no fixed rule and XOR has different position in programming languages, but it has surely not higher precedence than AND and not lower than OR --- parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index 0fe80d8..775c557 100644 --- a/parse.c +++ b/parse.c @@ -219,9 +219,9 @@ static const ph7_expr_op aOpTable[] = { /* Precedence 15,left-associative */ { {"&&",sizeof(char)*2}, EXPR_OP_LAND,15, EXPR_OP_ASSOC_LEFT, PH7_OP_LAND}, /* Precedence 16,left-associative */ - { {"||",sizeof(char)*2}, EXPR_OP_LOR, 16, EXPR_OP_ASSOC_LEFT, PH7_OP_LOR}, + { {"^^",sizeof(char)*2}, EXPR_OP_LXOR, 16, EXPR_OP_ASSOC_LEFT, PH7_OP_LXOR}, /* Precedence 17,left-associative */ - { {"^^",sizeof(char)*2}, EXPR_OP_LXOR, 17, EXPR_OP_ASSOC_LEFT, PH7_OP_LXOR}, + { {"||",sizeof(char)*2}, EXPR_OP_LOR, 17, EXPR_OP_ASSOC_LEFT, PH7_OP_LOR}, /* Ternary operator */ /* Precedence 18,left-associative */ { {"?",sizeof(char)}, EXPR_OP_QUESTY, 18, EXPR_OP_ASSOC_LEFT, 0},