private static void WriteDoWhileStatement(BoundDoWhileStatement node, IndentedTextWriter writer)
        {
            writer.WriteKeyword(SyntaxKind.DoKeyword);
            writer.WriteLine();
            writer.WriteNestedStatement(node.Body);

            writer.WriteKeyword(SyntaxKind.WhileKeyword);
            writer.WriteSpace();
            node.Condition.WriteTo(writer);
            writer.WriteLine();
        }
示例#2
0
        protected virtual BoundStatement RewriteDoWhileStatement(BoundDoWhileStatement node)
        {
            var body      = RewriteStatement(node.Body);
            var condition = RewriteExpression(node.Condition);

            if (body == node.Body && condition == node.Condition)
            {
                return(node);
            }

            return(new BoundDoWhileStatement(body, condition, node.BreakLabel, node.ContinueLabel));
        }