v.0.19.13
This version introduces functions with Dynamic
parameters acting as wildcards.
Version 0.19.13
released to crates.io
.
Bug fixes
- Bug in
Position::is_beginning_of_line
is fixed.
Breaking changes
- For plugin functions, constants passed to methods (i.e.
&mut
parameter) now raise an error unless the functions are marked with#[rhai_fn(pure)]
. - Visibility (i.e.
pub
or not) for generated plugin modules now follow the visibility of the underlying module. - Comparison operators between the sames types or different numeric types now throw errors when they're not defined instead of returning the default. Only comparing between different types will return the default.
- Default stack-overflow and top-level expression nesting limits for release builds are lowered to 64 from 128.
Engine::call_fn_dynamic
takes an additional parameter to optionally evaluate the givenAST
before calling the function.
New features
- Functions are now allowed to have
Dynamic
arguments. #[rhai_fn(pure)]
attribute to mark a plugin function with&mut
parameter as pure so constants can be passed to it. Without it, passing a constant value into the&mut
parameter will now raise an error.
Enhancements
- Built-in operators between
FLOAT
/Decimal
andINT
are now implemented for more speed under those cases. - Error position in
eval
statements is now wrapped in anEvalAltResult::ErrorInFunctionCall
. Position
now implementsAdd
andAddAssign
.Scope
now implementsIntoIterator
.- Strings now have the
-
/-=
operators and theremove
method to delete a sub-string/character. - Strings now have the
split_rev
method and variations ofsplit
with maximum number of segments. - Arrays now have the
split
method. - Comparisons between
FLOAT
/Decimal
andINT
are now built in. - Comparisons between string and
char
are now built in. Engine::call_fn_dynamic
can now optionally evaluate the givenAST
before calling the function.