Minor fixes for asyncjs (#8894)

* Minor fixes for asyncjs

Mark internal procedures as used
Allow .async. for more node kinds
Make .async. work for nkStmtList

* Fix logic error in both the async macros
This commit is contained in:
LemonBoy 2018-09-07 16:42:38 +02:00 • committed by Andreas Rumpf
commit 90025e242d
2 changed files with 13 additions and 5 deletions

View file

@ -327,8 +327,8 @@ macro async*(prc: untyped): untyped =
## Macro which processes async procedures into the appropriate
## iterators and yield statements.
if prc.kind == nnkStmtList:
result = newStmtList()
for oneProc in prc:
result = newStmtList()
result.add asyncSingleProc(oneProc)
else:
result = asyncSingleProc(prc)