0b as binary and 0o as octal (#194)My warmhearted thanks goes to:
My warmhearted thanks goes to:
My warmhearted thanks goes to:
ron format in documentation (#177)Value construction functions in documentation (#178)Comments section in documentation.My warmhearted thanks goes to:
math_consts_context! macro that was broken by in 12.0.0 (#173)My warmhearted thanks goes to:
evalexpr is now licensed under the GNU Affero General Public License Version 3str::from does not add double quotes around strings anymore, except if those are inside a tuple (#169)My warmhearted thanks goes to:
str::substring (#158)WrongFunctionArgumentAmount now expects a range of argument amounts instead of a single one (#159)My warmhearted thanks goes to:
clear, clear_variables and clear_functions to HashMapContext (#156)My warmhearted thanks goes to:
My warmhearted thanks goes to:
This should have been a minor release instead of a patch.
Node::iter_operators_mut) and all types of identifiers (Node::iter_identifiers_mut, Node::iter_*_identifiers_mut) (#136)My warmhearted thanks goes to:
1.65.0 in this update.math::abs (#130)cargo install evalexpr. (#133)IterVariablesContext from using a lifetime parameter to GATs (#135)My warmhearted thanks goes to:
My warmhearted thanks goes to:
contains and contains_any (#127)My warmhearted thanks goes to:
My warmhearted thanks goes to:
EvalExprError now derives Clone (#116)f64 and i64 have been replaced with the type aliases FloatType and IntType where applicable (#113)My warmhearted thanks goes to:
IterateVariablesContext (#108)iter_(read/write)_variable_identifiers, which iterate over all ReadVariableIdentifiers or all WriteVariableIdentifiers in an operator tree (#110)My warmhearted thanks goes to:
TryFrom<Value> for all types a value can hold (#105)My warmhearted thanks goes to:
if, which mimics the if-else construct existing in many programming languages.My warmhearted thanks goes to:
1.5.5, as the previous versions contains a security vulnerability.
See https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw?pli=1.
This vulnerability does not affect this crate as of now, but if we ever allow passing parameters to the regex engine, it might.shl and shr, same as Rust's shift functions on i64.My warmhearted thanks goes to
EvalexprError enum non_exhaustive.4(5) now produce an error.My warmhearted thanks goes to
bitand, bitor, bitxor, bitnot (#88)My warmhearted thanks goes to
Function::new able to accept closures (thanks to Jakub Dąbek)My warmhearted thanks goes to
1.46.0const. This increased the MSRVeval_number methods returned EvalexprError::ExpectedFloat before, now they correctly return EvalexprError::ExpectedNumberMy warmhearted thanks goes to
My warmhearted thanks goes to
Clone for HashMapContextMy warmhearted thanks goes to
math_consts_context adding all of Rust's f64 constantsf64 are now builtinMy warmhearted thanks goes to
#![forbid(unsafe_code)]Function derive CloneFunction implements Send and SyncCargo.lockContext into Context, ContextWithMutableVariables and ContextWithMutableFunctionsget_function method of Context with a call_function methodMy warmhearted thanks goes to
Node cloneableMy warmhearted thanks goes to
!= operator was wrongfully parsed as Token::EqFinally, 'Sanity' has been released, including a huge bunch of new features. Notably, and providing a reason for the name of this release, function call and tuple semantics have improved a lot. Functions now always take exactly one argument, but this can then be a tuple. It is now possible to construct tuples of tuples, such that mode complex values can be constructed. As of now there is no way to deconstruct them though.
A lot has been done on string processing, special thanks for that goes to bittrance.
Specifically, under the feature flag regex_support two regex functions for strings are hiding now.
Also, the operators + and comparison operators have been fitted to support strings.
Thanks to lovasoa, we now have a nice macro for context creation.
Thanks to Atul9, the crate is now Rust 2018 compliant.
Thanks to mestachs' request, we now have functions to iterate over identifiers within an expression.
Internally, the structure of the operator tree changed from being &dyn-based to being enum-based.
Also, we have benchmarks now to observe performance changes in future releases.
+ operator to concatenate strings<, <=, > and >= for strings using lexical ordering (Note: == and != compare strings as expected)len, str::regex_matches, str::regex_replace, str::to_lowercase, str::to_uppercase, str::trim functions for stringseval calls without context+=, -=, ...)Operator enum is now public for better error typesHashMapContext is created automatically now.ExpectedNumber was wrongMy warmhearted thanks goes to
expect_function_argument_amountHashMapContextHashMapContext derive Default and Debugserde_supportThe 3.0.0 update transforms the expression evaluator evalexpr to a tiny scripting language.
It allows assignments and chaining of expressions.
Some changes in this update are breaking, hence the major release.
Node::eval_<type>_with_context_mut and crate level eval_<type>_with_context_mut().=;Context traits are now static to allow using trait objects of ContextEvalexprError::EmptyExpression is not required anymore since empty expressions now evaluate to the empty typeContextMut trait into Context traitThe 2.0.0 update is the first step to transform evalexpr to a tiny scripting language with support of at least variable assignment.
The main change for now is that Configuration is called Context, which seems to be a more proper naming for a set of variables that can not only be read, but also manipulated via expressions.
This update includes further renamings and some inconsistencies in the API were fixed.
For more details, see the following subsections.
ContextMut trait, that is a manipulable configuration/contextContextNotManipulable error variant for the EmptyContextTupleType alias publicValueType enum that represents the type of a value for easier comparisons and matchingsEvalexprResult<T> type that uses the EvalexprError type (renamed from Error)Node::eval_number and Node::eval_number_with_context to evaluate to int or float and silently converting to floateval_number and eval_number_with_context crate methods to evaluate to int or float and silently converting to floatError to EvalexprErrorConfiguration to ContextHashMapConfiguration to HashMapContext and EmptyConfiguration to EmptyContextValue::as_float to Value::as_number and add new Value::as_float that fails if value is an integerserde featureserde::de::Deserialize for Nodeserde usageString messageIntType and FloatType used by the Value enum are now publicTupleType used to represent tuples was addedError::ExpectedInt for expecting each value type were addedeval_int or eval_int_with_configuration to evaluate directly into a value type were addedValues were added and documented