-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
[feature request] allow pointer accessor outside predicate for parsing #733
Comments
So what would we the case for this? Pointer accessor ( |
@antonmedv |
I see. Predicates/closures dependent on corresponding compiler code. What would be results of your patching? |
@antonmedv type patcher struct {
fn map[string]reflect.Value
}
func (p *patcher) Visit(node *ast.Node) {
switch n := (*node).(type) {
case *ast.CallNode:
// if fn map contains callee, patch it if it arguments contains a callback (tree argument) and CallNode arguments contains a PredicateNode, ClosureNode
}
}
// also exists in the expr.Env(env),
func testfn(argument1 string, tree *parser.Tree) {
// now i can do everything i want with the Tree / or ast.Node
// compiler.Compile(tree, conf.CreateNew())
} |
Currently i can even parse it. It would be usefull to implement your own "scope" via "patching".
I would like to use a patcher to patchh somethin like this:
.Test
and patch it to (if not used in a "build in function"!)
https://expr-lang.org/docs/patch
but i get directly an error
cannot use pointer accessor outside closure
orcannot use pointer accessor outside predicate
without even a chance to access the ast tree.The text was updated successfully, but these errors were encountered: