FindFunction finds the first function Decl with a matching name in Scopes. The search is performed from innermost to outermost. Returns nil if no such function in Scopes.
(name string)
| 129 | // The search is performed from innermost to outermost. |
| 130 | // Returns nil if no such function in Scopes. |
| 131 | func (s *Scopes) FindFunction(name string) *decls.FunctionDecl { |
| 132 | name = strings.TrimPrefix(name, ".") |
| 133 | if fn, found := s.scopes.functions[name]; found { |
| 134 | return fn |
| 135 | } |
| 136 | if s.parent != nil { |
| 137 | return s.parent.FindFunction(name) |
| 138 | } |
| 139 | return nil |
| 140 | } |
| 141 | |
| 142 | // Group is a set of Decls that is pushed on or popped off a Scopes as a unit. |
| 143 | // Contains separate namespaces for identifier and function Decls. |
no outgoing calls
no test coverage detected