lift parameter-less do block to lambdas
This commit is contained in:
parent
f7b10e213b
commit
a3f19c87fb
10 changed files with 46 additions and 26 deletions
|
|
@ -90,11 +90,7 @@ proc evalTemplateArgs(n: PNode, s: PSym; fromHlo: bool): PNode =
|
|||
|
||||
result = newNodeI(nkArgList, n.info)
|
||||
for i in 1 .. givenRegularParams:
|
||||
let p = n[i]
|
||||
if p != nil and p.kind == nkDo and s.typ.sons[i].kind in {tyStmt, tyExpr}:
|
||||
result.addSon p[bodyPos]
|
||||
else:
|
||||
result.addSon p
|
||||
result.addSon n[i]
|
||||
|
||||
# handle parameters with default values, which were
|
||||
# not supplied by the user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue