// FuncDef public override bool Walk(FuncDef node) { if (node == scope) { foreach (Expr e in node.parameters) { e.Walk(fdef); } return(true); } else { Define(node.name); return(false); } }
public static SignatureInfo Get(FuncDef fd, CodeGen cg) { int first = 0; Type[] paramTypes; Name[] paramNames; Slot contextSlot = null; if (fd.IsClosure) { contextSlot = cg.EnvironmentSlot; } else { contextSlot = cg.ContextSlot; } if (contextSlot != null) { first = 1; // Skip the first argument paramTypes = new Type[fd.parameters.Length + 1]; paramNames = new Name[fd.parameters.Length + 1]; paramTypes[0] = contextSlot.Type; paramNames[0] = Name.Make("$env"); for (int i = 1; i < paramTypes.Length; i++) { paramTypes[i] = typeof(object); paramNames[i] = makeName(fd.parameters[i - 1]); } } else { paramTypes = CompilerHelpers.MakeRepeatedArray(typeof(object), fd.parameters.Length); paramNames = makeNames(fd.parameters); } return(new SignatureInfo(paramTypes, paramNames, first > 0, contextSlot)); }
public GenExpr(FuncDef func, CallExpr call) { this.func = func; this.call = call; }
public LambdaExpr(FuncDef func) { this.func = func; }
public override void PostWalk(FuncDef node) { Debug.Assert(current == node); current = current.parent; }
public virtual void PostWalk(FuncDef node) { }
// FuncDef public virtual bool Walk(FuncDef node) { return(false); }
// FuncDef public virtual bool Walk(FuncDef node) { return(true); }
public override bool Walk(FuncDef node) { // Do not recurse into nested functions return(node == func); }
private YieldLabelBuilder(FuncDef func, CodeGen cg) { this.func = func; this.cg = cg; this.topYields = new YieldTarget[func.yieldCount]; }