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

Method FindLocalIdent

checker/scopes.go:85–93  ·  view source on GitHub ↗

FindLocalIdent finds a locally scoped variable with a given name, ignoring the root scope.

(name string)

Source from the content-addressed store, hash-verified

83
84// FindLocalIdent finds a locally scoped variable with a given name, ignoring the root scope.
85func (s *Scopes) FindLocalIdent(name string) *decls.VariableDecl {
86 if s == nil || s.parent == nil {
87 return nil
88 }
89 if ident := s.FindIdentInScope(name); ident != nil {
90 return ident
91 }
92 return s.parent.FindLocalIdent(name)
93}
94
95// FindGlobalIdent finds an identifier in the global scope, ignoring all local scopes.
96func (s *Scopes) FindGlobalIdent(name string) *decls.VariableDecl {

Callers 1

lookupLocalIdentMethod · 0.80

Calls 1

FindIdentInScopeMethod · 0.95

Tested by

no test coverage detected