示例#1
0
        protected override SyntaxNode VisitForEachStatement(ForEachStatementSyntax node)
        {
            var expr = RewritePostfixUnarys(node.Expression);

            node = node.Update(node.ForEachKeyword, node.OpenParenToken, node.Type,
                               node.Identifier, node.InKeyword, expr, node.CloseParenToken,
                               GetLoopBlock(node.Statement));

            this.loopLevel++;
            var statement = base.VisitForEachStatement((ForEachStatementSyntax)node.WithAdditionalAnnotations(this.isLoop));

            this.loopLevel--;
            return(statement);
        }
示例#2
0
        protected override SyntaxNode VisitForEachStatement(ForEachStatementSyntax node)
        {
            node = node.Update (node.ForEachKeyword, node.OpenParenToken, node.Type,
                                node.Identifier, node.InKeyword, node.Expression, node.CloseParenToken,
                                GetLoopBlock (node.Statement));

            this.loopLevel++;
            var statement = base.VisitForEachStatement ((ForEachStatementSyntax)node.WithAdditionalAnnotations (this.isLoop));
            this.loopLevel--;
            return statement;
        }