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_dynamicnow supports deserializingOption.
New features
BLOB(essentially a byte array) is added as a supported primitive value type parallel to arrays.- New options for
Enginewhich allows disablingif-expressions,switch-expressions, statement expressions, anonymous functions and/or looping (i.e.while,loop,doandforstatements):Engine::set_allow_if_expressionEngine::set_allow_switch_expressionEngine::set_allow_statement_expressionEngine::set_allow_anonymous_fnEngine::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::VariableNotFoundandParseErrorType::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_rawto register a custom type based on a fully-qualified type path. - Added
into_arrayandinto_typed_arrayforDynamic. - Added
FnPtr::callandFnPtr::call_within_contextto simplify calling a function pointer. - A function's hashes are included in its JSON metadata to assist in debugging. Each function's
baseHashfield in the JSON object should map directly to the pre-calculated hash in the function call. Expressionnow derefs toExpr.
Deprecated and Gated API's
NativeCallContext::newis deprecated because it is simpler to call a function pointer viaFnPtr::call.AST::merge_filteredandAST::combine_filteredare no longer exported underno_function.AST::newandAST::new_with_sourceare moved underinternals.FnPtr::call_dynamicis deprecated in favor ofFnPtr::call_raw.