Skip to content

Commit 5bcda1b

Browse files
committed
cleanup
1 parent 8181e6a commit 5bcda1b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/pure/asyncmacro.nim

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ proc createFutureVarCompletions(futureVarIdents: seq[NimNode], fromNode: NimNode
6666
)
6767

6868
proc processBody(node, retFutureSym: NimNode, futureVarIdents: seq[NimNode]): NimNode =
69-
#echo(node.treeRepr)
7069
result = node
7170
case node.kind
7271
of nnkReturnStmt:
@@ -208,12 +207,12 @@ proc asyncSingleProc(prc: NimNode): NimNode =
208207
procBody.add(createFutureVarCompletions(futureVarIdents, nil))
209208
let resultIdent = ident"result"
210209
procBody.insert(0): quote do:
210+
{.push warning[resultshadowed]: off.}
211211
when `subRetType` isnot void:
212-
{.push warning[resultshadowed]: off.}
213212
var `resultIdent`: `baseType`
214-
{.pop.}
215213
else:
216214
var `resultIdent`: Future[void]
215+
{.pop.}
217216
procBody.add quote do:
218217
complete(`retFutureSym`, `resultIdent`)
219218

@@ -320,9 +319,3 @@ macro multisync*(prc: untyped): untyped =
320319
result = newStmtList()
321320
result.add(asyncSingleProc(asyncPrc))
322321
result.add(sync)
323-
# echo result.repr
324-
325-
# overload for await as a fallback handler, based on the yglukhov's patch to chronos: https://github.com/status-im/nim-chronos/pull/47
326-
# template await*(f: typed): untyped =
327-
# static:
328-
# error "await only available within {.async.}"

0 commit comments

Comments
 (0)