8.1.0 - 2022-07-22
- Get all variables or variable/value pairs in a context via a new trait
IterateVariablesContext
(#108) - Functions
iter_(read/write)_variable_identifiers
, which iterate over allReadVariableIdentifier
s or allWriteVariableIdentifier
s in an operator tree (#110)
My warmhearted thanks goes to:
8.0.0 - 2022-07-06
- Builtin functions to check for nan, infinity and subnormality in floats (#101)
- Builtin random function (#102)
- Implement
TryFrom<Value>
for all types a value can hold (#105) - Split VariableIdentifier node into read and write variants (#106)
My warmhearted thanks goes to:
7.2.0 - 2022-03-16
- The builtin function
if
, which mimics the if-else construct existing in many programming languages.
My warmhearted thanks goes to:
7.1.1 - 2022-03-14
- Set regex minimum version 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.
7.1.0 - 2022-03-13
- Bit shift functions
shl
andshr
, same as Rust's shift functions oni64
.
My warmhearted thanks goes to
7.0.1 - 2022-02-20
- Updated the optional dependencies, and fixed them to a minimum tested version. For simplicity, I fixed them to the newest version, but since I export none of them, this is luckily not breaking.
- Updated the dev-dependencies.
7.0.0 - 2022-01-13
- Made the
EvalexprError
enumnon_exhaustive
.
- Expressions that have dangling parenthese expressions such as
4(5)
now produce an error.
My warmhearted thanks goes to
6.6.0 - 2021-10-13
- Bitwise operators as builtin functions
bitand
,bitor
,bitxor
,bitnot
(#88) - Public immutable and mutable accessor functions to the operator and children of a Node.
My warmhearted thanks goes to
6.5.0 - 2021-08-16
- Make
Function::new
able to accept closures (thanks to Jakub Dąbek)
My warmhearted thanks goes to
6.4.0 - 2021-07-21
- Minimum supported Rust version (MSRV) increased to
1.46.0
- Increased test coverage by adding more test and ignoring untestable files
- Allow scientific notation in float literals
- Made some functions
const
. This increased the MSRV
eval_number
methods returnedEvalexprError::ExpectedFloat
before, now they correctly returnEvalexprError::ExpectedNumber
My warmhearted thanks goes to
6.3.0 - 2021-07-06
- Implement more builtin math methods
My warmhearted thanks goes to
6.2.0 - 2021-06-24
- Increased test coverage
- Implemented
Clone
forHashMapContext
My warmhearted thanks goes to
6.1.1 - 2021-06-22
- Improved syntax of documentation
6.1.0 - 2021-06-02
- Macro
math_consts_context
adding all of Rust'sf64
constants - All common math functions implemented by Rust's
f64
are now builtin - Continuous integration and test coverage report
My warmhearted thanks goes to
6.0.0 - 2021-05-28
#![forbid(unsafe_code)]
- Made
Function
deriveClone
- Ensure that
Function
implementsSend
andSync
Cargo.lock
- Decomposed
Context
intoContext
,ContextWithMutableVariables
andContextWithMutableFunctions
- Replaced the
get_function
method ofContext
with acall_function
method
My warmhearted thanks goes to
5.1.0 - 2021-05-28
- Make
Node
cloneable
My warmhearted thanks goes to
5.0.5 - 2019-09-13
- is-it-maintained badges had wrong repository definitions
- maintenance status was given wrongly
- move maintenance status to top
5.0.4 - 2019-09-13
- maintenance badge
- is-it-maintained badges
5.0.3 - 2019-08-30
- The
!=
operator was wrongfully parsed as Token::Eq
5.0.2 - 2019-08-30
- Removed target.bench.dev-dependencies completely, as they can be just listed under the normal dev-dependencies
5.0.1 - 2019-08-30
- Bench dependencies are now dev-dependencies so they are not listed on crates.io as normal dependencies anymore
5.0.0 - 'Sanity' - 2019-08-30
Finally, '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.
- Iterator over all identifiers within an expression, including duplicates
- Iterators over only variable or only function identifiers within an expression, including duplicates
- Overload the
+
operator to concatenate strings - Overload
<
,<=
,>
and>=
for strings using lexical ordering (Note:==
and!=
compare strings as expected) - Add
len
,str::regex_matches
,str::regex_replace
,str::to_lowercase
,str::to_uppercase
,str::trim
functions for strings - Add a macro for more convenient definition of contexts including the direct definition of static contexts
- Add API for value decomposition
- Allow using context operations in
eval
calls without context - Operator assignment operators for each binary operation (
+=
,-=
, ...) - The
Operator
enum is now public for better error types - Benchmarks for observing performance of future releases
- Function arguments are not decomposed anymore. The function implementation will receive exactly one argument now. This allows the function to be called on a tuple properly.
- Operators are an enum now instead of trait objects
- Update to Rust 2018
- Updated dependencies
- Allow variable assignments in eval calls without context.
A
HashMapContext
is created automatically now. - The error string for
ExpectedNumber
was wrong - Operators panicked when adding a number to a string
- Some documentation was not updated for the 4.x releases
My warmhearted thanks goes to
4.1.0 - 2019-03-31
- Export
expect_function_argument_amount
4.0.0 - 2019-03-30
- String constants
3.1.0 - 2019-03-28
- Add serde support to
HashMapContext
- Make
HashMapContext
deriveDefault
andDebug
- Changed name of serde feature flag to
serde_support
3.0.0 - 2019-03-28
The 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.
- Methods
Node::eval_<type>_with_context_mut
and crate leveleval_<type>_with_context_mut
- Empty type and corresponding shortcut methods. The empty type is emitted by empty expressions or empty subexpressions
()
. - The assignment operator
=
- The expression chaining operator
;
- Generic arguments from
Context
traits are now static to allow using trait objects ofContext
EvalexprError::EmptyExpression
is not required anymore since empty expressions now evaluate to the empty type
- Merge
ContextMut
trait intoContext
trait
2.0.0 - 2019-03-28
The 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.
- Add the
ContextMut
trait, that is a manipulable configuration/context - Add
ContextNotManipulable
error variant for theEmptyContext
- Make the
TupleType
alias public - Add the
ValueType
enum that represents the type of a value for easier comparisons and matchings - Add
EvalexprResult<T>
type that uses theEvalexprError
type (renamed fromError
) - Add
Node::eval_number
andNode::eval_number_with_context
to evaluate to int or float and silently converting to float - Add
eval_number
andeval_number_with_context
crate methods to evaluate to int or float and silently converting to float
- Get rid of some unwraps to improve safety
- Rename
Error
toEvalexprError
- Rename
Configuration
toContext
- Rename
HashMapConfiguration
toHashMapContext
andEmptyConfiguration
toEmptyContext
- Rename
Value::as_float
toValue::as_number
and add newValue::as_float
that fails if value is an integer
1.2.0 - 2019-03-23
- Add
serde
feature - Implement
serde::de::Deserialize
forNode
- Document
serde
usage - Add custom error type with a
String
message
- Highlighting in documentation
1.1.0 - 2019-03-20
- Internal aliases
IntType
andFloatType
used by theValue
enum are now public - Type alias
TupleType
used to represent tuples was added - Error types like
Error::ExpectedInt
for expecting each value type were added - Shortcut functions like
eval_int
oreval_int_with_configuration
to evaluate directly into a value type were added - Documentation for the shortcut functions was added
- Functions to decompose
Value
s were added and documented
- Integration tests were removed from shipped crate
- Wording of some documentation items was changed to improve readability
1.0.0 - 2019-03-20
- First stable release