v1.1.0
Version 1.1.0 released to crates.io.
Bug fixes
- Custom syntax starting with a disabled standard keyword now works properly.
- When calling
Engine::call_fn, new variables defined during evaluation of the body script are removed and no longer spill into the function call. NamespaceRef::newis fixed.
Enhancements
Engine API
Engine::consume_XXXmethods are renamed toEngine::run_XXXto make meanings clearer. Theconsume_XXXAPI is deprecated.Engine::register_type_XXXare now available even underno_object.- Added
Engine::on_parse_tokento allow remapping certain tokens during parsing. - Added
Engine::const_empty_stringto merge empty strings into a single instance.
Custom Syntax
$symbol$is supported in custom syntax to match any symbol.- Custom syntax with
$block$,}or;as the last symbol are now self-terminating (i.e. no need to attach a terminating;).
Dynamic Values
Dynamic::as_stringandDynamic::as_immutable_stringare deprecated and replaced byinto_stringandinto_immutable_stringrespectively.- Added a number of constants to
Dynamic. - Added a number of constants and
fromXXXconstant methods toDynamic. - Added
sin,cosandtanforDecimalvalues.
Decimal Values
parse_float(),PI()andE()now defer toDecimalunderno_floatifdecimalis turned on.- Added
log10()forDecimal. lnforDecimalis now checked and won't panic.
String Values
SmartStringnow usesLazyCompactinstead ofCompactto minimize allocations.- Added
popfor strings. - Added
ImmutableString::ptr_eqto test if two strings point to the same allocation. - The
serdefeature ofSmartStringis turned on undermetadatato makeMapserializable.
Scope API
Scope::set_valuenow takes anything that implementsInto<Cow<str>>.- Added
Scope::is_constantto check if a variable is constant. - Added
Scope::set_or_pushto add a new variable only if one doesn't already exist.
AST API
- Added
ASTNode::position. ReturnTypeis removed in favor of option flags forStmt::Return.Stmt::BreakandStmt::Continueare merged intoStmt::BreakLoopvia an option flag.StaticVecis changed to keep three items inline instead of four.