* fix #14846; add macros.extractDocCommentsAndRunnables * fixup * update tests * address comment
This commit is contained in:
parent
05384efec5
commit
2867a33ebc
7 changed files with 98 additions and 3 deletions
|
|
@ -180,8 +180,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
|
|||
# Extract the documentation comment from the original procedure declaration.
|
||||
# Note that we're not removing it from the body in order not to make this
|
||||
# transformation even more complex.
|
||||
if prc.body.len > 1 and prc.body[0].kind == nnkCommentStmt:
|
||||
outerProcBody.add(prc.body[0])
|
||||
let body2 = extractDocCommentsAndRunnables(prc.body)
|
||||
|
||||
# -> var retFuture = newFuture[T]()
|
||||
var retFutureSym = genSym(nskVar, "retFuture")
|
||||
|
|
@ -276,9 +275,10 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
|
|||
(cast[type(f)](internalTmpFuture)).read()
|
||||
|
||||
if procBody.kind != nnkEmpty:
|
||||
result.body = quote:
|
||||
body2.add quote do:
|
||||
`awaitDefinition`
|
||||
`outerProcBody`
|
||||
result.body = body2
|
||||
|
||||
#echo(treeRepr(result))
|
||||
#if prcName == "recvLineInto":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue