Skip to content

v.0.19.13

Compare
Choose a tag to compare
@schungx schungx released this 27 Feb 04:33
0c62a62

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 given AST 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 and INT are now implemented for more speed under those cases.
  • Error position in eval statements is now wrapped in an EvalAltResult::ErrorInFunctionCall.
  • Position now implements Add and AddAssign.
  • Scope now implements IntoIterator.
  • Strings now have the -/-= operators and the remove method to delete a sub-string/character.
  • Strings now have the split_rev method and variations of split with maximum number of segments.
  • Arrays now have the split method.
  • Comparisons between FLOAT/Decimal and INT are now built in.
  • Comparisons between string and char are now built in.
  • Engine::call_fn_dynamic can now optionally evaluate the given AST before calling the function.