All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
%
remainder operator for int, float and dec
- Fix parsing unary operators so they no longer require parentheses
- Cleaned up leftover documentation for json format rules
- Reserved 'key' and 'val' to list of reserved keywords for later use
- Added missing values to the list of reserved keywords
- Symbols file parsing, this will be implemented later, symbols can still be inserted in code
- Parse symbols from normal expression map syntax
- Symbols are reusable named expressions
- Implement
datetime
andduration
functions for the DateTime and Duration types to evaluate to the unmodified value - Do not feature gate the serde serializer for
Value
s
- json rules parsing, all rules now need to be written using the DSL
EvaluationContext
- evaluate method from
Rule
, rules now need to be evaluated as part of aRuleSet
- Bump lalrpop dependency to 0.20.2
- Do not panic on division by zero
some
,none
,datetime
,uppercase
, andlowercase
keywords as alternatives for keywords with_
- Improved rule parsing error
- Implement <, <=, > and >= for DateTime and Duration values
- Bitwise
&
,|
and^
operators
- Allow nesting if statements inside if, then or else clauses without ()
- Bump msrv to 1.74.1 to resolve pub/non-pub type issues
- Improved error handling parsing rules
- DateTime and Duration types based on Chrono
0.7.5 - 2024-03-11
- Support for binary, octal and hexadecimal integers
- trim operation for strings
- round, floor and fract operation for floats and decimals
- Better documentation for new DSL
- String un-escaping support
- Bump msrv to 1.70.0 to be able to use newer version of lalrpop
0.7.4 - 2023-11-07
contains
andin
work on Value::Int and can be used to check if flags are set in an integer
0.7.3 - 2023-11-03
- Better
None
handling in most other operators - Bump minimum supported Rust version to 1.65.0 because or regex dependency
0.7.2 - 2023-10-06
- Better
None
handling inindex
andcontains
expressions
0.7.1 - 2023-10-05
- Make contains and is work on string values
0.7.0 - 2023-08-28
- Implement
Display
forValue
andExpr
types - Lalrpop parser for rules written in reval DSL
- Implement
to_upper
andto_lower
functions
- Return wrapped error type from json parsing rules
- Remove faulty check for valid identifier for rules names
- Simplified index expressions so you can only index by string or usize, not by expressions anymore
- Move to using BTreeMap for Value::Map
- The half-finished nom-based parser for reval DSL rules is removed in favor of the lalrpop version
0.6.6 - 2023-07-03
- gt, gte, lt and lte now return false if the first parameter is
None
0.6.5 - 2023-06-27
contains
expression for checking if a vec contains an item or a map contains a key
- Split UnknownValue error into UnknownRef and UnknownIndex
0.6.4 - 2023-03-28
- Added
Rule::expr
getter to read the expression from a rule - Re-introduced
add_functions
to add multiple functions at once on theRuleSet
Builder
- Made
Expr::func
constructor more flexible by taking Into for the function name
0.6.3 - 2023-03-17
- A direct conversion from Value::Map to a BTreeMap<String, Value>
- Fixed the direct conversion from Value::Map to a HashMap<String, Value>
0.6.2 - 2023-03-17
- Fixed the error message when trying to
try_from
a Value into aHashMap
- Fixed the error message when trying to
try_from
a Value into aVec
- Made converting from and into Value::Vec and Value::Map more flexible, we now also map the contents of the vec and map
0.6.1 - 2023-02-25
- Add the
none
value to the json DSL - Add
is_some
andis_none
functions to test for none values
0.6.0 - 2023-02-18
- A
description
field forRule
s
- Do not allow rules or functions with duplicate names
- Do not allow rules or functions with invalid names
add_function
onUserFunctions
and rulesetBuilder
now takes non-boxedUserFunction
s
- Removed
add_functions
method fromUserfunctions
and rulesetBuilder
because it does not make much sense - Removed
get
method fromUserFunctions
public api - Removed
BoxedFunction
type from prelude and public api
0.5.2 - 2023-01-20
- Utility function for creating
Expr::Reference
From<usize>
implementation forValue
- Allow simple
String
orusize
index parameter foridx
besides expressions
0.5.1 - 2023-01-18
- Documentation for rules writers
- Into implementation from
Value
toExpr
- Make add, sub, mul, div, and and or in the json rules language take more than 2 operands Left associatively combine them into their respective expressions
0.5.0 - 2023-01-04
- if expression.
FunctionError
type is replaced withanyhow::Error
- Methods for adding rules and functions to a
RuleSet
directly.
0.5.0 - 2023-01-04
Was yanked and replaced by 0.5.0
0.4.4 - 2022-12-08
- Add
BoxedFunction
to the prelude Rule::name
method
- Equality comparison was not working
Value::new
constructor
0.4.3 - 2022-12-05
- Constuctor expressions for Map and Vec
0.4.2 - 2022-12-01
- Add conversions for a bunch of numerical types to an from
Value
0.4.1 - 2022-11-30
- Fix adding multiple user-functions
0.4.0 - 2022-11-30
- Methods for adding multiple rules and user-functions to a ruleset at once
- Add conversions to/from Value::Map and Value::Vec as convenience
- Add name method to
UserFunction
trait instead of passing the name into the builder - Rule and RuleSet now return
Outcome
instances after evaluation that contain some metadata about the evaluation RuleSet::evaluate
does not halt rule evaluation when one rule returnsErr
- Bumped minimum supported Rust version to 1.62.1
0.3.0 - 2022-11-29
- Allow parsing individual
Expr
instances from json - Make
Expr::evaluate
public - Add
cacheable
method toUserFunction
trait
- Make
parse::parse
a method onExpr
- Make
and
andor
evaluation lazy
0.2.0 - 2022-11-27
- Add neg function to invert sign of numeric values
- Add cast functions for numeric values
- Remove implicit casts in numeric operations
0.1.3 - 2022-11-26
- User-function error type
- TryFrom<> implementations to convert Value into primitive types
- User Function example and doctest
- Parse function call for json rules
- Some better documentation
0.1.2 - 2022-11-22
- Added Ruleset and UserFunction to prelude
- Removed Error types from prelude
- Moved
parse_json
into theRule
type
0.1.1 - 2022-11-22
- This changelog
- Ruleset builder
- Prelude for easy import of
reval
types
- Make
evaluate
method take any parameter that implementsserde::Serialize
0.1.0 - 2022-11-21
- Initial release
- Parse rules from json
- Experimental support for parsing rules with nom
- Implement
Value
type that represents input and output for rules - Add serialize support for
Value
so any type that implements serdeSerialize
can be used as input - Implement
Expr
type as the AST for rules - Implement a
RuleSet
as an entry point for executing a set of rules on a piece of data - async
UserFunction
support