Skip to content

Releases: expr-lang/expr

v1.17.5

03 Jun 15:32
eeb1b8b
Compare
Choose a tag to compare
  • Added expr.MaxNodes() option by #799

v1.17.4

27 May 10:14
ebf0d8b
Compare
Choose a tag to compare
  • Added check for non struct types to fetchField #794
  • Docs: do not repeat patcher definition in ExamplePatch() #792

v1.17.3

14 May 14:08
28d9b3d
Compare
Choose a tag to compare
  • Fixed get built-in to work with nil #786

v1.17.2

24 Mar 13:53
6121e25
Compare
Choose a tag to compare
  • Improved performance of expr.Eval #775

v1.17.1

18 Mar 09:50
e135bda
Compare
Choose a tag to compare
  • Fixed parsing of variable declaration nodes combined with sequence node in #773

v1.17.0

16 Mar 09:16
3be6386
Compare
Choose a tag to compare

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

program, err := expr.Compile(`let foo = bar(); baz(foo, foo)`)

In this release:

This release added the biggest change to the Expr language: if-else expressions and sequential expressions. #736 e750878

if foo > 42 {
    assert(foo);
    calc(foo, foo / 2)
} else {
    calc(0, 0)
}

A sequence of expression may be separated by ; char. The last semicolon must be omitted. Expr returns the value of the
last expression in the sequence.

If-else is also expressions. Each if must have an else part. Result of if-else can be used as an expression:

let foo = if bar > 0 {
    process(bar)
} else {
    fallback()
};
foo + 42

Added:

  • Added ast.Find helper for easy AST searching. 579de74
  • Added compile node budget and memory limits (#762)
  • Added uniq() builtin (#705)
  • Added flatten() builtin (#684)
  • Added types pkg (#665 #667 #668)

Improvements:

Fixes:

  • Make sure get() returns nil for map[string]string on missing keys 435b79d
  • Fixed func calls with nil types value d63c3b5
  • Fixed AST printing of ops with precedence (#678)
  • Do not optimize filter() | map() if #index is used 35bdb68
  • Separated patching phases for patchers that require multiple passes. (#659)

v1.16.9

27 May 10:27
55ff9aa
Compare
Choose a tag to compare

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

In this release:

  • Fixed function calls with int64 params. #663

v1.16.8

25 May 21:36
b45ee4f
Compare
Choose a tag to compare

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")`)

In this release:

  • Added checks for nil before string casts in VM (#654)
  • Added int overflow checks. 45c1ae7
  • Improved lexer (#653)
  • Improved error messages for index out of bounds errors. 6cf0edb
  • Fixed: invoke the Deref function as needed for the function arguments. (#651)
  • Fixed build on 386 arch. cae6003

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.7

08 May 20:28
1a5df77
Compare
Choose a tag to compare

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")`)

In this release:

  • Improved now() and date() type validation
  • Updated documentation

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.6

08 May 08:11
83d67e7
Compare
Choose a tag to compare

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")`)

In this release:

  • Added an option to set default timezone for date() and now() builtins with expr.Timezone("Europe/Zurich")
  • Added a new timezone("UTC") builtin
  • Fixed double-escaping of keys in map printing (#640)
  • Starting from this release, Expr has no dependencies go.mod (#618, #642)

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.