Skip to content

deps: update module github.com/antonmedv/expr to v1.16.5

Ghost User requested to merge renovate/github.com-antonmedv-expr-1.x into master

This MR contains the following updates:

Package Type Update Change
github.com/antonmedv/expr require minor v1.12.5 -> v1.16.5

Release Notes

antonmedv/expr (github.com/antonmedv/expr)

v1.16.5

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

output, err := expr.Eval("metric > 100", map[string]any{
    "metric": 200,
})

In this release:

  • Added compiler optimization for boolean operations between all, any, none functions (#​626)
  • Added optional predicate to sum() builtin (#​592)
  • Added sum() compiler optimization c2b609e edb1b5a
  • Improved WithContext to work for methods on env struct (#​602)
  • Improved count() builtin: now predicate is optional 725b702
  • Fixed printing of combinations conditional with binary nodes 6157395
  • Fixed optional chaining to return proper nil 5804ccb

Expr Editor

The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.

Expr Pro

Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.

v1.16.4

Compare Source

This release reverts a wrong compiler optimization for all, any, one, none predicates (#​555).

The optimization contains error logic which can lead to a wrong expression.

It is highly recommended to upgrade to the latest version.

v1.16.3

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

program, err := expr.Compile(`let x = 2 + 2; x ^ x`)
output, err := expr.Run(program, env)

In this release:

  • Improved printing for maps: {(foo + bar): 42}

Expr Editor

The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.

Expr Pro

Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.

v1.16.2

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

program, err := expr.Compile(`now() - created_at < duration("24h")`)
output, err := expr.Run(program, env)

In this release:

  • Added spans (#​584)
  • Added support for chained comparison 1 < 2 < 3 (#​581)
  • Improved builtin int: unwraps underlying int value (#​611)
  • Improved builtin min, max, sum, mean, median (#​580, #​576)
  • Improved bools comparison to be without reflect.DeepEqual (#​585)
  • Fixed case with expr.Operator passes before expr.Env caused error (#​606)
  • Fixed -1 not in [] expressions (#​590)

Expr Editor

The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.

Expr Pro

Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.

v1.16.1

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

program, err := expr.Compile(`now() - created_at < duration("24h")`)
output, err := expr.Run(program, env)

In this release:

  • Fixed recursive operator overloading bug (#​548, #​554)
  • Fixed AST printing of ?.[ operator (ffaec9e)
  • Fixed string literal slicing error (#​543)
  • Compilation performance improvements (95084fb)
  • Improved functions call performance (ed89647)
  • Refactored groupBy() and sortBy() builtins (#​562)
  • Added operator overloading with expr.Function() (#​408)
  • Added concat() builtin (#​565)
  • Added reverse() builtin (#​553)
  • Added program.Locations() method (e53cefe)
  • Added optional array access array?.[42] (#​550)
  • Added compiler optimization for jump opcodes (#​545)
  • Added compiler optimization for boolean operations with all, any, one, none functions (#​555)

Expr Editor

The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.

Expr Pro

Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.

v1.16.0

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

expr repl demo

In this release:
  • Improved VM speed by 5%-15% (#​521)
  • Improve AST printing for boolean operators
  • Improved type checker (#​527)
  • Added option to override built-ins (#​522)
  • Added method to get AST tree from program: .Node() (#​528)
  • Added new Valuer patcher (#​525)
  • Added expr.WarnOnAny() option
  • Changed expr.As*() options behavior to accept any by default
  • Fixed type checker to visit all arguments of func even if arguments count mismatch
  • Fixed type propagation in AST for any type in type checker
  • Fixed context patcher (#​526)
  • Fixed race condition in working with variables (#​523)
  • Fixed pipeline and call parsing
Addition

In addition to open-source version of Expr, we have an embeddable Expr Editor and Expr Pro packages.

v1.15.8

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

output, err := expr.Eval(`now() - created_at < duration("24h")`, env)

In this release

  • Added builtin functions for bit operations. (#​496)
  • Added support for raw string literals. (#​485) raw string
  • Fixed type checker panic on embedded pointer to struct field. (#​500)
  • Removed redundant fields from ast nodes. (#​504) (#​503)
  • Improved Language Definition documentation.
Expr Editor

The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.

v1.15.7

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

In this release:
  • Fixed commutative property for comparison between a value and a pointer. (#​490)
  • Checker: forbid accessing built-ins and custom functions from $env. (#​495)
  • Enhanced the number parser to include support for parsing hexadecimal, binary, and octal literals. (#​483)
  • Added GetSource() method to vm.Program. (#​491)

v1.15.6

Compare Source

  • New module path expr-lang/epxr
  • Added expr.WithContext() option to pass context to custom functions.
  • Added ast package comments.
  • Hidden internal fields in vm.Program.

v1.15.5

Compare Source

  • Added ceil(), floor() and round() function.
  • Fixed type checker for float arguments.

v1.15.4

Compare Source

  • Improved type checking for $env
  • Added support for floats in sort() built-in
  • Fixed: AST printing for ?? operator
  • Fixed: only emit OpEqual{Int,String} for simple types
  • Fixed: fetch without OpDeref (#​467)
  • Docs: categorize Language Definition functions (#​452)
  • Changed: ast.Node type now is not copied with ast.Patch

v1.15.3

Compare Source

  • Added type checks to detect 42 in ["a"] as invalid.

v1.15.2

Compare Source

  • Propagate uint32 func argument types in AST (#​438)

v1.15.1

Compare Source

  • Fixed type checker for the in operator.
  • Fixed memory budget calculations for ranges.

v1.15.0

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

expr repl demo

In this release:
  • Added support for variables.
    let foo = filter(tweets, .Text contains "foo");
    let name = foo?.Author?.Name ?? "unknown";
    upper(name)
  • Added configuration to enable/disable builtin functions.
  • Added a bunch of optimizations for builtin function combinations:
    • len(filter()) and map(filter())
    • filter()[0] and filter()[-1]
  • Added a bunch of new builtin functions:
    • sort, sortBy
    • groupBy
    • toPairs, fromPairs
    • take, reduce, mean, median.
  • Fixed in-range optimization to be only applied to integers.
  • Fixed float folding optimization.
  • Fixed duration*integer mutliplications.
  • Improved language and developer documentation.
Examples:
tweets | filter(.Size < 280) | map(.Content) | join(" -- ")
filter(posts, {
    let span = now() - .CreatedAt;
    let limit = 7 * duration("24h");
    span >= limit
})

v1.14.3

Compare Source

  • Fixed builtin type checks for any

v1.14.2

Compare Source

  • Fixed slice node String() with omitted from or to fields.

v1.14.1

Compare Source

  • Added ast.String() to nodes.
  • Added keys(), values() and type() builtins.
  • Added the ability to disable builtins via expr.DisableBuiltin().
  • Fixed bunch of errors with corner cases in type checkers.

v1.14.0

Compare Source

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

expr repl demo

In this release:

  • New builtin functions:

    • abs, int, float, string, max, min
    • trim, trimPrefix, trimSuffix
    • upper, lower
    • split, splitN, splitAfter, splitAfterN
    • replace, repeat, join, indexOf, lastIndexOf
    • hasPrefix, hasSuffix
    • toJSON, fromJSON, toBase64, fromBase64
    • now, duration, date
    • first, last, get
  • New pipe | operator.

    1..9 | filter(# < 5) | map(# * 2)

    To enable the pipe operator add expr.ExperimentalPipes() option.

    program, err = expr.Compile(code, expr.ExperimentalPipes())
  • New repl with interactive debugger.

v1.13.0

Compare Source

Expr is a Go package that offers a fast, simple, and safe engine for compiling and evaluating expressions. Ideal for implementing complex logic in configuration, it serves as a foundation for a dynamic business rule engine without the need for recompiling the program.

all(Tweets, .Len <= 240)

v1.12.7

Compare Source

Expr is a Go package that offers a fast, simple, and safe engine for compiling and evaluating expressions. Ideal for implementing complex logic in configuration, it serves as a foundation for a dynamic business rule engine without the need for recompiling the program.

  • Added new opcode OpInvalid for debugging purposes.

v1.12.6

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/antonmedv/expr/compare/v1.12.5...v1.12.6


  • If you want to rebase/retry this MR, check this box

 

Merge request reports

Loading