Fixes #4170.
This commit is contained in:
parent
5bf16439e1
commit
75e5c87f15
4 changed files with 128 additions and 40 deletions
|
|
@ -144,11 +144,9 @@ proc processBody(node, retFutureSym: NimNode,
|
|||
of nnkCommand, nnkCall:
|
||||
if node[0].kind == nnkIdent and node[0].ident == !"await":
|
||||
case node[1].kind
|
||||
of nnkIdent, nnkInfix, nnkDotExpr:
|
||||
of nnkIdent, nnkInfix, nnkDotExpr, nnkCall, nnkCommand:
|
||||
# await x
|
||||
# await x or y
|
||||
result = newNimNode(nnkYieldStmt, node).add(node[1]) # -> yield x
|
||||
of nnkCall, nnkCommand:
|
||||
# await foo(p, x)
|
||||
# await foo p, x
|
||||
var futureValue: NimNode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue