Small change in how tuples are handled in async macro
A small change that brings no functional change beside a flatter tree.
This commit is contained in:
parent
56d2b08c5a
commit
d7ca7fd03e
1 changed files with 7 additions and 7 deletions
|
|
@ -154,13 +154,13 @@ proc processBody(node, retFutureSym: NimNode,
|
||||||
newCommand, node)
|
newCommand, node)
|
||||||
|
|
||||||
of nnkVarSection, nnkLetSection:
|
of nnkVarSection, nnkLetSection:
|
||||||
case node[0][2].kind
|
case node[0][^1].kind
|
||||||
of nnkCommand:
|
of nnkCommand:
|
||||||
if node[0][2][0].kind == nnkIdent and node[0][2][0].eqIdent("await"):
|
if node[0][^1][0].kind == nnkIdent and node[0][^1][0].eqIdent("await"):
|
||||||
# var x = await y
|
# var x = await y
|
||||||
var newVarSection = node # TODO: Should this use copyNimNode?
|
var newVarSection = node # TODO: Should this use copyNimNode?
|
||||||
result.createVar("future" & node[0][0].strVal, node[0][2][1],
|
result.createVar("future" & node[0][0].strVal, node[0][^1][1],
|
||||||
newVarSection[0][2], newVarSection, node)
|
newVarSection[0][^1], newVarSection, node)
|
||||||
else: discard
|
else: discard
|
||||||
of nnkAsgn:
|
of nnkAsgn:
|
||||||
case node[1].kind
|
case node[1].kind
|
||||||
|
|
@ -367,11 +367,11 @@ proc stripAwait(node: NimNode): NimNode =
|
||||||
# foo await x
|
# foo await x
|
||||||
node[1][0] = emptyNoopSym
|
node[1][0] = emptyNoopSym
|
||||||
of nnkVarSection, nnkLetSection:
|
of nnkVarSection, nnkLetSection:
|
||||||
case node[0][2].kind
|
case node[0][^1].kind
|
||||||
of nnkCommand:
|
of nnkCommand:
|
||||||
if node[0][2][0].kind == nnkIdent and node[0][2][0].eqIdent("await"):
|
if node[0][^1][0].kind == nnkIdent and node[0][^1][0].eqIdent("await"):
|
||||||
# var x = await y
|
# var x = await y
|
||||||
node[0][2][0] = emptyNoopSym
|
node[0][^1][0] = emptyNoopSym
|
||||||
else: discard
|
else: discard
|
||||||
of nnkAsgn:
|
of nnkAsgn:
|
||||||
case node[1].kind
|
case node[1].kind
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue