use single backtick (#17115)
This commit is contained in:
parent
1efaef52a2
commit
a1a18cfe66
10 changed files with 174 additions and 174 deletions
|
|
@ -146,7 +146,7 @@ template await*[T](f: Future[T]): auto {.used.} =
|
|||
|
||||
proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
|
||||
## This macro transforms a single procedure into a closure iterator.
|
||||
## The ``async`` macro supports a stmtList holding multiple async procedures.
|
||||
## The `async` macro supports a stmtList holding multiple async procedures.
|
||||
if prc.kind == nnkProcTy:
|
||||
result = prc
|
||||
if prc[0][0].kind == nnkEmpty:
|
||||
|
|
@ -320,8 +320,8 @@ proc stripReturnType(returnType: NimNode): NimNode =
|
|||
proc splitProc(prc: NimNode): (NimNode, NimNode) =
|
||||
## Takes a procedure definition which takes a generic union of arguments,
|
||||
## for example: proc (socket: Socket | AsyncSocket).
|
||||
## It transforms them so that ``proc (socket: Socket)`` and
|
||||
## ``proc (socket: AsyncSocket)`` are returned.
|
||||
## It transforms them so that `proc (socket: Socket)` and
|
||||
## `proc (socket: AsyncSocket)` are returned.
|
||||
|
||||
result[0] = prc.copyNimTree()
|
||||
# Retrieve the `T` inside `Future[T]`.
|
||||
|
|
@ -349,8 +349,8 @@ macro multisync*(prc: untyped): untyped =
|
|||
## Macro which processes async procedures into both asynchronous and
|
||||
## synchronous procedures.
|
||||
##
|
||||
## The generated async procedures use the ``async`` macro, whereas the
|
||||
## generated synchronous procedures simply strip off the ``await`` calls.
|
||||
## The generated async procedures use the `async` macro, whereas the
|
||||
## generated synchronous procedures simply strip off the `await` calls.
|
||||
let (sync, asyncPrc) = splitProc(prc)
|
||||
result = newStmtList()
|
||||
result.add(asyncSingleProc(asyncPrc))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue