rhai/doc/src/engine/raw.md

27 lines
1.7 KiB
Markdown
Raw Normal View History

2020-06-20 06:06:17 +02:00
Raw `Engine`
===========
{{#include ../links.md}}
`Engine::new` creates a scripting [`Engine`] with common functionalities (e.g. printing to the console via `print`).
2020-06-20 16:56:56 +02:00
In many controlled embedded environments, however, these may not be needed and unnecessarily occupy
2020-07-21 17:08:46 +02:00
application code storage space.
2020-06-20 16:56:56 +02:00
Use `Engine::new_raw` to create a _raw_ `Engine`, in which only a minimal set of
basic arithmetic and logical operators are supported.
2020-06-20 06:06:17 +02:00
Built-in Operators
------------------
2020-06-20 16:56:56 +02:00
| Operators | Assignment operators | Supported for types (see [standard types]) |
2020-06-20 06:06:17 +02:00
| ------------------------ | ---------------------------- | ----------------------------------------------------------------------------- |
| `+`, | `+=` | `INT`, `FLOAT` (if not [`no_float`]), `ImmutableString` |
| `-`, `*`, `/`, `%`, `~`, | `-=`, `*=`, `/=`, `%=`, `~=` | `INT`, `FLOAT` (if not [`no_float`]) |
| `<<`, `>>`, `^`, | `<<=`, `>>=`, `^=` | `INT` |
2020-06-20 16:56:56 +02:00
| `&`, `|`, | `&=`, `|=` | `INT`, `bool` |
| `&&`, `||` | | `bool` |
2020-06-20 06:06:17 +02:00
| `==`, `!=` | | `INT`, `FLOAT` (if not [`no_float`]), `bool`, `char`, `()`, `ImmutableString` |
| `>`, `>=`, `<`, `<=` | | `INT`, `FLOAT` (if not [`no_float`]), `char`, `()`, `ImmutableString` |