@ -10,6 +10,8 @@ Rhai - Embedded Scripting for Rust
|
||||
[![chat](https://img.shields.io/discord/767611025456889857.svg?logo=discord)](https://discord.gg/HquqbYFcZ9)
|
||||
[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/Rhai?logo=reddit)](https://www.reddit.com/r/Rhai)
|
||||
|
||||
![Rhai logo](https://schungx.github.io/rhai/images/logo/rhai-banner-transparent-colour.svg)
|
||||
|
||||
Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way
|
||||
to add scripting to any application.
|
||||
|
||||
|
@ -16,6 +16,7 @@ Bug fixes
|
||||
* Constants are no longer propagated by the optimizer if shadowed by a non-constant variable.
|
||||
* Constants passed as the `this` parameter to Rhai functions now throws an error if assigned to.
|
||||
* Generic type parameter of `Engine::register_iterator` is `IntoIterator` instead of `Iterator`.
|
||||
* Fixes parsing of block comments ending with `**/` or inner blocks starting with `//*`.
|
||||
|
||||
Breaking changes
|
||||
----------------
|
||||
|
@ -489,7 +489,7 @@ mod generate_tests {
|
||||
};
|
||||
|
||||
let expected_tokens = quote! {
|
||||
impl PluginFunction for MyType {
|
||||
impl PluginFunction for TestStruct {
|
||||
fn call(&self, context: NativeCallContext, args: &mut [&mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>> {
|
||||
debug_assert_eq!(args.len(), 1usize,
|
||||
"wrong arg count: {} != {}", args.len(), 1usize);
|
||||
@ -499,7 +499,7 @@ mod generate_tests {
|
||||
|
||||
fn is_method_call(&self) -> bool { false }
|
||||
fn is_variadic(&self) -> bool { false }
|
||||
fn clone_boxed(&self) -> Box<dyn PluginFunction> { Box::new(MyType()) }
|
||||
fn clone_boxed(&self) -> Box<dyn PluginFunction> { Box::new(TestStruct()) }
|
||||
fn input_names(&self) -> Box<[&'static str]> {
|
||||
new_vec!["x: usize"].into_boxed_slice()
|
||||
}
|
||||
@ -513,7 +513,7 @@ mod generate_tests {
|
||||
};
|
||||
|
||||
let item_fn = syn::parse2::<ExportedFn>(input_tokens).unwrap();
|
||||
assert_streams_eq(item_fn.generate_impl("MyType"), expected_tokens);
|
||||
assert_streams_eq(item_fn.generate_impl("TestStruct"), expected_tokens);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -3,7 +3,7 @@ What is Rhai
|
||||
|
||||
{{#include ../links.md}}
|
||||
|
||||
![Rhai Logo]({{rootUrl}}/images/rhai_logo.png)
|
||||
![Rhai Logo]({{rootUrl}}/images/logo/rhai-banner-transparent-colour.svg)
|
||||
|
||||
Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way
|
||||
to add scripting to any application.
|
||||
@ -35,9 +35,12 @@ and, in particular, a popular kind of milk tea consumed in India.
|
||||
Later, when the novel implementation technique behind ChaiScript was ported from C++ to Rust,
|
||||
logically the `C` was changed to an `R` to make it "RhaiScript", or just "Rhai".
|
||||
|
||||
### On the origin of the temporary Rhai logo
|
||||
### On the origin of the semi-official Rhai logo
|
||||
|
||||
One of Rhai's maintainers, Stephen Chung, was thinking about a logo when he accidentally
|
||||
came across a copy of _Catcher in the Rye_ in a restaurant. The rest was history.
|
||||
One of Rhai's maintainers, [Stephen Chung](https://github.com/schungx), was thinking about a logo when he accidentally
|
||||
came across a copy of _Catcher in the Rye_ in a restaurant, and drew the first version
|
||||
of the logo.
|
||||
|
||||
It is temporary until it becomes official, that is...
|
||||
Then [`@semirix`](https://github.com/semirix) refined it to the current version.
|
||||
|
||||
The plan is to make the logo official together with a `1.0` release.
|
||||
|
@ -10,16 +10,16 @@ Operators
|
||||
| Operator | Description | Binary? | Binding direction |
|
||||
| :-----------------------------------------------------------------------------------------: | -------------------------------------- | :--------: | :---------------: |
|
||||
| `+` | add | yes | left |
|
||||
| `-` | 1) subtract<br/>2) negative | yes<br/>no | left<br/>right |
|
||||
| `-` | 1) subtract<br/>2) negative (prefix) | yes<br/>no | left<br/>right |
|
||||
| `*` | multiply | yes | left |
|
||||
| `/` | divide | yes | left |
|
||||
| `%` | modulo | yes | left |
|
||||
| `~` | power | yes | left |
|
||||
| `>>` | right bit-shift | yes | left |
|
||||
| `<<` | left bit-shift | yes | left |
|
||||
| `&` | 1) bit-wise _And_<br/>2) boolean _And_ | yes | left |
|
||||
| <code>\|</code> | 1) bit-wise _Or_<br/>2) boolean _Or_ | yes | left |
|
||||
| `^` | 1) bit-wise _Xor_<br/>2) boolean _Xor_ | yes | left |
|
||||
| `&` | 1) bit-wise _AND_<br/>2) boolean _AND_ | yes | left |
|
||||
| <code>\|</code> | 1) bit-wise _OR_<br/>2) boolean _OR_ | yes | left |
|
||||
| `^` | 1) bit-wise _XOR_<br/>2) boolean _XOR_ | yes | left |
|
||||
| `=`, `+=`, `-=`, `*=`, `/=`,<br/>`~=`, `%=`, `<<=`, `>>=`, `&=`,<br/><code>\|=</code>, `^=` | assignments | yes | right |
|
||||
| `==` | equals to | yes | left |
|
||||
| `~=` | not equals to | yes | left |
|
||||
@ -27,9 +27,9 @@ Operators
|
||||
| `>=` | greater than or equals to | yes | left |
|
||||
| `<` | less than | yes | left |
|
||||
| `<=` | less than or equals to | yes | left |
|
||||
| `&&` | boolean _And_ (short-circuits) | yes | left |
|
||||
| <code>\|\|</code> | boolean _Or_ (short-circuits) | yes | left |
|
||||
| `!` | boolean _Not_ | no | left |
|
||||
| `&&` | boolean _AND_ (short-circuits) | yes | left |
|
||||
| <code>\|\|</code> | boolean _OR_ (short-circuits) | yes | left |
|
||||
| `!` | boolean _NOT_ | no | left |
|
||||
| `[` .. `]` | indexing | yes | right |
|
||||
| `.` | 1) property access<br/>2) method call | yes | right |
|
||||
|
||||
|
@ -3,7 +3,10 @@ Compile a Script (to AST)
|
||||
|
||||
{{#include ../links.md}}
|
||||
|
||||
To repeatedly evaluate a script, _compile_ it first into an `AST` (abstract syntax tree) form:
|
||||
To repeatedly evaluate a script, _compile_ it first with `Engine::compile` into an `AST`
|
||||
(abstract syntax tree) form.
|
||||
|
||||
`Engine::eval_ast` evaluates a pre-compiled `AST`.
|
||||
|
||||
```rust
|
||||
// Compile to an AST and store it for later evaluations
|
||||
@ -16,7 +19,8 @@ for _ in 0..42 {
|
||||
}
|
||||
```
|
||||
|
||||
Compiling a script file is also supported (not available under [`no_std`] or in [WASM] builds):
|
||||
Compiling a script file is also supported with `Engine::compile_file`
|
||||
(not available under [`no_std`] or in [WASM] builds):
|
||||
|
||||
```rust
|
||||
let ast = engine.compile_file("hello_world.rhai".into())?;
|
||||
|
@ -116,16 +116,17 @@ The function signature of an implementation is:
|
||||
|
||||
where:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ----------------------------- | :-----------------------------: | ------------------------------------------------------------------------------------- |
|
||||
| `context` | `&mut EvalContext` | mutable reference to the current evaluation _context_ |
|
||||
| - `context.scope` | `&mut Scope` | mutable reference to the current [`Scope`]; variables can be added to/removed from it |
|
||||
| - `context.engine()` | `&Engine` | reference to the current [`Engine`] |
|
||||
| - `context.imports()` | `&Imports` | reference to the current stack of [modules] imported via `import` statements |
|
||||
| - `context.iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| - `context.this_ptr()` | `Option<&Dynamic>` | reference to the current bound [`this`] pointer, if any |
|
||||
| - `context.call_level()` | `usize` | the current nesting level of function calls |
|
||||
| `inputs` | `&[Expression]` | a list of input expression trees |
|
||||
| Parameter | Type | Description |
|
||||
| -------------------------- | :-----------------------------: | ------------------------------------------------------------------------------------- |
|
||||
| `context` | `&mut EvalContext` | mutable reference to the current evaluation _context_ |
|
||||
| • `scope()` | `&Scope` | reference to the current [`Scope`] |
|
||||
| • `scope_mut()` | `&mut Scope` | mutable reference to the current [`Scope`]; variables can be added to/removed from it |
|
||||
| • `engine()` | `&Engine` | reference to the current [`Engine`] |
|
||||
| • `imports()` | `&Imports` | reference to the current stack of [modules] imported via `import` statements |
|
||||
| • `iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| • `this_ptr()` | `Option<&Dynamic>` | reference to the current bound [`this`] pointer, if any |
|
||||
| • `call_level()` | `usize` | the current nesting level of function calls |
|
||||
| `inputs` | `&[Expression]` | a list of input expression trees |
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -168,7 +169,7 @@ In other words, any [`Scope`] calls that change the list of must come _before_ a
|
||||
let var_name = inputs[0].get_variable_name().unwrap();
|
||||
let expression = inputs.get(1).unwrap();
|
||||
|
||||
context.scope.push(var_name, 0 as INT); // do this BEFORE 'context.eval_expression_tree'!
|
||||
context.scope_mut().push(var_name, 0 as INT); // do this BEFORE 'context.eval_expression_tree'!
|
||||
|
||||
let result = context.eval_expression_tree(expression)?;
|
||||
```
|
||||
@ -195,7 +196,7 @@ fn implementation_func(
|
||||
let condition = inputs.get(2).unwrap();
|
||||
|
||||
// Push one new variable into the scope BEFORE 'context.eval_expression_tree'
|
||||
context.scope.push(var_name, 0 as INT);
|
||||
context.scope_mut().push(var_name, 0 as INT);
|
||||
|
||||
loop {
|
||||
// Evaluate the statement block
|
||||
@ -219,7 +220,7 @@ fn implementation_func(
|
||||
Ok(Dynamic::UNIT)
|
||||
}
|
||||
|
||||
// Register the custom syntax (sample): exec |x| -> { x += 1 } while x < 0;
|
||||
// Register the custom syntax (sample): exec |x| -> { x += 1 } while x < 0
|
||||
engine.register_custom_syntax(
|
||||
&[ "exec", "|", "$ident$", "|", "->", "$block$", "while", "$expr$" ], // the custom syntax
|
||||
1, // the number of new variables declared within this custom syntax
|
||||
@ -227,6 +228,20 @@ engine.register_custom_syntax(
|
||||
)?;
|
||||
```
|
||||
|
||||
Remember that a custom syntax acts as an _expression_, so it can show up practically anywhere:
|
||||
|
||||
```rust
|
||||
// Use as an expression:
|
||||
let foo = (exec |x| -> { x += 1 } while x < 0) * 100;
|
||||
|
||||
// Use as a function call argument:
|
||||
do_something(exec |x| -> { x += 1 } while x < 0, 24, true);
|
||||
|
||||
// Use as a statement:
|
||||
exec |x| -> { x += 1 } while x < 0;
|
||||
// ^ terminate statement with ';'
|
||||
```
|
||||
|
||||
|
||||
Step Four - Disable Unneeded Statement Types
|
||||
-------------------------------------------
|
||||
@ -258,8 +273,8 @@ Step Six - Profit!
|
||||
------------------
|
||||
|
||||
|
||||
Really Advanced - Low Level Custom Syntax API
|
||||
--------------------------------------------
|
||||
Really Advanced - Custom Parsers
|
||||
-------------------------------
|
||||
|
||||
Sometimes it is desirable to have multiple custom syntax starting with the
|
||||
same symbol. This is especially common for _command-style_ syntax where the
|
||||
@ -276,30 +291,67 @@ perform add something; // Add something to the system
|
||||
perform remove something; // Delete something from the system
|
||||
```
|
||||
|
||||
For even more flexibility, there is a _low level_ API for custom syntax that
|
||||
allows the registration of an entire mini-parser.
|
||||
Alternatively, a custom syntax may have variable length, with a termination symbol:
|
||||
|
||||
```rust
|
||||
// The following is a variable-length list terminated by '>'
|
||||
tags < "foo", "bar", 123, ... , x+y, true >
|
||||
```
|
||||
|
||||
For even more flexibility in order to handle these advanced use cases, there is a
|
||||
_low level_ API for custom syntax that allows the registration of an entire mini-parser.
|
||||
|
||||
Use `Engine::register_custom_syntax_raw` to register a custom syntax _parser_
|
||||
together with the implementation function:
|
||||
together with the implementation function.
|
||||
|
||||
### How Custom Parsers Work
|
||||
|
||||
A custom parser takes as input parameters two pieces of information:
|
||||
|
||||
* The symbols parsed so far; `$ident$` is replaced with the actual identifier parsed,
|
||||
while `$expr$` and `$block$` stay as they were.
|
||||
|
||||
The custom parser can inspect this symbols stream to determine the next symbol to parse.
|
||||
|
||||
* The _look-ahead_ symbol, which is the symbol that will be parsed _next_.
|
||||
|
||||
If the look-ahead is an expected symbol, the customer parser just returns it to continue parsing,
|
||||
or it can return `$ident$` to parse it as an identifier, or even `$expr$` to start parsing
|
||||
an expression.
|
||||
|
||||
If the look-ahead is '`{`', then the custom parser may also return `$block$` to start parsing a
|
||||
statements block.
|
||||
|
||||
If the look-ahead is unexpected, the custom parser should then return the symbol expected
|
||||
and Rhai will fail with a parse error containing information about the expected symbol.
|
||||
|
||||
A custom parser always returns the _next_ symbol expected, which can also be `$ident$`,
|
||||
`$expr$` or `$block$`, or `None` if parsing should terminate (_without_ reading the
|
||||
look-ahead symbol).
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```rust
|
||||
engine.register_custom_syntax_raw(
|
||||
"perform",
|
||||
|stream| match stream.len() {
|
||||
// The custom parser implementation - always returns the next symbol expected
|
||||
// 'look_ahead' is the next symbol about to be read
|
||||
|symbols, look_ahead| match symbols.len() {
|
||||
// perform ...
|
||||
1 => Ok(Some("$ident$".to_string())),
|
||||
// perform command ...
|
||||
2 => match stream[1].as_str() {
|
||||
"action" => Ok(Some("$expr$".to_string())),
|
||||
"hello" => Ok(Some("world".to_string())),
|
||||
"update" | "check" | "add" | "remove" => Ok(Some("$ident$".to_string())),
|
||||
2 => match symbols[1].as_str() {
|
||||
"action" => Ok(Some("$expr$".into())),
|
||||
"hello" => Ok(Some("world".into())),
|
||||
"update" | "check" | "add" | "remove" => Ok(Some("$ident$".into())),
|
||||
"cleanup" => Ok(None),
|
||||
cmd => Err(ParseError(Box::new(ParseErrorType::BadInput(
|
||||
LexError::ImproperSymbol(format!("Improper command: {}", cmd))
|
||||
)), Position::NONE)),
|
||||
},
|
||||
// perform command arg ...
|
||||
3 => match (stream[1].as_str(), stream[2].as_str()) {
|
||||
3 => match (symbols[1].as_str(), symbols[2].as_str()) {
|
||||
("action", _) => Ok(None),
|
||||
("hello", "world") => Ok(None),
|
||||
("update", arg) if arg == "system" => Ok(None),
|
||||
@ -315,7 +367,9 @@ engine.register_custom_syntax_raw(
|
||||
},
|
||||
_ => unreachable!(),
|
||||
},
|
||||
0, // the number of new variables declared within this custom syntax
|
||||
// Number of new variables declared by this custom syntax
|
||||
0,
|
||||
// Implementation function
|
||||
implementation_func
|
||||
);
|
||||
```
|
||||
@ -324,20 +378,24 @@ engine.register_custom_syntax_raw(
|
||||
|
||||
The custom syntax parser has the following signature:
|
||||
|
||||
> `Fn(stream: &[String]) -> Result<Option<String>, ParseError>`
|
||||
> `Fn(symbols: &[ImmutableString], look_ahead: &str) -> Result<Option<ImmutableString>, ParseError>`
|
||||
|
||||
where:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | :---------: | -------------------------------------------------------------------------------------------------- |
|
||||
| `stream` | `&[String]` | a slice of symbols that have been parsed so far, possibly containing `"$expr$"` and/or `"$block$"` |
|
||||
| Parameter | Type | Description |
|
||||
| ------------ | :------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `symbols` | `&[ImmutableString]` | a slice of symbols that have been parsed so far, possibly containing `$expr$` and/or `$block$`; `$ident$` is replaced by the actual identifier |
|
||||
| `look_ahead` | `&str` | a string slice containing the next symbol that is about to be read |
|
||||
|
||||
Most strings are [`ImmutableString`][string]'s so it is usually more efficient to just `clone` the appropriate one
|
||||
(if any matches, or keep an internal cache for commonly-used symbols) as the return value.
|
||||
|
||||
### Return Value
|
||||
|
||||
The return value is `Result<Option<String>, ParseError>` where:
|
||||
The return value is `Result<Option<ImmutableString>, ParseError>` where:
|
||||
|
||||
| Value | Description |
|
||||
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Ok(None)` | parsing complete and there are no more symbols to match |
|
||||
| `Ok(Some(symbol))` | next symbol to match, which can also be `"$expr$"`, `"$ident$"` or `"$block$"` |
|
||||
| `Err(ParseError)` | error that is reflected back to the [`Engine`].<br/>Normally this is `ParseError(ParseErrorType::BadInput(LexError::ImproperSymbol(message)), Position::NONE)` to indicate that there is a syntax error, but it can be any `ParseError`. |
|
||||
| Value | Description |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Ok(None)` | parsing complete and there are no more symbols to match |
|
||||
| `Ok(Some(symbol))` | the next symbol to match, which can also be `$expr$`, `$ident$` or `$block$` |
|
||||
| `Err(ParseError)` | error that is reflected back to the [`Engine`] - normally `ParseError(ParseErrorType::BadInput(LexError::ImproperSymbol(message)), Position::NONE)` to indicate that there is a syntax error, but it can be any `ParseError`. |
|
||||
|
@ -17,7 +17,7 @@ To add more functionalities to a _raw_ `Engine`, load [packages] into it.
|
||||
Built-in Operators
|
||||
------------------
|
||||
|
||||
| Operators | Assignment operators | Supported for types (see [standard types]) |
|
||||
| Operators | Assignment operators | Supported for types<br/>(see [standard types]) |
|
||||
| ------------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
|
||||
| `+`, | `+=` | `INT`, `FLOAT` (if not [`no_float`]), `char`, `ImmutableString` |
|
||||
| `-`, `*`, `/`, `%`, `~`, | `-=`, `*=`, `/=`, `%=`, `~=` | `INT`, `FLOAT` (if not [`no_float`]) |
|
||||
|
@ -24,7 +24,7 @@ engine.on_var(|name, index, context| {
|
||||
EvalAltResult::ErrorVariableNotFound(name.to_string(), Position::NONE)
|
||||
)),
|
||||
// Silently maps 'chameleon' into 'innocent'.
|
||||
"chameleon" => context.scope.get_value("innocent").map(Some).ok_or_else(|| Box::new(
|
||||
"chameleon" => context.scope().get_value("innocent").map(Some).ok_or_else(|| Box::new(
|
||||
EvalAltResult::ErrorVariableNotFound(name.to_string(), Position::NONE)
|
||||
)),
|
||||
// Return Ok(None) to continue with the normal variable resolution process.
|
||||
@ -67,17 +67,17 @@ The function signature passed to `Engine::on_var` takes the following form:
|
||||
|
||||
where:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ----------------------------- | :-----------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `name` | `&str` | variable name |
|
||||
| `index` | `usize` | an offset from the bottom of the current [`Scope`] that the variable is supposed to reside.<br/>Offsets start from 1, with 1 meaning the last variable in the current [`Scope`]. Essentially the correct variable is at position `scope.len() - index`.<br/>If `index` is zero, then there is no pre-calculated offset position and a search through the current [`Scope`] must be performed. |
|
||||
| `context` | `&EvalContext` | reference to the current evaluation _context_ |
|
||||
| - `context.scope` | `&Scope` | reference to the current [`Scope`] containing all variables up to the current evaluation position |
|
||||
| - `context.engine()` | `&Engine` | reference to the current [`Engine`] |
|
||||
| - `context.imports()` | `&Imports` | reference to the current stack of [modules] imported via `import` statements |
|
||||
| - `context.iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| - `context.this_ptr()` | `Option<&Dynamic>` | reference to the current bound [`this`] pointer, if any |
|
||||
| - `context.call_level()` | `usize` | the current nesting level of function calls |
|
||||
| Parameter | Type | Description |
|
||||
| -------------------------- | :-----------------------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `name` | `&str` | variable name |
|
||||
| `index` | `usize` | an offset from the bottom of the current [`Scope`] that the variable is supposed to reside.<br/>Offsets start from 1, with 1 meaning the last variable in the current [`Scope`]. Essentially the correct variable is at position `scope.len() - index`.<br/>If `index` is zero, then there is no pre-calculated offset position and a search through the current [`Scope`] must be performed. |
|
||||
| `context` | `&EvalContext` | reference to the current evaluation _context_ |
|
||||
| • `scope()` | `&Scope` | reference to the current [`Scope`] |
|
||||
| • `engine()` | `&Engine` | reference to the current [`Engine`] |
|
||||
| • `imports()` | `&Imports` | reference to the current stack of [modules] imported via `import` statements |
|
||||
| • `iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| • `this_ptr()` | `Option<&Dynamic>` | reference to the current bound [`this`] pointer, if any |
|
||||
| • `call_level()` | `usize` | the current nesting level of function calls |
|
||||
|
||||
### Return Value
|
||||
|
||||
|
BIN
doc/src/images/logo/favicon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
15
doc/src/images/logo/favicon.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-2132,0)">
|
||||
<g id="favicon" transform="matrix(0.591824,0,0,0.558091,1146.76,0)">
|
||||
<rect x="1664.76" y="0" width="54.07" height="57.338" style="fill:none;"/>
|
||||
<g transform="matrix(0.180947,0,0,0.191884,1645.83,-30.569)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear1);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
BIN
doc/src/images/logo/rhai-banner-transparent-colour.png
Normal file
After Width: | Height: | Size: 22 KiB |
31
doc/src/images/logo/rhai-banner-transparent-colour.svg
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 960 272" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,0,-962)">
|
||||
<g id="rhai-banner-transparent-colour" transform="matrix(0.588957,0,0,0.998422,0,1.39642)">
|
||||
<rect x="0" y="962.121" width="1630" height="272.43" style="fill:none;"/>
|
||||
<g transform="matrix(1.69792,0,0,0.751185,-277.179,872.981)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear1);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 5.3 KiB |
BIN
doc/src/images/logo/rhai-colour-black.png
Normal file
After Width: | Height: | Size: 23 KiB |
39
doc/src/images/logo/rhai-colour-black.svg
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 800 450" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-830,-480)">
|
||||
<g id="rhai-colour-white" transform="matrix(1,0,0,0.75,830,480)">
|
||||
<rect x="0" y="0" width="800" height="600" style="fill:none;"/>
|
||||
<clipPath id="_clip1">
|
||||
<rect x="0" y="0" width="800" height="600"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip1)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-641.217)">
|
||||
<rect x="0" y="480.913" width="800" height="450"/>
|
||||
</g>
|
||||
<g>
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear2);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 5.7 KiB |
BIN
doc/src/images/logo/rhai-colour-white.png
Normal file
After Width: | Height: | Size: 23 KiB |
34
doc/src/images/logo/rhai-colour-white.svg
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 800 450" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-830,0)">
|
||||
<g id="rhai-colour-white" transform="matrix(1,0,0,0.75,830,0)">
|
||||
<rect x="0" y="0" width="800" height="600" style="fill:none;"/>
|
||||
<g transform="matrix(1,0,0,1.33333,0,0)">
|
||||
<rect x="0" y="0" width="800" height="450" style="fill:white;"/>
|
||||
</g>
|
||||
<g>
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear1);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 5.4 KiB |
BIN
doc/src/images/logo/rhai-icon-colour-black.png
Normal file
After Width: | Height: | Size: 17 KiB |
23
doc/src/images/logo/rhai-icon-colour-black.svg
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 450 450" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-1656,-480)">
|
||||
<g id="rhai-icon-colour-black" transform="matrix(1.55094,0,0,1.55094,-913.734,480)">
|
||||
<rect x="1656.88" y="0" width="290.146" height="290.146" style="fill:none;"/>
|
||||
<clipPath id="_clip1">
|
||||
<rect x="1656.88" y="0" width="290.146" height="290.146"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip1)">
|
||||
<g transform="matrix(0.362683,0,0,0.644769,1656.89,-310.078)">
|
||||
<rect x="0" y="480.913" width="800" height="450"/>
|
||||
</g>
|
||||
<g transform="matrix(0.644769,0,0,0.644769,1638.17,-54.3573)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear2);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
BIN
doc/src/images/logo/rhai-icon-colour-white.png
Normal file
After Width: | Height: | Size: 17 KiB |
23
doc/src/images/logo/rhai-icon-colour-white.svg
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 450 450" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-1656,0)">
|
||||
<g id="rhai-icon-colour-white" transform="matrix(1.55094,0,0,1.55094,-913.734,0)">
|
||||
<rect x="1656.88" y="0" width="290.146" height="290.146" style="fill:none;"/>
|
||||
<clipPath id="_clip1">
|
||||
<rect x="1656.88" y="0" width="290.146" height="290.146"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip1)">
|
||||
<g transform="matrix(0.644769,0,0,0.644769,589.147,0)">
|
||||
<rect x="1656" y="0" width="450" height="450" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(0.644769,0,0,0.644769,1638.17,-54.3573)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear2);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
BIN
doc/src/images/logo/rhai-icon-transparent-black.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
11
doc/src/images/logo/rhai-icon-transparent-black.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 132 224" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-188,-113)">
|
||||
<g transform="matrix(1,0,0,0.75,0,0)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
BIN
doc/src/images/logo/rhai-icon-transparent-colour.png
Normal file
After Width: | Height: | Size: 15 KiB |
14
doc/src/images/logo/rhai-icon-transparent-colour.svg
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 132 224" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-1815,-113)">
|
||||
<g transform="matrix(1.55094,0,0,1.55094,-913.734,0)">
|
||||
<g transform="matrix(0.644769,0,0,0.644769,1638.17,-54.3573)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear1);"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
BIN
doc/src/images/logo/rhai-icon-transparent-white.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
11
doc/src/images/logo/rhai-icon-transparent-white.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 132 224" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-188,-593)">
|
||||
<g transform="matrix(1,0,0,0.75,0,480)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:white;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
BIN
doc/src/images/logo/rhai-logo-transparent-colour-black.png
Normal file
After Width: | Height: | Size: 20 KiB |
28
doc/src/images/logo/rhai-logo-transparent-colour-black.svg
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 424 224" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-1018,-113)">
|
||||
<g transform="matrix(1,0,0,0.75,830,0)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear1);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 5.0 KiB |
BIN
doc/src/images/logo/rhai-logo-transparent-colour-white.png
Normal file
After Width: | Height: | Size: 20 KiB |
28
doc/src/images/logo/rhai-logo-transparent-colour-white.svg
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 424 224" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-1018,-593)">
|
||||
<g transform="matrix(1,0,0,0.75,830,480)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:url(#_Linear1);"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.36312e-14,222.614,-222.614,1.36312e-14,254.029,197.998)"><stop offset="0" style="stop-color:rgb(255,215,118);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(246,117,0);stop-opacity:1"/></linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 5.1 KiB |
BIN
doc/src/images/logo/rhai-logo-transparent-sil-black.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
25
doc/src/images/logo/rhai-logo-transparent-sil-black.svg
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 424 224" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-188,-113)">
|
||||
<g transform="matrix(1,0,0,0.75,0,0)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.7 KiB |
BIN
doc/src/images/logo/rhai-logo-transparent-sil-white.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
25
doc/src/images/logo/rhai-logo-transparent-sil-white.svg
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 424 224" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-188,-593)">
|
||||
<g transform="matrix(1,0,0,0.75,0,480)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.7 KiB |
BIN
doc/src/images/logo/rhai-sil-black.png
Normal file
After Width: | Height: | Size: 11 KiB |
36
doc/src/images/logo/rhai-sil-black.svg
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 800 450" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,0,-480)">
|
||||
<g id="rhai-sil-black" transform="matrix(1,0,0,0.75,0,480)">
|
||||
<rect x="0" y="0" width="800" height="600" style="fill:none;"/>
|
||||
<clipPath id="_clip1">
|
||||
<rect x="0" y="0" width="800" height="600"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#_clip1)">
|
||||
<g transform="matrix(1,0,0,1.33333,0,-641.217)">
|
||||
<rect x="0" y="480.913" width="800" height="450"/>
|
||||
</g>
|
||||
<g>
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z" style="fill:white;"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.3 KiB |
BIN
doc/src/images/logo/rhai-sil-white.png
Normal file
After Width: | Height: | Size: 12 KiB |
29
doc/src/images/logo/rhai-sil-white.svg
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 800 450" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g id="rhai-sil-white" transform="matrix(1,0,0,0.75,0,0)">
|
||||
<rect x="0" y="0" width="800" height="600" style="fill:none;"/>
|
||||
<g transform="matrix(1,0,0,1.33333,0,0)">
|
||||
<rect x="0" y="0" width="800" height="450" style="fill:white;"/>
|
||||
</g>
|
||||
<g>
|
||||
<g transform="matrix(1,0,0,1.33333,0,-112.407)">
|
||||
<path d="M244.724,402.002L226.114,402.002C205.572,402.002 188.894,385.324 188.894,364.782L188.894,253.122L188.895,253.242C188.959,263.418 197.208,271.667 207.384,271.732L207.504,271.732L218.288,271.732C211.035,256.892 213.572,238.455 225.902,226.126L254.029,197.998C254.029,197.998 282.157,226.126 282.157,226.126C294.486,238.455 297.023,256.892 289.77,271.732L300.554,271.732L300.674,271.732C310.85,271.667 319.099,263.418 319.164,253.242L319.164,253.122L319.164,364.782C319.164,385.324 302.486,402.002 281.944,402.002L263.334,402.002L263.334,420.612L244.724,420.612L244.724,402.002ZM244.724,383.392L244.724,364.782C244.724,354.511 236.385,346.172 226.114,346.172L207.504,346.172L207.504,364.782C207.504,375.053 215.843,383.392 226.114,383.392L244.724,383.392ZM263.334,364.782C263.334,354.511 271.673,346.172 281.944,346.172L300.554,346.172L300.554,364.782C300.554,375.053 292.215,383.392 281.944,383.392L263.334,383.392L263.334,364.782ZM263.334,308.952C263.334,298.681 271.673,290.342 281.944,290.342L300.554,290.342L300.554,308.952C300.554,319.223 292.215,327.562 281.944,327.562L263.334,327.562L263.334,308.952ZM244.724,308.952C244.724,298.681 236.385,290.342 226.114,290.342L207.504,290.342L207.504,308.952C207.504,319.223 215.843,327.562 226.114,327.562L244.724,327.562L244.724,308.952ZM267.188,267.412C274.451,260.15 274.451,248.357 267.188,241.094C267.188,241.094 254.029,227.935 254.029,227.935L240.87,241.094C233.607,248.357 233.607,260.15 240.87,267.412L254.029,280.572L267.188,267.412Z"/>
|
||||
</g>
|
||||
<g transform="matrix(1,0,0,1.33333,95.1496,-261.61)">
|
||||
<g transform="matrix(144,0,0,144,256.612,491.233)">
|
||||
<path d="M0.231,-0.512C0.246,-0.522 0.263,-0.53 0.281,-0.535C0.301,-0.54 0.32,-0.543 0.339,-0.543C0.352,-0.543 0.363,-0.542 0.374,-0.54L0.374,-0.428C0.362,-0.431 0.349,-0.433 0.336,-0.433C0.309,-0.433 0.284,-0.427 0.262,-0.415C0.238,-0.402 0.22,-0.383 0.209,-0.359C0.197,-0.335 0.191,-0.307 0.191,-0.274L0.191,-0L0.07,-0L0.07,-0.54L0.177,-0.54L0.177,-0.454C0.192,-0.479 0.21,-0.499 0.231,-0.512Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,314.068,491.233)">
|
||||
<path d="M0.353,-0.555C0.438,-0.555 0.495,-0.528 0.524,-0.472C0.552,-0.418 0.566,-0.361 0.566,-0.302L0.566,-0L0.444,-0L0.444,-0.26C0.444,-0.381 0.402,-0.442 0.317,-0.442C0.281,-0.442 0.251,-0.43 0.227,-0.405C0.203,-0.38 0.191,-0.338 0.191,-0.278L0.191,-0L0.069,-0L0.069,-0.72L0.177,-0.72L0.177,-0.48C0.218,-0.53 0.277,-0.555 0.353,-0.555Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,404.212,491.233)">
|
||||
<path d="M0.496,-0.455C0.505,-0.438 0.51,-0.42 0.513,-0.402C0.515,-0.383 0.516,-0.36 0.516,-0.331L0.516,-0L0.411,-0L0.411,-0.073C0.388,-0.043 0.361,-0.021 0.331,-0.007C0.3,0.008 0.264,0.015 0.221,0.015C0.183,0.015 0.15,0.008 0.123,-0.007C0.096,-0.022 0.075,-0.041 0.061,-0.066C0.047,-0.091 0.04,-0.118 0.04,-0.148C0.04,-0.187 0.05,-0.221 0.07,-0.248C0.09,-0.275 0.121,-0.295 0.163,-0.31C0.189,-0.318 0.22,-0.325 0.256,-0.332C0.292,-0.338 0.339,-0.345 0.398,-0.353C0.396,-0.385 0.386,-0.408 0.369,-0.423C0.351,-0.438 0.324,-0.445 0.287,-0.445C0.26,-0.445 0.236,-0.439 0.215,-0.427C0.193,-0.414 0.178,-0.395 0.17,-0.369L0.059,-0.404C0.073,-0.451 0.099,-0.488 0.138,-0.515C0.176,-0.542 0.226,-0.555 0.288,-0.555C0.393,-0.555 0.462,-0.522 0.496,-0.455ZM0.384,-0.171C0.391,-0.188 0.396,-0.216 0.397,-0.255C0.358,-0.249 0.324,-0.243 0.295,-0.237C0.265,-0.232 0.241,-0.226 0.224,-0.221C0.202,-0.212 0.186,-0.203 0.174,-0.192C0.164,-0.181 0.158,-0.167 0.158,-0.15C0.158,-0.129 0.166,-0.113 0.181,-0.1C0.196,-0.087 0.217,-0.081 0.245,-0.081C0.282,-0.081 0.313,-0.09 0.338,-0.109C0.362,-0.128 0.377,-0.148 0.384,-0.171Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(144,0,0,144,487.156,491.233)">
|
||||
<path d="M0.08,-0.734L0.2,-0.734L0.2,-0.624L0.08,-0.624L0.08,-0.734ZM0.08,-0.54L0.2,-0.54L0.2,-0L0.08,-0L0.08,-0.54Z" style="fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 10 KiB |
@ -61,8 +61,8 @@ r"
|
||||
```
|
||||
|
||||
|
||||
Constants Can be Modified via Rust
|
||||
---------------------------------
|
||||
Caveat - Constants Can be Modified via Rust
|
||||
------------------------------------------
|
||||
|
||||
A custom type stored as a constant cannot be modified via script, but _can_ be modified via
|
||||
a registered Rust function that takes a first `&mut` parameter - because there is no way for
|
||||
@ -76,9 +76,15 @@ x.increment(); // call 'increment' defined in Rust with '&mut' first parame
|
||||
x == 43; // value of 'x' is changed!
|
||||
|
||||
fn double() {
|
||||
this *= 2; // function squares 'this'
|
||||
this *= 2; // function doubles 'this'
|
||||
}
|
||||
|
||||
let y = 1; // 'y' is not constant and mutable
|
||||
|
||||
y.double(); // double it...
|
||||
|
||||
y == 2; // value of 'y' is changed as expected
|
||||
|
||||
x.double(); // <- error: cannot modify constant 'this'
|
||||
|
||||
x == 43; // value of 'x' is unchanged by script
|
||||
|
@ -15,7 +15,7 @@ it is usually used to perform type-specific actions based on the actual value's
|
||||
```c
|
||||
let mystery = get_some_dynamic_value();
|
||||
|
||||
switch mystery {
|
||||
switch type_of(mystery) {
|
||||
"i64" => print("Hey, I got an integer here!"),
|
||||
"f64" => print("Hey, I got a float here!"),
|
||||
"string" => print("Hey, I got a string here!"),
|
||||
|
@ -134,29 +134,33 @@ impl Handler {
|
||||
// Say there are three events: 'start', 'end', 'update'.
|
||||
// In a real application you'd be handling errors...
|
||||
pub fn on_event(&mut self, event_name: &str, event_data: i64) -> Result<(), Error> {
|
||||
let engine = &self.engine;
|
||||
let scope = &mut self.scope;
|
||||
let ast = &self.ast;
|
||||
|
||||
match event_name {
|
||||
// The 'start' event maps to function 'start'.
|
||||
// In a real application you'd be handling errors...
|
||||
"start" => self.engine.call_fn(&mut self.scope, &self.ast, "start", (event_data,))?,
|
||||
"start" => engine.call_fn(scope, ast, "start", (event_data,))?,
|
||||
|
||||
// The 'end' event maps to function 'end'.
|
||||
// In a real application you'd be handling errors...
|
||||
"end" => self.engine.call_fn(&mut self.scope, &self.ast, "end", (event_data,))?,
|
||||
"end" => engine.call_fn(scope, ast, "end", (event_data,))?,
|
||||
|
||||
// The 'update' event maps to function 'update'.
|
||||
// This event provides a default implementation when the scripted function
|
||||
// is not found.
|
||||
"update" => self.engine
|
||||
.call_fn(&mut self.scope, &self.ast, "update", (event_data,))
|
||||
.or_else(|err| match *err {
|
||||
EvalAltResult::ErrorFunctionNotFound(fn_name, _) if fn_name == "update" => {
|
||||
// Default implementation of 'update' event handler
|
||||
self.scope.set_value("state2", SomeType::new(42));
|
||||
// Turn function-not-found into a success
|
||||
Ok(Dynamic::UNIT)
|
||||
}
|
||||
_ => Err(err.into())
|
||||
})?
|
||||
"update" =>
|
||||
engine.call_fn(scope, ast, "update", (event_data,))
|
||||
.or_else(|err| match *err {
|
||||
EvalAltResult::ErrorFunctionNotFound(fn_name, _) if fn_name == "update" => {
|
||||
// Default implementation of 'update' event handler
|
||||
self.scope.set_value("state2", SomeType::new(42));
|
||||
// Turn function-not-found into a success
|
||||
Ok(Dynamic::UNIT)
|
||||
}
|
||||
_ => Err(err.into())
|
||||
})?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -271,9 +271,9 @@ use rhai::plugin::*; // a "prelude" import for macros
|
||||
|
||||
#[export_module]
|
||||
mod my_module {
|
||||
// This is the '+' operator for 'MyType'.
|
||||
// This is the '+' operator for 'TestStruct'.
|
||||
#[rhai_fn(name = "+")]
|
||||
pub fn add(obj: &mut MyType, value: i64) {
|
||||
pub fn add(obj: &mut TestStruct, value: i64) {
|
||||
obj.prop += value;
|
||||
}
|
||||
// This function is 'calc (i64)'.
|
||||
@ -305,24 +305,24 @@ mod my_module {
|
||||
pub fn greet(name: &str) -> String {
|
||||
format!("hello, {}!", name)
|
||||
}
|
||||
// This is a getter for 'MyType::prop'.
|
||||
// This is a getter for 'TestStruct::prop'.
|
||||
#[rhai_fn(get = "prop")]
|
||||
pub fn get_prop(obj: &mut MyType) -> i64 {
|
||||
pub fn get_prop(obj: &mut TestStruct) -> i64 {
|
||||
obj.prop
|
||||
}
|
||||
// This is a setter for 'MyType::prop'.
|
||||
// This is a setter for 'TestStruct::prop'.
|
||||
#[rhai_fn(set = "prop")]
|
||||
pub fn set_prop(obj: &mut MyType, value: i64) {
|
||||
pub fn set_prop(obj: &mut TestStruct, value: i64) {
|
||||
obj.prop = value;
|
||||
}
|
||||
// This is an index getter for 'MyType'.
|
||||
// This is an index getter for 'TestStruct'.
|
||||
#[rhai_fn(index_get)]
|
||||
pub fn get_index(obj: &mut MyType, index: i64) -> bool {
|
||||
pub fn get_index(obj: &mut TestStruct, index: i64) -> bool {
|
||||
obj.list[index]
|
||||
}
|
||||
// This is an index setter for 'MyType'.
|
||||
// This is an index setter for 'TestStruct'.
|
||||
#[rhai_fn(index_set)]
|
||||
pub fn get_index(obj: &mut MyType, index: i64, state: bool) {
|
||||
pub fn get_index(obj: &mut TestStruct, index: i64, state: bool) {
|
||||
obj.list[index] = state;
|
||||
}
|
||||
}
|
||||
@ -344,7 +344,7 @@ use rhai::plugin::*; // a "prelude" import for macros
|
||||
mod my_module {
|
||||
// This function can be called in five ways
|
||||
#[rhai_fn(name = "get_prop_value", name = "prop", name = "+", set = "prop", index_get)]
|
||||
pub fn prop_function(obj: &mut MyType, index: i64) -> i64 {
|
||||
pub fn prop_function(obj: &mut TestStruct, index: i64) -> i64 {
|
||||
obj.prop[index]
|
||||
}
|
||||
}
|
||||
|
@ -140,14 +140,14 @@ with a special "pretty-print" name, [`type_of()`] will return that name instead.
|
||||
engine
|
||||
.register_type::<TestStruct1>()
|
||||
.register_fn("new_ts1", TestStruct1::new)
|
||||
.register_type_with_name::<TestStruct2>("MyType")
|
||||
.register_type_with_name::<TestStruct2>("TestStruct")
|
||||
.register_fn("new_ts2", TestStruct2::new);
|
||||
|
||||
let ts1_type = engine.eval::<String>(r#"let x = new_ts1(); x.type_of()"#)?;
|
||||
let ts2_type = engine.eval::<String>(r#"let x = new_ts2(); x.type_of()"#)?;
|
||||
|
||||
println!("{}", ts1_type); // prints 'path::to::TestStruct'
|
||||
println!("{}", ts1_type); // prints 'MyType'
|
||||
println!("{}", ts1_type); // prints 'TestStruct'
|
||||
```
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ which contains only one function: `resolve`.
|
||||
When Rhai prepares to load a module, `ModuleResolver::resolve` is called with the name
|
||||
of the _module path_ (i.e. the path specified in the [`import`] statement).
|
||||
|
||||
* Upon success, it should return an [`Rc<Module>`][module] (or `Arc<Module>` under [`sync`]).
|
||||
* Upon success, it should return an [`Rc<Module>`][module] (or [`Arc<Module>`][module] under [`sync`]).
|
||||
|
||||
The module should call `Module::build_index` on the target module before returning.
|
||||
This method flattens the entire module tree and _indexes_ it for fast function name resolution.
|
||||
@ -66,7 +66,7 @@ engine.set_module_resolver(Some(MyModuleResolver {}));
|
||||
|
||||
engine.consume(r#"
|
||||
import "hello" as foo; // this 'import' statement will call
|
||||
// 'MyModuleResolver::resolve' with "hello" as `path`
|
||||
// 'MyModuleResolver::resolve' with "hello" as 'path'
|
||||
foo:bar();
|
||||
"#)?;
|
||||
```
|
||||
|
@ -65,14 +65,14 @@ The function signature passed to `Engine::register_raw_fn` takes the following f
|
||||
|
||||
where:
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ----------------------------- | :-----------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `T` | `impl Clone` | return type of the function |
|
||||
| `context` | `NativeCallContext` | the current _native call context_ |
|
||||
| - `context.engine()` | `&Engine` | the current [`Engine`], with all configurations and settings.<br/>This is sometimes useful for calling a script-defined function within the same evaluation context using [`Engine::call_fn`][`call_fn`], or calling a [function pointer]. |
|
||||
| - `context.imports()` | `Option<&Imports>` | reference to the current stack of [modules] imported via `import` statements (if any) |
|
||||
| - `context.iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| `args` | `&mut [&mut Dynamic]` | a slice containing `&mut` references to [`Dynamic`] values.<br/>The slice is guaranteed to contain enough arguments _of the correct types_. |
|
||||
| Parameter | Type | Description |
|
||||
| -------------------------- | :-----------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `T` | `impl Clone` | return type of the function |
|
||||
| `context` | `NativeCallContext` | the current _native call context_ |
|
||||
| • `engine()` | `&Engine` | the current [`Engine`], with all configurations and settings.<br/>This is sometimes useful for calling a script-defined function within the same evaluation context using [`Engine::call_fn`][`call_fn`], or calling a [function pointer]. |
|
||||
| • `imports()` | `Option<&Imports>` | reference to the current stack of [modules] imported via `import` statements (if any) |
|
||||
| • `iter_namespaces()` | `impl Iterator<Item = &Module>` | iterator of the namespaces (as [modules]) containing all script-defined functions |
|
||||
| `args` | `&mut [&mut Dynamic]` | a slice containing `&mut` references to [`Dynamic`] values.<br/>The slice is guaranteed to contain enough arguments _of the correct types_. |
|
||||
|
||||
### Return value
|
||||
|
||||
|
@ -46,5 +46,7 @@ Operations Count vs. Progress Percentage
|
||||
|
||||
Notice that the _operations count_ value passed into the closure does not indicate the _percentage_ of work
|
||||
already done by the script (and thus it is not real _progress_ tracking), because it is impossible to determine
|
||||
how long a script may run. It is possible, however, to calculate this percentage based on an estimated
|
||||
total number of operations for a typical run.
|
||||
how long a script may run.
|
||||
|
||||
It is possible, however, to calculate this percentage based on an estimated total number of operations
|
||||
for a typical run.
|
||||
|
BIN
doc/theme/favicon.png
vendored
Normal file
After Width: | Height: | Size: 1.2 KiB |
12
doc/theme/favicon.svg
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1,0,0,1,-2132,0)">
|
||||
<g transform="matrix(1,-0,-0,1,2132,-0)">
|
||||
<use xlink:href="#_Image1" x="9" y="4" width="14px" height="24px"/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<image id="_Image1" width="14px" height="24px" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACJklEQVQ4jYWSv2tTURTHPy8/2gTUQURQl+reWpukLaitUBA6dMnSDiV0cnAK2IKQQSyKGhAyOYhDKx3aP0AxQ1GrNNpaCh06ahYrivgDhISck1yH3Pt4SRM98Hjvfs75nvO9913oEmZ/IWP2FzLd8l5H0V42AyzZ5Zw3UHj6X2Fj57oTuZwB5kKJRy3iFmFj69oQ8MHybYtTVpwIDT/edbWRFosii1a0C1y1+CUwCCwCU4cm1l/PngU+2uVkeHzlheWTwHPLz4XHVz4BhOrr04MAqPxEBfuUfRsq5QD/AVBfnx4MGZUHWkz3hyfWfhmVb0YFozKvxbSnxbRnVOYt+xqeWPutxXS/Ucl7+myqBkSBKhALbPmufecCzNVIxKg4GBS1Cw7VhAL+j6ESR+UyKqUA30Tlks0dddyT1TFntSc6syEAsjo2CpRs85HozMaW5VGg1m41AbwDMCrvHeyZLW25b6My1MlqvraUHLLFxuc2akvJC6jkfau1J+edVRd1mlfM3Sq17+Ata7HqIty2jrQXtFuNoxJBZRSVtwH+BpURm4v5VquFPv9UY9myAFQLfSnAHUoyli3vWO6fagiVL7ZLytmIZcvbrrMTNXcrScsPvOq9k8tABtgEbthJBmj422nGMPAQuAgse5U7x08Be8CJTofQIb4DAx5A5daR08B94Apwpm2Sm/wZeAXcjN/+c9C1bSXXayq5XtMt3/EfARjV+r/8/gVv4ikNts4LsAAAAABJRU5ErkJggg=="/>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
51
src/ast.rs
@ -83,8 +83,8 @@ pub struct ScriptFnDef {
|
||||
/// Access to external variables.
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
pub externals: Vec<ImmutableString>,
|
||||
/// Comment block for function.
|
||||
pub fn_comments: Vec<String>,
|
||||
/// Function doc-comments (if any).
|
||||
pub comments: Vec<String>,
|
||||
}
|
||||
|
||||
impl fmt::Display for ScriptFnDef {
|
||||
@ -107,16 +107,29 @@ impl fmt::Display for ScriptFnDef {
|
||||
}
|
||||
}
|
||||
|
||||
/// A type containing a script-defined function's metadata.
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
pub struct ScriptFnMetadata {
|
||||
pub comments: Vec<String>,
|
||||
/// A type containing the metadata of a script-defined function.
|
||||
///
|
||||
/// Created by [`AST::iter_functions`].
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Hash)]
|
||||
pub struct ScriptFnMetadata<'a> {
|
||||
/// Function doc-comments (if any).
|
||||
///
|
||||
/// Block doc-comments are kept in a single string slice with line-breaks within.
|
||||
///
|
||||
/// Line doc-comments are kept in one string slice per line without the termination line-break.
|
||||
///
|
||||
/// Leading white-spaces are stripped, and each string slice always starts with the corresponding
|
||||
/// doc-comment leader: `///` or `/**`.
|
||||
pub comments: Vec<&'a str>,
|
||||
/// Function access mode.
|
||||
pub access: FnAccess,
|
||||
pub fn_name: ImmutableString,
|
||||
pub params: Vec<ImmutableString>,
|
||||
/// Function name.
|
||||
pub name: &'a str,
|
||||
/// Function parameters (if any).
|
||||
pub params: Vec<&'a str>,
|
||||
}
|
||||
|
||||
impl fmt::Display for ScriptFnMetadata {
|
||||
impl fmt::Display for ScriptFnMetadata<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
@ -126,23 +139,19 @@ impl fmt::Display for ScriptFnMetadata {
|
||||
} else {
|
||||
""
|
||||
},
|
||||
self.fn_name,
|
||||
self.params
|
||||
.iter()
|
||||
.map(|p| p.as_str())
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
self.name,
|
||||
self.params.iter().cloned().collect::<Vec<_>>().join(", ")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<ScriptFnMetadata> for &ScriptFnDef {
|
||||
fn into(self) -> ScriptFnMetadata {
|
||||
impl<'a> Into<ScriptFnMetadata<'a>> for &'a ScriptFnDef {
|
||||
fn into(self) -> ScriptFnMetadata<'a> {
|
||||
ScriptFnMetadata {
|
||||
comments: self.fn_comments.clone(),
|
||||
comments: self.comments.iter().map(|s| s.as_str()).collect(),
|
||||
access: self.access,
|
||||
fn_name: self.name.clone(),
|
||||
params: self.params.iter().cloned().collect(),
|
||||
name: &self.name,
|
||||
params: self.params.iter().map(|s| s.as_str()).collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -538,7 +547,7 @@ impl AST {
|
||||
}
|
||||
self
|
||||
}
|
||||
/// Iterate through all functions
|
||||
/// Iterate through all function definitions.
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
#[inline(always)]
|
||||
pub fn iter_functions<'a>(&'a self) -> impl Iterator<Item = ScriptFnMetadata> + 'a {
|
||||
|
@ -503,7 +503,7 @@ impl Clone for Dynamic {
|
||||
///
|
||||
/// ## WARNING
|
||||
///
|
||||
/// The cloned copy is marked [`AccessType::Normal`] even if the original is constant.
|
||||
/// The cloned copy is marked read-write even if the original is read-only.
|
||||
fn clone(&self) -> Self {
|
||||
match self.0 {
|
||||
Union::Unit(value, _) => Self(Union::Unit(value, AccessMode::ReadWrite)),
|
||||
|
@ -868,7 +868,7 @@ pub fn optimize_into_ast(
|
||||
lib: None,
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
mods: Default::default(),
|
||||
fn_comments: Default::default(),
|
||||
comments: Default::default(),
|
||||
})
|
||||
.for_each(|fn_def| {
|
||||
lib2.set_script_fn(fn_def);
|
||||
|
@ -2409,14 +2409,14 @@ fn parse_stmt(
|
||||
) -> Result<Option<Stmt>, ParseError> {
|
||||
use AccessMode::{ReadOnly, ReadWrite};
|
||||
|
||||
let mut fn_comments: Vec<String> = Default::default();
|
||||
let mut fn_comments_pos = Position::NONE;
|
||||
let mut comments: Vec<String> = Default::default();
|
||||
let mut comments_pos = Position::NONE;
|
||||
|
||||
// Handle doc-comment.
|
||||
// Handle doc-comments.
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
while let (Token::Comment(ref comment), comment_pos) = input.peek().unwrap() {
|
||||
if fn_comments_pos.is_none() {
|
||||
fn_comments_pos = *comment_pos;
|
||||
if comments_pos.is_none() {
|
||||
comments_pos = *comment_pos;
|
||||
}
|
||||
|
||||
if !is_doc_comment(comment) {
|
||||
@ -2424,16 +2424,16 @@ fn parse_stmt(
|
||||
}
|
||||
|
||||
if !settings.is_global {
|
||||
return Err(PERR::WrongDocComment.into_err(fn_comments_pos));
|
||||
return Err(PERR::WrongDocComment.into_err(comments_pos));
|
||||
}
|
||||
|
||||
if let Token::Comment(comment) = input.next().unwrap().0 {
|
||||
fn_comments.push(comment);
|
||||
comments.push(comment);
|
||||
|
||||
match input.peek().unwrap() {
|
||||
(Token::Fn, _) | (Token::Private, _) => break,
|
||||
(Token::Comment(_), _) => (),
|
||||
_ => return Err(PERR::WrongDocComment.into_err(fn_comments_pos)),
|
||||
_ => return Err(PERR::WrongDocComment.into_err(comments_pos)),
|
||||
}
|
||||
} else {
|
||||
unreachable!();
|
||||
@ -2492,7 +2492,7 @@ fn parse_stmt(
|
||||
pos: pos,
|
||||
};
|
||||
|
||||
let func = parse_fn(input, &mut new_state, lib, access, settings, fn_comments)?;
|
||||
let func = parse_fn(input, &mut new_state, lib, access, settings, comments)?;
|
||||
|
||||
// Qualifiers (none) + function name + number of arguments.
|
||||
let hash = calc_script_fn_hash(empty(), &func.name, func.params.len());
|
||||
@ -2651,7 +2651,7 @@ fn parse_fn(
|
||||
lib: &mut FunctionsLib,
|
||||
access: FnAccess,
|
||||
mut settings: ParseSettings,
|
||||
fn_comments: Vec<String>,
|
||||
comments: Vec<String>,
|
||||
) -> Result<ScriptFnDef, ParseError> {
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
settings.ensure_level_within_max_limit(state.max_expr_depth)?;
|
||||
@ -2737,7 +2737,7 @@ fn parse_fn(
|
||||
lib: None,
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
mods: Default::default(),
|
||||
fn_comments,
|
||||
comments,
|
||||
})
|
||||
}
|
||||
|
||||
@ -2894,7 +2894,7 @@ fn parse_anon_fn(
|
||||
lib: None,
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
mods: Default::default(),
|
||||
fn_comments: Default::default(),
|
||||
comments: Default::default(),
|
||||
};
|
||||
|
||||
let expr = Expr::FnPointer(fn_name, settings.pos);
|
||||
|
73
src/token.rs
@ -918,41 +918,41 @@ fn eat_next(stream: &mut impl InputStream, pos: &mut Position) -> Option<char> {
|
||||
}
|
||||
|
||||
/// Scan for a block comment until the end.
|
||||
fn scan_comment(
|
||||
fn scan_block_comment(
|
||||
stream: &mut impl InputStream,
|
||||
mut level: usize,
|
||||
pos: &mut Position,
|
||||
comment: &mut String,
|
||||
comment: &mut Option<String>,
|
||||
) -> usize {
|
||||
while let Some(c) = stream.get_next() {
|
||||
pos.advance();
|
||||
|
||||
if !comment.is_empty() {
|
||||
if let Some(ref mut comment) = comment {
|
||||
comment.push(c);
|
||||
}
|
||||
|
||||
match c {
|
||||
'/' => {
|
||||
if let Some(c2) = stream.get_next() {
|
||||
if !comment.is_empty() {
|
||||
comment.push(c2);
|
||||
}
|
||||
if let Some(c2) = stream.peek_next() {
|
||||
if c2 == '*' {
|
||||
eat_next(stream, pos);
|
||||
if let Some(ref mut comment) = comment {
|
||||
comment.push(c2);
|
||||
}
|
||||
level += 1;
|
||||
}
|
||||
}
|
||||
pos.advance();
|
||||
}
|
||||
'*' => {
|
||||
if let Some(c2) = stream.get_next() {
|
||||
if !comment.is_empty() {
|
||||
comment.push(c2);
|
||||
}
|
||||
if let Some(c2) = stream.peek_next() {
|
||||
if c2 == '/' {
|
||||
eat_next(stream, pos);
|
||||
if let Some(ref mut comment) = comment {
|
||||
comment.push(c2);
|
||||
}
|
||||
level -= 1;
|
||||
}
|
||||
}
|
||||
pos.advance();
|
||||
}
|
||||
'\n' => pos.new_line(),
|
||||
_ => (),
|
||||
@ -1032,11 +1032,16 @@ fn get_next_token_inner(
|
||||
// Still inside a comment?
|
||||
if state.comment_level > 0 {
|
||||
let start_pos = *pos;
|
||||
let mut comment = String::new();
|
||||
state.comment_level = scan_comment(stream, state.comment_level, pos, &mut comment);
|
||||
let mut comment = if state.include_comments {
|
||||
Some(String::new())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
if state.include_comments || is_doc_comment(&comment) {
|
||||
return Some((Token::Comment(comment), start_pos));
|
||||
state.comment_level = scan_block_comment(stream, state.comment_level, pos, &mut comment);
|
||||
|
||||
if state.include_comments || is_doc_comment(comment.as_ref().unwrap()) {
|
||||
return Some((Token::Comment(comment.unwrap()), start_pos));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1282,10 +1287,13 @@ fn get_next_token_inner(
|
||||
('/', '/') => {
|
||||
eat_next(stream, pos);
|
||||
|
||||
let mut comment = match stream.peek_next().unwrap() {
|
||||
'/' => "///".to_string(),
|
||||
_ if state.include_comments => "//".to_string(),
|
||||
_ => String::new(),
|
||||
let mut comment = match stream.peek_next() {
|
||||
Some('/') => {
|
||||
eat_next(stream, pos);
|
||||
Some("///".to_string())
|
||||
}
|
||||
_ if state.include_comments => Some("//".to_string()),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
while let Some(c) = stream.get_next() {
|
||||
@ -1293,30 +1301,33 @@ fn get_next_token_inner(
|
||||
pos.new_line();
|
||||
break;
|
||||
}
|
||||
|
||||
if !comment.is_empty() {
|
||||
if let Some(ref mut comment) = comment {
|
||||
comment.push(c);
|
||||
}
|
||||
pos.advance();
|
||||
}
|
||||
|
||||
if state.include_comments || is_doc_comment(&comment) {
|
||||
if let Some(comment) = comment {
|
||||
return Some((Token::Comment(comment), start_pos));
|
||||
}
|
||||
}
|
||||
('/', '*') => {
|
||||
state.comment_level = 1;
|
||||
|
||||
eat_next(stream, pos);
|
||||
|
||||
let mut comment = match stream.peek_next().unwrap() {
|
||||
'*' => "/**".to_string(),
|
||||
_ if state.include_comments => "/*".to_string(),
|
||||
_ => String::new(),
|
||||
let mut comment = match stream.peek_next() {
|
||||
Some('*') => {
|
||||
eat_next(stream, pos);
|
||||
Some("/**".to_string())
|
||||
}
|
||||
_ if state.include_comments => Some("/*".to_string()),
|
||||
_ => None,
|
||||
};
|
||||
state.comment_level = scan_comment(stream, state.comment_level, pos, &mut comment);
|
||||
|
||||
if state.include_comments || is_doc_comment(&comment) {
|
||||
state.comment_level =
|
||||
scan_block_comment(stream, state.comment_level, pos, &mut comment);
|
||||
|
||||
if let Some(comment) = comment {
|
||||
return Some((Token::Comment(comment), start_pos));
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ fn test_closures_data_race() -> Result<(), Box<EvalAltResult>> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
type MyType = Rc<RefCell<INT>>;
|
||||
type TestStruct = Rc<RefCell<INT>>;
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
@ -203,18 +203,18 @@ type MyType = Rc<RefCell<INT>>;
|
||||
fn test_closures_shared_obj() -> Result<(), Box<EvalAltResult>> {
|
||||
let mut engine = Engine::new();
|
||||
|
||||
// Register API on MyType
|
||||
// Register API on TestStruct
|
||||
engine
|
||||
.register_type_with_name::<MyType>("MyType")
|
||||
.register_type_with_name::<TestStruct>("TestStruct")
|
||||
.register_get_set(
|
||||
"data",
|
||||
|p: &mut MyType| *p.borrow(),
|
||||
|p: &mut MyType, value: INT| *p.borrow_mut() = value,
|
||||
|p: &mut TestStruct| *p.borrow(),
|
||||
|p: &mut TestStruct, value: INT| *p.borrow_mut() = value,
|
||||
)
|
||||
.register_fn("+=", |p1: &mut MyType, p2: MyType| {
|
||||
.register_fn("+=", |p1: &mut TestStruct, p2: TestStruct| {
|
||||
*p1.borrow_mut() += *p2.borrow()
|
||||
})
|
||||
.register_fn("-=", |p1: &mut MyType, p2: MyType| {
|
||||
.register_fn("-=", |p1: &mut TestStruct, p2: TestStruct| {
|
||||
*p1.borrow_mut() -= *p2.borrow()
|
||||
});
|
||||
|
||||
@ -234,7 +234,7 @@ fn test_closures_shared_obj() -> Result<(), Box<EvalAltResult>> {
|
||||
let res = engine.eval_ast::<Map>(&ast)?;
|
||||
|
||||
// Make closure
|
||||
let f = move |p1: MyType, p2: MyType| -> Result<(), Box<EvalAltResult>> {
|
||||
let f = move |p1: TestStruct, p2: TestStruct| -> Result<(), Box<EvalAltResult>> {
|
||||
let action_ptr = res["action"].clone().cast::<FnPtr>();
|
||||
let name = action_ptr.fn_name();
|
||||
engine.call_fn::<_, ()>(&mut Scope::new(), &ast, name, (p1, p2))
|
||||
|
@ -21,5 +21,62 @@ fn test_comments() -> Result<(), Box<EvalAltResult>> {
|
||||
42
|
||||
);
|
||||
|
||||
assert_eq!(engine.eval::<()>("/* Hello world */")?, ());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
#[test]
|
||||
fn test_comments_doc() -> Result<(), Box<EvalAltResult>> {
|
||||
let engine = Engine::new();
|
||||
|
||||
let ast = engine.compile(
|
||||
r"
|
||||
/// Hello world
|
||||
|
||||
|
||||
fn foo() {}
|
||||
",
|
||||
)?;
|
||||
|
||||
assert_eq!(
|
||||
ast.iter_functions().next().unwrap().comments[0],
|
||||
"/// Hello world"
|
||||
);
|
||||
|
||||
assert!(engine
|
||||
.compile(
|
||||
r"
|
||||
/// Hello world
|
||||
let x = 42;
|
||||
"
|
||||
)
|
||||
.is_err());
|
||||
|
||||
let ast = engine.compile(
|
||||
r"
|
||||
/** Hello world
|
||||
** how are you?
|
||||
**/
|
||||
|
||||
fn foo() {}
|
||||
",
|
||||
)?;
|
||||
|
||||
assert_eq!(
|
||||
ast.iter_functions().next().unwrap().comments[0],
|
||||
"/** Hello world\n ** how are you?\n **/"
|
||||
);
|
||||
|
||||
assert!(engine
|
||||
.compile(
|
||||
r"
|
||||
/** Hello world */
|
||||
let x = 42;
|
||||
"
|
||||
)
|
||||
.is_err());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -29,8 +29,11 @@ fn test_custom_syntax() -> Result<(), Box<EvalAltResult>> {
|
||||
|
||||
context.scope_mut().push(var_name, 0 as INT);
|
||||
|
||||
let mut count: INT = 0;
|
||||
|
||||
loop {
|
||||
context.eval_expression_tree(stmt)?;
|
||||
count += 1;
|
||||
|
||||
let stop = !context
|
||||
.eval_expression_tree(condition)?
|
||||
@ -48,10 +51,20 @@ fn test_custom_syntax() -> Result<(), Box<EvalAltResult>> {
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Dynamic::UNIT)
|
||||
Ok(count.into())
|
||||
},
|
||||
)?;
|
||||
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(
|
||||
r"
|
||||
let x = 0;
|
||||
let foo = (exec |x| -> { x += 2 } while x < 42) * 10;
|
||||
foo
|
||||
"
|
||||
)?,
|
||||
210
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(
|
||||
r"
|
||||
|