Show lineinfo of for in yield (#9779)

This commit is contained in:
Alexander Ivanov
2018-12-13 11:38:32 +02:00
committed by Andreas Rumpf
parent a3c4791e9c
commit 467f53512f

View File

@@ -368,6 +368,11 @@ proc transformYield(c: PTransf, n: PNode): PTransNode =
else:
# we need to introduce new local variables:
add(result, introduceNewLocalVars(c, c.transCon.forLoopBody.PNode))
if result.len > 0:
var changeNode = PNode(result[0])
changeNode.info = c.transCon.forStmt.info
for i, child in changeNode:
child.info = changeNode.info
proc transformAddrDeref(c: PTransf, n: PNode, a, b: TNodeKind): PTransNode =
result = transformSons(c, n)