internal void RenderCode(CodeRender cr) { cr.StartTopLevel(); var i = 0; mf.ForAllFuncs(f => { cr.Push(null); cr.Push(f); f.RenderCode(cr, null, null); cr.Pop(f); CreateArgListGui(f.args, cr, "(", ")"); if (f.freevars.Count > 0) { cr.Scale(0.7, () => CreateArgListGui(f.freevars, cr, "[", "]")); } cr.Pop(null); cr.SaveFunctionLHS(); cr.Push(null); cr.Text("=", equalsspacing, equalsspacing); f.root.RenderCode(cr, null); cr.Pop(null); cr.Function(i++, f.Depth()); }); }
void CreateArgListGui(List <PlaceHolder> l, CodeRender cr, string left, string right) { cr.Text(left, 0, bracketspacing); foreach (var arg in l) { cr.Push(arg); arg.RenderCode(cr, null, null); cr.Pop(arg); if (arg != l[l.Count - 1]) { cr.Text(",", 0, commaspacing); } } cr.Text(right, bracketspacing, 0); }
internal void RenderCode(CodeRender cr, Node nparent) { cr.Push(this); t.RenderCode(cr, this, nparent); cr.Pop(this); }