summary refs log tree commit diff stats
path: root/tests/run/tusingstatement.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-10-05 12:10:01 +0200
committerAraq <rumpf_a@web.de>2012-10-05 12:10:01 +0200
commit350e178d837a212755b729bb82225193acef5734 (patch)
treebd94d64c55eeccdf8479c967bc77bac2500336af /tests/run/tusingstatement.nim
parent01dfcf63106fb18239a1c6dabf551405c33b6e7e (diff)
parentf28b7be6a37d566df64cb944c1687e014be8d083 (diff)
downloadNim-350e178d837a212755b729bb82225193acef5734.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'tests/run/tusingstatement.nim')
-rw-r--r--tests/run/tusingstatement.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/run/tusingstatement.nim b/tests/run/tusingstatement.nim
index f5168dbf5..b9d466377 100644
--- a/tests/run/tusingstatement.nim
+++ b/tests/run/tusingstatement.nim
@@ -28,12 +28,12 @@ import
 #  `opened` is defined to `optional.hasValue`
 macro using(e: expr): stmt {.immediate.} =
   let e = callsite()
-  if e.len != 2:
+  if e.len != 3:
     error "Using statement: unexpected number of arguments. Got " &
       $e.len & ", expected: 1 or more variable assignments and a block"
 
-  var args = e[0]
-  var body = e[1]
+  var args = e
+  var body = e[2]
   
   var 
     variables : seq[PNimrodNode]
@@ -41,8 +41,8 @@ macro using(e: expr): stmt {.immediate.} =
 
   newSeq(variables, 0)
   newSeq(closingCalls, 0)
-
-  for i in countup(1, args.len-1):
+  
+  for i in countup(1, args.len-2):
     if args[i].kind == nnkExprEqExpr:
       var varName = args[i][0]
       var varValue = args[i][1]