Better handling of reserved keywords.

This commit is contained in:
Stephen Chung
2020-07-26 22:25:30 +08:00
parent ce20248792
commit ec5082c328
6 changed files with 80 additions and 28 deletions

View File

@@ -43,8 +43,9 @@ Reserved Keywords
| `static` | Variable declaration |
| `do` | Looping |
| `each` | Looping |
| `then` | Conditional |
| `goto` | Jump |
| `then` | Control flow |
| `goto` | Control flow |
| `exit` | Control flow |
| `switch` | Matching |
| `match` | Matching |
| `case` | Matching |

View File

@@ -9,7 +9,7 @@ The following are reserved keywords in Rhai:
| ------------------------------------------------- | ---------------------------------------- | --------------------- | :--------------------: |
| `true`, `false` | | Boolean constants | |
| `let`, `const` | `var`, `static` | Variable declarations | |
| `if`, `else` | `then`, `goto` | Control flow | |
| `if`, `else` | `then`, `goto`, `exit` | Control flow | |
| | `switch`, `match`, `case` | Matching | |
| `while`, `loop`, `for`, `in`, `continue`, `break` | `do`, `each` | Looping | |
| `fn`, `private` | `public`, `new` | Functions | [`no_function`] |