2020-06-20 06:06:17 +02:00
|
|
|
Keywords
|
|
|
|
========
|
|
|
|
|
|
|
|
{{#include ../links.md}}
|
|
|
|
|
|
|
|
The following are reserved keywords in Rhai:
|
|
|
|
|
2020-07-31 11:07:09 +02:00
|
|
|
| Active keywords | Reserved keywords | Usage | Inactive under feature |
|
|
|
|
| ------------------------------------------------- | ------------------------------------------------ | --------------------- | :--------------------: |
|
2020-09-24 05:17:39 +02:00
|
|
|
| `true`, `false` | | boolean constants | |
|
|
|
|
| `let`, `const` | `var`, `static` | variable declarations | |
|
|
|
|
| `is_shared` | | shared values | [`no_closure`] |
|
|
|
|
| `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`] |
|
|
|
|
| `return` | | return values | |
|
|
|
|
| `throw` | `try`, `catch` | throw exceptions | |
|
|
|
|
| `import`, `export`, `as` | `use`, `with`, `module`, `package` | modules/packages | [`no_module`] |
|
|
|
|
| `Fn`, `call`, `curry` | | function pointers | |
|
|
|
|
| | `spawn`, `go`, `sync`, `async`, `await`, `yield` | threading/async | |
|
|
|
|
| `type_of`, `print`, `debug`, `eval` | | special functions | |
|
|
|
|
| | `default`, `void`, `null`, `nil` | special values | |
|
2020-07-26 15:57:30 +02:00
|
|
|
|
|
|
|
Keywords cannot become the name of a [function] or [variable], even when they are disabled.
|