MCPcopy Create free account
hub / github.com/cel-expr/cel-go / FindFunction

Method FindFunction

checker/scopes.go:131–140  ·  view source on GitHub ↗

FindFunction finds the first function Decl with a matching name in Scopes. The search is performed from innermost to outermost. Returns nil if no such function in Scopes.

(name string)

Source from the content-addressed store, hash-verified

129// The search is performed from innermost to outermost.
130// Returns nil if no such function in Scopes.
131func (s *Scopes) FindFunction(name string) *decls.FunctionDecl {
132 name = strings.TrimPrefix(name, ".")
133 if fn, found := s.scopes.functions[name]; found {
134 return fn
135 }
136 if s.parent != nil {
137 return s.parent.FindFunction(name)
138 }
139 return nil
140}
141
142// Group is a set of Decls that is pushed on or popped off a Scopes as a unit.
143// Contains separate namespaces for identifier and function Decls.

Callers 2

lookupFunctionMethod · 0.80
setFunctionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected