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

Method FindGlobalIdent

checker/scopes.go:96–108  ·  view source on GitHub ↗

FindGlobalIdent finds an identifier in the global scope, ignoring all local scopes.

(name string)

Source from the content-addressed store, hash-verified

94
95// FindGlobalIdent finds an identifier in the global scope, ignoring all local scopes.
96func (s *Scopes) FindGlobalIdent(name string) *decls.VariableDecl {
97 scope := s
98 for scope.parent != nil {
99 scope = scope.parent
100 }
101 if ident := scope.FindIdentInScope(name); ident != nil {
102 return ident
103 }
104 if scope.inherited != nil {
105 return scope.inherited.FindGlobalIdent(name)
106 }
107 return nil
108}
109
110// SetFunction adds the function Decl to the current scope.
111// Note: Any previous entry for a function in the current scope with the same name is overwritten.

Callers 1

lookupGlobalIdentMethod · 0.80

Calls 1

FindIdentInScopeMethod · 0.80

Tested by

no test coverage detected