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:
父節點
5ad57f6740
當前提交
0ad681ccf6
4
parse.c
4
parse.c
@ -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},
|
||||||
|
載入中…
x
新增問題並參考
Block a user