further progress on closure iterators; tforum still failing

This commit is contained in:
Andreas Rumpf 2016-01-03 21:16:07 +01:00
commit 813f98fb34
3 changed files with 34 additions and 18 deletions

View file

@ -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