Repository navigation
v.0.19.0
The major new feature for this version is Plugins support, powered by procedural macros.
Plugins make it extremely easy to develop and register Rust functions with an Engine.
Version 0.19.0 released to crates.io.
Bug fixes
ifstatement with an emptytrueblock would not evaluate thefalseblock. This is now fixed.- Fixes a bug in
Module::set_fn_4_mut. - Module API's now properly handle
&strandStringparameters. - Indexers are available under
no_object. - Registered operator-assignment functions (e.g.
+=) now work correctly.
Breaking changes
Engine::register_set_resultandEngine::register_indexer_set_resultnow take a function that returnsResult<(), Box<EvalAltResult>>.Engine::register_indexer_XXXandModule::set_indexer_XXXpanic when the type isArray,MaporString.EvalAltResulthas a new variantErrorInModulewhich holds errors when loading an external module.Module::eval_ast_as_newnow takes an extra boolean parameter, indicating whether to encapsulate the entire module into a separate namespace.- Functions in
FileModuleResolverloaded modules now can cross-call each other in addition to functions in the global namespace. For the old behavior, useMergingFileModuleResolverinstead. - New
EvalAltResult::ErrorInModulevariant capturing errors when loading a module from a script file.
New features
- Plugins support via procedural macros.
- Scripted functions are allowed in packages.
parse_intandparse_floatfunctions for parsing numbers;splitfunction for splitting strings.AST::iter_functionsandModule::iter_script_fn_infoto iterate functions.- Functions iteration functions for
ASTandModulenow takeFnMutinstead ofFn. - New
FileModuleResolverthat encapsulates the entireASTof the module script, allowing function cross-calling. The old version is renamedMergingFileModuleResolver. +and-operators for timestamps to increment/decrement by seconds.