All the changes in this project are documented in this file.
The format follows Keep a Changelog.
- Replaced default Rust hasher with a 80% faster one
- README.md example code fixed.
- Added
stack underflow errornow is returned when an operator doesn't have enough elements in the stack. - Added support for
logical operators,comparisons, andbitwise operations. - Added
trueandfalsekeywords.
- Added support for the module operator (
%)
- Exponentiation (
^) now uses powi internally in integer cases. - Parsing into RPN no longer makes an intermediate step through infix notation, improving parsing performance by 40–75%.
Context::empty()method returning a context withEmptyResolversExprCompilerandExprEvaluatortraits for the differentExpr<T>types.Ptrstruct for handling raw pointers to resolver contents.- New
Exprvariant optimized for lockedContexts - New
Exprvariants optimized for indexedResolvers
- Parsing of nested functions with multiple arguments.
Expr<T>now directly exposes the specializedeval()andcompile()methods.DefaultVarResolverandSmallVarResolvernow allow keys other than String.- Improved public interfaces of several resolvers.
Resolvers can no longer be locked individually, locking is now managed by the owningContext.ExprFnis no longer a type alias, it is now a struct.- Evaluating expressions now requires you to provide the stack.
- Removed the
Evaluatorconcept and theRpnEvaluatorstruct.
Unary minus (-)operator no longer incorrectly takes precedence overexponentiation (^).
- Created RpnEvaluator able to evaluate mathematical expressions.
- Support for variables and functions.
- Support for the following operators:
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Exponentiation (^)
- Unary minus (-)
- Created five Resolvers, each one with different pros and cons:
- DefaultVarResolver
- IndexedVarResolver
- SmallVarResolver
- ConstantResolver
- EmptyResolver
- Feature flag
bench-internalfor running internal benchmarks.