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)
| 117 | // The search is performed from innermost to outermost. |
| 118 | // Returns nil if no such function in Scopes. |
| 119 | func (s *Scopes) FindFunction(name string) *decls.FunctionDecl { |
| 120 | name = strings.TrimPrefix(name, ".") |
| 121 | if fn, found := s.scopes.functions[name]; found { |
| 122 | return fn |
| 123 | } |
| 124 | if s.parent != nil { |
| 125 | if fn := s.parent.FindFunction(name); fn != nil { |
| 126 | return fn |
| 127 | } |
| 128 | } |
| 129 | if s.inherited != nil { |
| 130 | if fn := s.inherited.FindFunction(name); fn != nil { |
| 131 | return fn |
| 132 | } |
| 133 | } |
| 134 | return nil |
| 135 | } |
| 136 | |
| 137 | // Group is a set of Decls that is pushed on or popped off a Scopes as a unit. |
| 138 | // Contains separate namespaces for identifier and function Decls. |
no outgoing calls
no test coverage detected