diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-01-03 21:16:07 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-01-03 21:16:07 +0100 |
commit | 813f98fb342418606f82a082373636137b811bae (patch) | |
tree | c07c795e40e5667d763611a8067978d9ab6b15ff /compiler/transf.nim | |
parent | 1ad69be98863aa6f73ec205dee8c0a344a337adb (diff) | |
download | Nim-813f98fb342418606f82a082373636137b811bae.tar.gz |
further progress on closure iterators; tforum still failing
Diffstat (limited to 'compiler/transf.nim')
-rw-r--r-- | compiler/transf.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim index 9ba52bb2d..c1677b23b 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -500,7 +500,9 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = if call.kind notin nkCallKinds or call.sons[0].kind != nkSym or call.sons[0].typ.callConv == ccClosure: n.sons[length-1] = transformLoopBody(c, n.sons[length-1]).PNode - result[1] = lambdalifting.liftForLoop(n, getCurrOwner(c)).PTransNode + if not c.tooEarly: + n.sons[length-2] = transform(c, n.sons[length-2]).PNode + result[1] = lambdalifting.liftForLoop(n, getCurrOwner(c)).PTransNode discard c.breakSyms.pop return result |