Skip to content

v.0.19.10

Compare
Choose a tag to compare
@schungx schungx released this 14 Jan 11:35
0744884

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 in 0.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 renamed FnWrongDefinition.
  • 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 into AST::set_source and AST::clear_source.

New features

  • Engine::compile_into_self_contained compiles a script into an AST and eagerly resolves all import statements with string literal paths. The resolved modules are directly embedded into the AST. When the AST is later evaluated, import statements directly yield the pre-resolved modules without going through the resolution process once again.
  • AST::walk, Stmt::walk and Expr::walk internal API's to recursively walk an AST.

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 the ModuleResolver trait for advanced usage.