Пример #1
0
        // LoopStatement
        private Statement Rewrite(LoopStatement node)
        {
            Expression test  = RewriteExpressionFreeTemps(node.Test);
            Expression incr  = RewriteExpressionFreeTemps(node.Increment);
            Statement  body  = RewriteStatement(node.Body);
            Statement  @else = RewriteStatement(node.ElseStatement);

            if (((object)test != (object)node.Test) ||
                ((object)incr != (object)node.Increment) ||
                ((object)body != (object)node.Body) ||
                ((object)@else != (object)node.ElseStatement))
            {
                return(Ast.Loop(node.Span, node.Header, test, incr, body, @else));
            }
            else
            {
                return(node);
            }
        }