public override bool Render(RenderContext dest) { dest.Append("for("); if (VariableDeclaration != null) { VariableDeclaration.Render(dest); } else { Iterator.Render(dest); } dest.Append("in"); Collection.Render(dest); dest.Append(")"); return(Code.RenderIndented(dest)); }
public override bool Render(RenderContext dest) { dest.Append("for("); if (Initialize != null) { Initialize.Render(dest); } dest.Append(";"); if (Condition != null) { Condition.Render(dest); } dest.Append(";"); if (Increment != null) { Increment.Render(dest); } dest.Append(")"); return(Code.RenderIndented(dest)); }
public override bool Render(RenderContext dest) { // Statement dest.Append("try"); Code.Render(dest); // Catch clauses foreach (var cc in CatchClauses) { cc.Render(dest); } // Finally clause if (FinallyClause != null) { dest.Append("finally"); FinallyClause.RenderIndented(dest); } return(false); }
public override bool Render(RenderContext dest) { // Statement dest.Append("if("); Condition.Render(dest); dest.Append(")"); // True block bool retv; if (CheckForHangingElse()) { dest.StartLine(); dest.Append("{"); TrueStatement.RenderIndented(dest); dest.StartLine(); dest.Append("}"); retv = false; } else { retv = TrueStatement.RenderIndented(dest); } // False block if (FalseStatement != null) { if (retv) { dest.Append(';'); } dest.StartLine(); dest.Append("else"); retv = FalseStatement.RenderIndented(dest); } return(retv); }