-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get rendered expressions #80
Comments
Or if can get the names and locations of all parameters.it's fine too. |
I don't think it can be supported appropriately by current implement. If #78 can be implemented, you can use this feature to achieve what you want. |
@skyf0cker yeah sry. gval is a spare time project for me as well. Feel free to make a pull request. @StrangeYear you can override the calculation itself: var lang = gval.Full(
gval.InfixNumberOperator("+", func(a, b float64) (interface{}, error) {
fmt.Printf("%d + %d\n", a, b) // or collect it in a more appropiate way
return a + b, nil
}),
gval.InfixNumberOperator(">", func(a, b float64) (interface{}, error) {
fmt.Printf("%d > %d\n", a, b)
return a > b, nil
}), but you would have to override every operator for this approach. I don't now wether this helps you or not. |
I Have a similar idea going on in my head at the moment. Ideally I would like to identify where the expression was "triggered" say I have A workaround is to split out the logic and analyze each expression separately. @generikvault I assume your suggestion here about the language override would be the simplest approach to achieve something like what I am looking for? |
Example:
expression:
a + b > 6
args: {"a":3,"b":4}
result: 3 + 4 > 6
Because i need to show the user the calculation process of the expression rather than the direct result.
Thanks.
The text was updated successfully, but these errors were encountered: