rhai/doc/src/language/keywords.md

26 lines
2.6 KiB
Markdown
Raw Normal View History

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 |
| ------------------------------------------------- | ------------------------------------------------ | --------------------- | :--------------------: |
| `true`, `false` | | Boolean constants | |
| `let`, `const` | `var`, `static` | Variable declarations | |
2020-07-31 12:43:34 +02:00
| `shared`, `take`, `is_shared` | | Shared values | [`no_shared`] |
2020-07-31 11:07:09 +02:00
| `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.