Returns the priority of this operator. The specific number's meaning is only valid when comparing it against other calls to this function. Higher number imply higher priority.
(&self)
| 155 | /// Returns the priority of this operator. The specific number's meaning is only valid when |
| 156 | /// comparing it against other calls to this function. Higher number imply higher priority. |
| 157 | fn priority(&self) -> i8 { |
| 158 | match self { |
| 159 | ExprOp::LeftParen => 6, |
| 160 | ExprOp::Power => 6, |
| 161 | |
| 162 | ExprOp::Negate => 5, |
| 163 | ExprOp::Not => 5, |
| 164 | |
| 165 | ExprOp::Multiply => 4, |
| 166 | ExprOp::Divide => 4, |
| 167 | ExprOp::Modulo => 4, |
| 168 | |
| 169 | ExprOp::Add => 3, |
| 170 | ExprOp::Subtract => 3, |
| 171 | |
| 172 | ExprOp::ShiftLeft => 2, |
| 173 | ExprOp::ShiftRight => 2, |
| 174 | |
| 175 | ExprOp::Equal => 1, |
| 176 | ExprOp::NotEqual => 1, |
| 177 | ExprOp::Less => 1, |
| 178 | ExprOp::LessEqual => 1, |
| 179 | ExprOp::Greater => 1, |
| 180 | ExprOp::GreaterEqual => 1, |
| 181 | |
| 182 | ExprOp::And => 0, |
| 183 | ExprOp::Or => 0, |
| 184 | ExprOp::Xor => 0, |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | /// An expression operator paired with its source position. |