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

这个提交包含在:
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 */
{ {"&&",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},