public object VisitFunctionStmt(Stmt.Function stmt) { Declare(stmt.Name); Define(stmt.Name); ResolveFunction(stmt, FunctionType.FUNCTION); return(null); }
private void ResolveFunction(Stmt.Function function, FunctionType type) { var enclosingFunction = currentFunction; currentFunction = type; BeginScope(); foreach (var param in function.Params) { Declare(param); Define(param); } Resolve(function.Body); EndScope(); currentFunction = enclosingFunction; }