diff options
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/asyncmacro.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/pure/asyncmacro.nim b/lib/pure/asyncmacro.nim index f1e0aa568..23ddf4777 100644 --- a/lib/pure/asyncmacro.nim +++ b/lib/pure/asyncmacro.nim @@ -154,13 +154,13 @@ proc processBody(node, retFutureSym: NimNode, newCommand, node) of nnkVarSection, nnkLetSection: - case node[0][2].kind + case node[0][^1].kind 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 newVarSection = node # TODO: Should this use copyNimNode? - result.createVar("future" & node[0][0].strVal, node[0][2][1], - newVarSection[0][2], newVarSection, node) + result.createVar("future" & node[0][0].strVal, node[0][^1][1], + newVarSection[0][^1], newVarSection, node) else: discard of nnkAsgn: case node[1].kind @@ -367,11 +367,11 @@ proc stripAwait(node: NimNode): NimNode = # foo await x node[1][0] = emptyNoopSym of nnkVarSection, nnkLetSection: - case node[0][2].kind + case node[0][^1].kind 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 - node[0][2][0] = emptyNoopSym + node[0][^1][0] = emptyNoopSym else: discard of nnkAsgn: case node[1].kind |