FindLocalIdent finds a locally scoped variable with a given name, ignoring the root scope.
(name string)
| 83 | |
| 84 | // FindLocalIdent finds a locally scoped variable with a given name, ignoring the root scope. |
| 85 | func (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. |
| 96 | func (s *Scopes) FindGlobalIdent(name string) *decls.VariableDecl { |
no test coverage detected