From 037e8334d4df07bc21cece9e883c60723561fd46 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Tue, 13 Oct 2020 15:49:09 +0800 Subject: [PATCH] Reset modulo precedence. --- doc/src/engine/custom-op.md | 4 ++-- src/token.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/engine/custom-op.md b/doc/src/engine/custom-op.md index 2e98ecc1..bc8ff83f 100644 --- a/doc/src/engine/custom-op.md +++ b/doc/src/engine/custom-op.md @@ -95,8 +95,8 @@ The following _precedence table_ show the built-in precedence of standard Rhai o | Comparisons | `>`, `>=`, `<`, `<=` | 110 | | | `in` | 130 | | Arithmetic | `+`, `-` | 150 | -| Arithmetic | `*`, `/` | 180 | -| Arithmetic | `~`, `%` | 190 | +| Arithmetic | `*`, `/`, `%` | 180 | +| Arithmetic | `~` | 190 | | Bit-shifts | `<<`, `>>` | 210 | | Object | `.` _(binds to right)_ | 240 | | _Others_ | | 0 | diff --git a/src/token.rs b/src/token.rs index fde6a703..428067ef 100644 --- a/src/token.rs +++ b/src/token.rs @@ -623,9 +623,9 @@ impl Token { Plus | Minus => 150, - Divide | Multiply => 180, + Divide | Multiply | Modulo => 180, - PowerOf | Modulo => 190, + PowerOf => 190, LeftShift | RightShift => 210,