From 04ea132d27de7cfd2d61ad674ee1d4873e500b88 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 5 Jun 2012 05:07:55 -0700 Subject: [PATCH] Preserve declaration initialisers replacing for-each. --- Replace.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Replace.cpp b/Replace.cpp index d508db0..5be4e01 100644 --- a/Replace.cpp +++ b/Replace.cpp @@ -357,6 +357,12 @@ CYStatement *CYForInComprehension::Replace(CYContext &context, CYStatement *stat } CYStatement *CYForEachIn::Replace(CYContext &context) { + if (CYAssignment *assignment = initialiser_->Assignment(context)) + return $ CYBlock($$->* + $E(assignment)->* + this + ); + CYIdentifier *cys($I("$cys")), *cyt($I("$cyt")); return $ CYLet($L2($L(cys, set_), $L(cyt)), $$->* -- 2.45.2