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

This commit is contained in:
Rafal Kupiec 2018-07-12 16:15:27 +02:00
父節點 5ad57f6740
當前提交 0ad681ccf6
簽署人: belliash
GPG 金鑰 ID: 4E829243E0CFE6B4

查看文件

@ -219,9 +219,9 @@ static const ph7_expr_op aOpTable[] = {
/* Precedence 15,left-associative */ /* Precedence 15,left-associative */
{ {"&&",sizeof(char)*2}, EXPR_OP_LAND,15, EXPR_OP_ASSOC_LEFT, PH7_OP_LAND}, { {"&&",sizeof(char)*2}, EXPR_OP_LAND,15, EXPR_OP_ASSOC_LEFT, PH7_OP_LAND},
/* Precedence 16,left-associative */ /* 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 */ /* 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 */ /* Ternary operator */
/* Precedence 18,left-associative */ /* Precedence 18,left-associative */
{ {"?",sizeof(char)}, EXPR_OP_QUESTY, 18, EXPR_OP_ASSOC_LEFT, 0}, { {"?",sizeof(char)}, EXPR_OP_QUESTY, 18, EXPR_OP_ASSOC_LEFT, 0},