summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2019-02-03 12:18:25 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2019-02-04 22:16:55 +0000
commitd7ca7fd03e44b479f32a422b2a809880271ade81 (patch)
tree8e76cbd172f054342731389b4e1a1ed8f4f58591 /lib/pure
parent56d2b08c5aad5ec9f32cf05e1ead60e846c53ee5 (diff)
downloadNim-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.nim14
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