Replies: 1 comment 1 reply
-
One way is to use parser directly:
But if operator overloads or patchers is needed - we can add some method, like expr.CompileWithTree or I can bring back
This is actually a very cool thing. Could you show some examples what you think of? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to access the *ast.Tree produced by running
expr.Compile
? I saw that recently the tree was removed from*vm.Program
so is not directly accessible. It seems like I could recreate the tree if I copy over the compilation step logic:https://github.com/expr-lang/expr/blob/master/expr.go#L176-L199
Reason is I have a need to compile sets of expressions and would like to walk the tree to attempt and detect expression collisions (ie one expression asserts that a value is true and another asserts that it's false).
Is it possible to access the tree, or is there another way I could possibly reliably do this level of collision detection?
Beta Was this translation helpful? Give feedback.
All reactions