diff options
author | LemonBoy <thatlemon@gmail.com> | 2019-02-03 12:18:25 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2019-02-04 22:16:55 +0000 |
commit | d7ca7fd03e44b479f32a422b2a809880271ade81 (patch) | |
tree | 8e76cbd172f054342731389b4e1a1ed8f4f58591 /lib/pure | |
parent | 56d2b08c5aad5ec9f32cf05e1ead60e846c53ee5 (diff) | |
download | Nim-d7ca7fd03e44b479f32a422b2a809880271ade81.tar.gz |
Small change in how tuples are handled in async macro
A small change that brings no functional change beside a flatter tree.
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 |