Merge pull request #5412 from aybeedee/precedence-fix

fixed precedence difference for && || operators
This commit is contained in:
Brendan Hansknecht 2023-05-15 20:37:13 +00:00 committed by GitHub
commit 1fe4aae19d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,21 +4,21 @@ use std::cmp::Ordering;
use std::fmt;
const PRECEDENCES: [(BinOp, u8); 20] = [
(Caret, 7),
(Star, 6),
(Slash, 6),
(DoubleSlash, 5),
(Percent, 5),
(Plus, 4),
(Minus, 4),
(Pizza, 3),
(Equals, 2),
(NotEquals, 2),
(LessThan, 1),
(GreaterThan, 1),
(LessThanOrEq, 1),
(GreaterThanOrEq, 1),
(And, 0),
(Caret, 8),
(Star, 7),
(Slash, 7),
(DoubleSlash, 6),
(Percent, 6),
(Plus, 5),
(Minus, 5),
(Pizza, 4),
(Equals, 3),
(NotEquals, 3),
(LessThan, 2),
(GreaterThan, 2),
(LessThanOrEq, 2),
(GreaterThanOrEq, 2),
(And, 1),
(Or, 0),
// These should never come up
(Assignment, 255),