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)
| 92 | // nil if one does not exist. |
| 93 | // Note: The search is only performed on the current scope and does not search outer scopes. |
| 94 | func (s *Scopes) FindIdentInScope(name string) *decls.VariableDecl { |
| 95 | name = strings.TrimPrefix(name, ".") |
| 96 | if ident, found := s.scopes.idents[name]; found { |
| 97 | return ident |
| 98 | } |
| 99 | return nil |
| 100 | } |
| 101 | |
| 102 | // FindLocalIdent finds a locally scoped variable with a given name, ignoring the root scope. |
| 103 | func (s *Scopes) FindLocalIdent(name string) *decls.VariableDecl { |
no outgoing calls
no test coverage detected