-
-
Notifications
You must be signed in to change notification settings - Fork 463
-
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.Findhelper for easy AST searching. 579de74 - Added compile node budget and memory limits (feat: add node budget and memory limits #762 )
- Added
uniq()builtin (Add uniq() function #705 ) - Added
flatten()builtin (add flatten function #684 ) - Added types pkg (Introduce Nature concept #665 Refactor types table #667 Improve types pkg #668 )
Improvements:
- Allow tailing comma in arguments (Allow tailing comma in arguments #623 )
- Improved type checker for named types 6fa83ad
- Now
len()return runes count for string e8bd7f8 - Improved VM code coverage (now 98%!) (test: add comprehensive VM opcode tests #750 )
- Improved support for auto-dereferences and pointer usage 2bc0eed f4bbea5 80f0ea6 4511e92 29dff34
Fixes:
- Make sure get() returns nil for map[string]string on missing keys 435b79d
- Fix func calls with nil types value d63c3b5
- Do not optimize
filter() | map()if#indexis used 35bdb68 - Fixed AST printing of ops with precedence (Fix print with precedence #678 )
- Separated patching phases for patchers that require multiple passes. (Separate patching phases for patchers that require multiple passes. #659 )
This discussion was created from the release v1.17.0.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
@antonmedv, thanks to you and all the team taking care of Expr for your outstanding job !
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 1