expr
expr copied to clipboard
Expression language and expression evaluation for Go
Hi - thanks for an awesome library 0 && geo.long < 0`. Since we can't declare variables like that I was thinking something like an `apply` builtin that invokes a...
Given bytecode: ``` 0 OpTrue 1 OpJumpIfTrue 2 (6) 4 OpPop 5 OpTrue 6 OpJumpIfTrue 2 (11) 9 OpPop 10 OpTrue 11 OpJumpIfTrue 2 (16) 14 OpPop 15 OpTrue ```...
---------------code -------------------------- exprStr := "join([]string{'foo','bar'})" m := make[string]interface{} m['join'] = func(input []string) { // do something } program, err := expr.Compile(exprStr, expr.Env(m)) if err != nil { return } res,...
Today the `fetcher.Fetch` is ignored for function calls, making it impossible to create functions at runtime. This PR adds this feature, allowing the build below to take place. ```golang type...
This PR allows renaming struct fields by adding struct tags. For example, the expession `lowercaseField + OtherField` can be checked and evaluated with the following struct as env: ```go type...
Is there currently a way to combine arrays? Something like this: concat(["value1", "value2"], ["value3", "value4"]) or ["value1", "value2"] + ["value3", "value4"] Result: ["value1", "value2", "value3", "value4"]
Any plans to add the option to convert to a different timezone. I think currently you can only specify a timezone for the input as part of the [date()](https://expr-lang.org/docs/language-definition#datestr-format-timezone) function....
This pull request adds support for duration literal: ```expr -1h == -1 * 1h +1h == 1h 2 * 1h == 2h 1h + 1m == 1h1m 1h - 1m...
OSS-Fuzz has found a bug in this project. Please see https://oss-fuzz.com/testcase?key=4870644059471872 for details and reproducers. This issue is mirrored from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65006 and will auto-close if the status changes there. If...
Now expr inherits types from "example" env. I may be cool to have a API to define types explicitly.