MCPcopy Create free account
hub / github.com/araddon/qlbridge / evalFieldChain

Method evalFieldChain

datasource/context_wrapper.go:90–97  ·  view source on GitHub ↗

evalFieldChain evaluates .X.Y.Z possibly followed by arguments. dot is the environment in which to evaluate arguments, while receiver is the value being walked along the chain.

(dot, receiver reflect.Value, node *expr.IdentityNode, ident []string, args []expr.Node, final reflect.Value)

Source from the content-addressed store, hash-verified

88// dot is the environment in which to evaluate arguments, while
89// receiver is the value being walked along the chain.
90func (s *state) evalFieldChain(dot, receiver reflect.Value, node *expr.IdentityNode, ident []string, args []expr.Node, final reflect.Value) reflect.Value {
91 n := len(ident)
92 for i := 0; i < n-1; i++ {
93 receiver = s.evalField(dot, ident[i], node, nil, zero, receiver)
94 }
95 // Now if it's a method, it gets the arguments.
96 return s.evalField(dot, ident[n-1], node, args, final, receiver)
97}
98
99// func (s *state) evalFunction(dot reflect.Value, node *expr.IdentityNode, cmd expr.Node, args []expr.Node, final reflect.Value) reflect.Value {
100// name := node.Text

Callers 1

GetMethod · 0.80

Calls 1

evalFieldMethod · 0.95

Tested by

no test coverage detected