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

Method FindIdentInScope

checker/scopes.go:94–100  ·  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

92// nil if one does not exist.
93// Note: The search is only performed on the current scope and does not search outer scopes.
94func (s *Scopes) FindIdentInScope(name string) *decls.VariableDecl {
95 name = strings.TrimPrefix(name, ".")
96 if ident, found := s.scopes.idents[name]; found {
97 return ident
98 }
99 return nil
100}
101
102// FindLocalIdent finds a locally scoped variable with a given name, ignoring the root scope.
103func (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