public Function(Ast.Program program, Ast.Function function, HashSet <Type> typesDefined) { Program = program; AstFunction = function; TypesDefined = typesDefined; }
protected void Function(string name, LambdaExpression expr) { var block = Ast.Blk(); BeginScope(block); var args = FunctionArguments(expr.Parameters).ToArray(); _function = Ast.Fun(name, expr.ReturnType, args, block); FunctionBody(expr.Body); EndScope(); }
public static Ast.Function InstantiateAllMacros(Ast.Function function) { while (true) { var instantiated = (Ast.Function)function.Transform(node => node is Ast.MacroCall ? InstantiateMacro(node as Ast.MacroCall) : node); if (instantiated == function) { return(function); } function = instantiated; } }