From d7ca7fd03e44b479f32a422b2a809880271ade81 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 3 Feb 2019 12:18:25 +0100 Subject: Small change in how tuples are handled in async macro A small change that brings no functional change beside a flatter tree. --- lib/pure/asyncmacro.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/pure') 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 -- cgit 1.4.1-2-gfad0