commit 1b7b5620e1df65204142cb7b1735e5f4d550a946
parent d30f6012cfcd7ef95afabe0ae38a6875adb23d4a
Author: Drew DeVault <sir@cmpwn.com>
Date: Thu, 15 Apr 2021 12:21:24 -0400
hare::parse: make precedence more concise
Diffstat:
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/hare/parse/expr.ha b/hare/parse/expr.ha
@@ -212,22 +212,14 @@ fn precedence(tok: lex::token) int = switch (tok.0) {
ltok::LOR => 0,
ltok::LXOR => 1,
ltok::LAND => 2,
- ltok::LEQUAL,
- ltok::NEQUAL => 3,
- ltok::LESS,
- ltok::LESSEQ,
- ltok::GREATER,
- ltok::GREATEREQ => 4,
+ ltok::LEQUAL, ltok::NEQUAL => 3,
+ ltok::LESS, ltok::LESSEQ, ltok::GREATER, ltok::GREATEREQ => 4,
ltok::BOR => 5,
ltok::BXOR => 6,
ltok::BAND => 7,
- ltok::LSHIFT,
- ltok::RSHIFT => 8,
- ltok::PLUS,
- ltok::MINUS => 9,
- ltok::TIMES,
- ltok::DIV,
- ltok::MODULO => 10,
+ ltok::LSHIFT, ltok::RSHIFT => 8,
+ ltok::PLUS, ltok::MINUS => 9,
+ ltok::TIMES, ltok::DIV, ltok::MODULO => 10,
* => -1,
};