v1.3.0
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 deserializingOption
.
New features
BLOB
(essentially a byte array) is added as a supported primitive value type parallel to arrays.- New options for
Engine
which allows disablingif
-expressions,switch
-expressions, statement expressions, anonymous functions and/or looping (i.e.while
,loop
,do
andfor
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 viaEngine::set_strict_variables
) to throw parse errors on undefined variable usage. Two new parse error variants,ParseErrorType::VariableNotFound
andParseErrorType::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
andinto_typed_array
forDynamic
. - Added
FnPtr::call
andFnPtr::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 toExpr
.
Deprecated and Gated API's
NativeCallContext::new
is deprecated because it is simpler to call a function pointer viaFnPtr::call
.AST::merge_filtered
andAST::combine_filtered
are no longer exported underno_function
.AST::new
andAST::new_with_source
are moved underinternals
.FnPtr::call_dynamic
is deprecated in favor ofFnPtr::call_raw
.