rhai/doc/src/language/keywords.md

22 lines
1.4 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:
| Keywords | Usage | Not available under feature |
| ------------------------------------------------- | --------------------- | :-------------------------: |
| `true`, `false` | Boolean constants | |
| `let`, `const` | Variable declarations | |
| `if`, `else` | Control flow | |
| `while`, `loop`, `for`, `in`, `continue`, `break` | Looping | |
| `fn`, `private` | Functions | [`no_function`] |
| `return` | Return values | |
2020-06-25 05:07:56 +02:00
| `throw` | throw exceptions | |
2020-06-20 06:06:17 +02:00
| `import`, `export`, `as` | Modules | [`no_module`] |
2020-06-25 05:07:56 +02:00
| `type_of`, `print`, `debug`, `eval` | Special functions | |
2020-06-20 06:06:17 +02:00
2020-06-25 05:07:56 +02:00
Keywords cannot be the name of a [function] or [variable], unless the relevant feature is enabled.
2020-06-20 06:06:17 +02:00
For example, `fn` is a valid variable name under [`no_function`].