Ejemplo n.º 1
0
        ForEachExpression ILexicalScope <ForEachExpression, Action <MemberExpression, LoopContext> > .Build(Action <MemberExpression, LoopContext> scope)
        {
            var result = new ForEachExpression(collection, cancellationToken, configureAwait, ContinueLabel, BreakLabel);

            using (var context = new LoopContext(result))
                scope(result.Element, context);
            result.Body = Build();
            return(result);
        }
Ejemplo n.º 2
0
        WhileExpression ILexicalScope <WhileExpression, Action <LoopContext> > .Build(Action <LoopContext> scope)
        {
            var result = new WhileExpression(condition, ContinueLabel, BreakLabel, conditionFirst);

            using (var context = new LoopContext(result))
                scope(context);
            result.Body = Build();
            return(result);
        }
Ejemplo n.º 3
0
        ForExpression ILexicalScope <ForExpression, Action <ParameterExpression, LoopContext> > .Build(Action <ParameterExpression, LoopContext> scope)
        {
            var result = new ForExpression(initialization, ContinueLabel, BreakLabel, condition);

            using (var context = new LoopContext(result))
                scope(result.LoopVar, context);
            AddStatement(Expression.Label(result.ContinueLabel));
            iteration(result.LoopVar);
            result.Body = Build();
            return(result);
        }
Ejemplo n.º 4
0
 LoopExpression ILexicalScope <LoopExpression, Action <LoopContext> > .Build(Action <LoopContext> scope)
 {
     using (var context = new LoopContext(this))
         scope(context);
     return(Expression.Loop(Build(), BreakLabel, ContinueLabel));
 }