Raise precedence of ~ and %.

This commit is contained in:
Stephen Chung 2020-10-13 09:33:16 +08:00
parent e6667a3996
commit 0b4129fb98
2 changed files with 5 additions and 2 deletions

View File

@ -95,7 +95,8 @@ The following _precedence table_ show the built-in precedence of standard Rhai o
| Comparisons | `>`, `>=`, `<`, `<=` | 110 |
| | `in` | 130 |
| Arithmetic | `+`, `-` | 150 |
| Arithmetic | `*`, `/`, `~`, `%` | 180 |
| Arithmetic | `*`, `/` | 180 |
| Arithmetic | `~`, `%` | 190 |
| Bit-shifts | `<<`, `>>` | 210 |
| Object | `.` _(binds to right)_ | 240 |
| _Others_ | | 0 |

View File

@ -623,7 +623,9 @@ impl Token {
Plus | Minus => 150,
Divide | Multiply | PowerOf | Modulo => 180,
Divide | Multiply => 180,
PowerOf | Modulo => 190,
LeftShift | RightShift => 210,