gval
gval copied to clipboard
Expression evaluation in golang
Our app allows end users (not developers) to write mathematical expressions. We would like to present errors in a way that the users will understand. Unfortunately, the parser errors are...
Currently when defining language there is no way to override how float/string/bool are handled and to override behavior for example to be more strict for operations not to allow autocasting...
The test that is failing is occurring even in master so it is nothing to do with my changes. resolve https://github.com/PaesslerAG/gval/issues/49
In the following code: ```go result, err := gval.Evaluate("undefined_value == 10", map[string]interface{}{ "whatever_var": "whatever_value", }) fmt.Println(result, err) ``` I expect an error to be printed, instead it is printing: `false,...
According to the readme, you can define an array in gval: ``` Json Arrays : [1, 2, "foo"] ``` And you can look up an element from an array: ```...
I ran [govanish](https://github.com/sivukhin/govanish) linter (it still in the WIP phase) against `gval` repo and it found that one error handling branch were eliminated by compiler: ``` 2023/12/24 21:05:32 it seems...
```json { "properties": { "$id": 1 } } ``` ```go func Test2(t *testing.T) { parameters := make(map[string]interface{}) jsonStr := `{"properties": {"$id": "123"}}` err := json.Unmarshal([]byte(jsonStr), ¶meters) assert.Nil(t, err) expr, err...
Hello, if the expression contains a line feed character instead of the string representation parsing of expression fails. I don't know if this is intentional to only allow single line...
As indicated in https://github.com/PaesslerAG/jsonpath/issues/38, Gval has trouble evaluating some JSONPath expressions since its syntax in that point conflicts with Go syntax: Strings in Go are portrayed by double-quotes "..." and...
Solves https://github.com/PaesslerAG/gval/issues/97. Creates a new Scanner if an option was set which is able to parse single-quoted strings as strings. The default behavior if this option was not used is...