SetFunction adds the function Decl to the current scope. Note: Any previous entry for a function in the current scope with the same name is overwritten.
(fn *decls.FunctionDecl)
| 122 | // SetFunction adds the function Decl to the current scope. |
| 123 | // Note: Any previous entry for a function in the current scope with the same name is overwritten. |
| 124 | func (s *Scopes) SetFunction(fn *decls.FunctionDecl) { |
| 125 | s.scopes.functions[fn.Name()] = fn |
| 126 | } |
| 127 | |
| 128 | // FindFunction finds the first function Decl with a matching name in Scopes. |
| 129 | // The search is performed from innermost to outermost. |