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

Method FindIdentInScope

checker/scopes.go:76–82  ·  view source on GitHub ↗

FindIdentInScope finds the first ident Decl with a matching name in the current Scopes value, or nil if one does not exist. Note: The search is only performed on the current scope and does not search outer scopes.

(name string)

Source from the content-addressed store, hash-verified

74// nil if one does not exist.
75// Note: The search is only performed on the current scope and does not search outer scopes.
76func (s *Scopes) FindIdentInScope(name string) *decls.VariableDecl {
77 name = strings.TrimPrefix(name, ".")
78 if ident, found := s.scopes.idents[name]; found {
79 return ident
80 }
81 return nil
82}
83
84// FindLocalIdent finds a locally scoped variable with a given name, ignoring the root scope.
85func (s *Scopes) FindLocalIdent(name string) *decls.VariableDecl {

Callers 3

FindLocalIdentMethod · 0.95
addIdentMethod · 0.80
FindGlobalIdentMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected