From 4b2c6334d02d1574aaaef09ddf2c1501075b11fb Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 5 Oct 2021 17:19:48 +0200 Subject: [PATCH] Change precedence of range expression --- src/syntax/expr.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/syntax/expr.rs b/src/syntax/expr.rs index 68b96f9cf..887de8265 100644 --- a/src/syntax/expr.rs +++ b/src/syntax/expr.rs @@ -229,7 +229,7 @@ impl UnOp { pub fn precedence(self) -> usize { match self { Self::Pos | Self::Neg => 8, - Self::Not => 4, + Self::Not => 3, } } @@ -328,10 +328,10 @@ impl BinOp { match self { Self::Mul | Self::Div => 7, Self::Add | Self::Sub => 6, - Self::Eq | Self::Neq | Self::Lt | Self::Leq | Self::Gt | Self::Geq => 5, - Self::And => 4, - Self::Or => 3, - Self::Range => 2, + Self::Range => 5, + Self::Eq | Self::Neq | Self::Lt | Self::Leq | Self::Gt | Self::Geq => 4, + Self::And => 3, + Self::Or => 2, Self::Assign | Self::AddAssign | Self::SubAssign