'let' within 'parallel' now works

This commit is contained in:
Araq 2014-09-22 08:34:05 +02:00
commit 8930ba50b9
4 changed files with 21 additions and 6 deletions

View file

@ -335,7 +335,7 @@ proc analyse(c: var AnalysisCtx; n: PNode) =
localError(n.info, "invalid control flow for 'parallel'")
# 'break' that leaves the 'parallel' section is not valid either
# or maybe we should generate a 'try' XXX
of nkVarSection:
of nkVarSection, nkLetSection:
for it in n:
let value = it.lastSon
if value.kind != nkEmpty:
@ -396,7 +396,7 @@ proc transformSpawnSons(owner: PSym; n, barrier: PNode): PNode =
proc transformSpawn(owner: PSym; n, barrier: PNode): PNode =
case n.kind
of nkVarSection:
of nkVarSection, nkLetSection:
result = nil
for it in n:
let b = it.lastSon

View file

@ -599,7 +599,7 @@ proc track(tracked: PEffects, n: PNode) =
addAsgnFact(tracked.guards, n.sons[0], n.sons[1])
notNilCheck(tracked, n.sons[1], n.sons[0].typ)
when false: cstringCheck(tracked, n)
of nkVarSection:
of nkVarSection, nkLetSection:
for child in n:
let last = lastSon(child)
if child.kind == nkIdentDefs and last.kind != nkEmpty: