Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xujingshi opened this issue Apr 14, 2022 · 1 comment
Open

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

xujingshi opened this issue Apr 14, 2022 · 1 comment

Comments

@xujingshi
Copy link

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

@Gu-f
Copy link

Gu-f commented May 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants