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)
| 74 | // nil if one does not exist. |
| 75 | // Note: The search is only performed on the current scope and does not search outer scopes. |
| 76 | func (s *Scopes) FindIdentInScope(name string) *decls.VariableDecl { |
| 77 | name = strings.TrimPrefix(name, ".") |
| 78 | if ident, found := s.scopes.idents[name]; found { |
| 79 | return ident |
| 80 | } |
| 81 | return nil |
| 82 | } |
| 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 { |
no outgoing calls
no test coverage detected