Rhai v1.1.0 Release Notes

  • ๐Ÿ› Bug fixes

    • Custom syntax starting with a disabled standard keyword now works properly.
    • ๐Ÿšš When calling Engine::call_fn, new variables defined during evaluation of the body script are removed and no longer spill into the function call.
    • ๐Ÿ›  NamespaceRef::new is fixed.

    โœจ Enhancements

    Engine API

    • Engine::consume_XXX methods are renamed to Engine::run_XXX to make meanings clearer. The consume_XXX API is deprecated.
    • Engine::register_type_XXX are now available even under no_object.
    • ๐Ÿ“œ Added Engine::on_parse_token to allow remapping certain tokens during parsing.
    • Added Engine::const_empty_string to merge empty strings into a single instance.

    Custom Syntax

    • ๐Ÿ‘ $symbol$ is supported in custom syntax to match any symbol.
    • Custom syntax with $block$, } or ; as the last symbol are now self-terminating (i.e. no need to attach a terminating ;).

    Dynamic Values

    • Dynamic::as_string and Dynamic::as_immutable_string are deprecated and replaced by into_string and into_immutable_string respectively.
    • โž• Added a number of constants to Dynamic.
    • โž• Added a number of constants and fromXXX constant methods to Dynamic.
    • โž• Added sin, cos and tan for Decimal values.

    Decimal Values

    • parse_float(), PI() and E() now defer to Decimal under no_float if decimal is turned on.
    • โž• Added log10() for Decimal.
    • ln for Decimal is now checked and won't panic.

    String Values

    • SmartString now uses LazyCompact instead of Compact to minimize allocations.
    • โž• Added pop for strings.
    • โž• Added ImmutableString::ptr_eq to test if two strings point to the same allocation.
    • ๐Ÿ“‡ The serde feature of SmartString is turned on under metadata to make Map serializable.

    Scope API

    • Scope::set_value now takes anything that implements Into<Cow<str> >.
    • โž• Added Scope::is_constant to check if a variable is constant.
    • Added Scope::set_or_push to add a new variable only if one doesn't already exist.

    AST API

    • โž• Added ASTNode::position.
    • ๐Ÿšš ReturnType is removed in favor of option flags for Stmt::Return.
    • ๐Ÿ”€ Stmt::Break and Stmt::Continue are merged into Stmt::BreakLoop via an option flag.
    • StaticVec is changed to keep three items inline instead of four.