gengine icon indicating copy to clipboard operation
gengine copied to clipboard

&& || 的优先级反人类呀

Open xujingshi opened this issue 4 years ago • 1 comments

true || true && false 返回false 正常不是应该&& 优先级高于||吗

xujingshi avatar Apr 14 '22 04:04 xujingshi

规则中 && 和 || 优先级相同,从左到右依次计算 a==1 && b==2 || c==3 --> (((a==1) && (b==2)) || (c==3)) 如果想要符合正常优先级,可使用括号true || (true && false) 或修改parser解析时的优先级权重

Gu-f avatar May 27 '22 06:05 Gu-f