v.0.19.10
This version improves on error source reporting and fixes a number of bugs.
Version 0.19.10
released to crates.io
.
Bug fixes
no_std
feature now compiles correctly (bug introduced in0.19.9
).- Bug in
FileModuleResolver::clear_cache_for_path
path mapping fixed. - Some optimizer fringe cases are fixed - related to constants propagation when the evil
eval
is present.
Breaking changes
- The error variant
EvalAltResult::ErrorInFunctionCall
has a new parameter holding the source of the function. ParseErrorType::WrongFnDefinition
is renamedFnWrongDefinition
.- Redefining an existing function within the same script now throws a new
ParseErrorType::FnDuplicatedDefinition
. This is to prevent accidental overwriting an earlier function definition. AST::set_source
is now split intoAST::set_source
andAST::clear_source
.
New features
Engine::compile_into_self_contained
compiles a script into anAST
and eagerly resolves allimport
statements with string literal paths. The resolved modules are directly embedded into theAST
. When theAST
is later evaluated,import
statements directly yield the pre-resolved modules without going through the resolution process once again.AST::walk
,Stmt::walk
andExpr::walk
internal API's to recursively walk anAST
.
Enhancements
- Source information is provided when there is an error within a call to a function defined in another module.
- Source information is provided to the
NativeCallContext
for native Rust functions. EvalAltResult::clear_position
to clear the position information of an error - useful when only the message is needed and the position doesn't need to be printed out.- A new optional function
resolve_ast
is added to theModuleResolver
trait for advanced usage.