private static void WriteForStatement(BoundForStatement node, IndentedTextWriter writer) { writer.WriteKeyword(SyntaxKind.ForKeyword); writer.WriteSpace(); node.Initializer.WriteTo(writer); node.Condition.WriteTo(writer); node.Loop.WriteTo(writer); writer.WriteLine(); writer.WriteNestedStatement(node.Body); }
protected virtual BoundStatement RewriteForStatement(BoundForStatement node) { var initializer = RewriteExpression(node.Initializer); var condition = RewriteExpression(node.Condition); var loop = RewriteExpression(node.Loop); var body = RewriteStatement(node.Body); if (initializer == node.Initializer && condition == node.Condition && loop == node.Loop && body == node.Body) { return(node); } return(new BoundForStatement(initializer, condition, loop, body, node.BreakLabel, node.ContinueLabel)); }