fixes a bug for 'dup' and 'with'; they can now handle nested statement lists that can result from macros
This commit is contained in:
parent
35d14095ed
commit
b737bb4be0
3 changed files with 22 additions and 25 deletions
|
|
@ -35,14 +35,7 @@ macro with*(arg: typed; calls: varargs[untyped]): untyped =
|
|||
doAssert a == 43
|
||||
|
||||
result = newNimNode(nnkStmtList, arg)
|
||||
expectKind calls, nnkArgList
|
||||
let body =
|
||||
if calls.len == 1 and calls[0].kind in {nnkStmtList, nnkStmtListExpr}:
|
||||
calls[0]
|
||||
else:
|
||||
calls
|
||||
for call in body:
|
||||
result.add underscoredCall(call, arg)
|
||||
underscoredCalls(result, calls, arg)
|
||||
|
||||
when isMainModule:
|
||||
type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue