FindGlobalIdent finds an identifier in the global scope, ignoring all local scopes.
(name string)
| 112 | |
| 113 | // FindGlobalIdent finds an identifier in the global scope, ignoring all local scopes. |
| 114 | func (s *Scopes) FindGlobalIdent(name string) *decls.VariableDecl { |
| 115 | scope := s |
| 116 | for scope.parent != nil { |
| 117 | scope = scope.parent |
| 118 | } |
| 119 | return scope.FindIdentInScope(name) |
| 120 | } |
| 121 | |
| 122 | // SetFunction adds the function Decl to the current scope. |
| 123 | // Note: Any previous entry for a function in the current scope with the same name is overwritten. |
no test coverage detected