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); }
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); }
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); }
LoopExpression ILexicalScope <LoopExpression, Action <LoopContext> > .Build(Action <LoopContext> scope) { using (var context = new LoopContext(this)) scope(context); return(Expression.Loop(Build(), BreakLabel, ContinueLabel)); }