public static Expression AnalyzeLoopExpr(SymplLoopExpr expr, AnalysisScope scope) { var loopscope = new AnalysisScope(scope, "loop "); loopscope.IsLoop = true; // needed for break and continue loopscope.LoopBreak = Expression.Label(typeof(object), "loop break"); int len = expr.Body.Length; var body = new Expression[len]; for (int i = 0; i < len; i++) { body[i] = AnalyzeExpr(expr.Body[i], loopscope); } return(Expression.Loop(Expression.Block(typeof(object), body), loopscope.LoopBreak)); }
public static Expression AnalyzeLoopExpr (SymplLoopExpr expr, AnalysisScope scope) { var loopscope = new AnalysisScope(scope, "loop "); loopscope.IsLoop = true; // needed for break and continue loopscope.LoopBreak = Expression.Label(typeof(object), "loop break"); int len = expr.Body.Length; var body = new Expression[len]; for (int i = 0; i < len; i++) { body[i] = AnalyzeExpr(expr.Body[i], loopscope); } return Expression.Loop(Expression.Block(typeof(object), body), loopscope.LoopBreak); }