Skip to content

v1.3.0

Compare
Choose a tag to compare
@schungx schungx released this 12 Dec 09:57
aa9b488

Version 1.3.0 released to crates.io.

This version adds native support for BLOB's (byte arrays), as well as a number of configuration settings to fine-tun language features.

Compiler requirement

  • Minimum compiler version is now 1.51.

Bug fixes

  • from_dynamic now supports deserializing Option.

New features

  • BLOB (essentially a byte array) is added as a supported primitive value type parallel to arrays.
  • New options for Engine which allows disabling if-expressions, switch-expressions, statement expressions, anonymous functions and/or looping (i.e. while, loop, do and for statements):
    • Engine::set_allow_if_expression
    • Engine::set_allow_switch_expression
    • Engine::set_allow_statement_expression
    • Engine::set_allow_anonymous_fn
    • Engine::set_allow_looping
  • New strict variables mode for Engine (enabled via Engine::set_strict_variables) to throw parse errors on undefined variable usage. Two new parse error variants, ParseErrorType::VariableNotFound and ParseErrorType::ModuleNotFound, are added.

Enhancements

  • Two double quotes ("") in a string literal now maps to "; two back-ticks (``) in a literal string now maps to `.
  • Added Engine::register_type_with_name_raw to register a custom type based on a fully-qualified type path.
  • Added into_array and into_typed_array for Dynamic.
  • Added FnPtr::call and FnPtr::call_within_context to simplify calling a function pointer.
  • A function's hashes are included in its JSON metadata to assist in debugging. Each function's baseHash field in the JSON object should map directly to the pre-calculated hash in the function call.
  • Expression now derefs to Expr.

Deprecated and Gated API's

  • NativeCallContext::new is deprecated because it is simpler to call a function pointer via FnPtr::call.
  • AST::merge_filtered and AST::combine_filtered are no longer exported under no_function.
  • AST::new and AST::new_with_source are moved under internals.
  • FnPtr::call_dynamic is deprecated in favor of FnPtr::call_raw.