summary refs log tree commit diff stats
path: root/tests/patterns
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-09-04 23:57:39 +0200
committerAraq <rumpf_a@web.de>2012-09-04 23:57:39 +0200
commit30c00aba07cd8b86dc935209bcad74558bae26ad (patch)
treea083279303f3eefefd85b7eb514413f6c3c8d943 /tests/patterns
parent3a1a1976645ac9ad2c449b0afea57c7c154ec37f (diff)
downloadNim-30c00aba07cd8b86dc935209bcad74558bae26ad.tar.gz
bugfixes and improvements for term rewriting macros
Diffstat (limited to 'tests/patterns')
-rw-r--r--tests/patterns/tstar.nim2
-rw-r--r--tests/patterns/tstmtlist.nim10
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/patterns/tstar.nim b/tests/patterns/tstar.nim
index 6dbff3cd6..55d841c3a 100644
--- a/tests/patterns/tstar.nim
+++ b/tests/patterns/tstar.nim
@@ -15,5 +15,5 @@ template optConc{ `&&` * a }(a: expr): expr = &&a
 let space = " "
 echo "my" && (space & "awe" && "some " ) && "concat"
 
-# check that it's been properly optimized:
+# check that it's been optimized properly:
 doAssert calls == 1
diff --git a/tests/patterns/tstmtlist.nim b/tests/patterns/tstmtlist.nim
index 391c93d47..138384227 100644
--- a/tests/patterns/tstmtlist.nim
+++ b/tests/patterns/tstmtlist.nim
@@ -5,14 +5,14 @@ discard """
 """
 
 template optWrite{
-  write(stdout, x)
-  write(stdout, y)
-}(x, y: string) =
-  write(stdout, "|", x, y, "|")
+  write(f, x)
+  ((write|writeln){w})(f, y)
+}(x, y: varargs[expr], f, w: expr) =
+  w(f, "|", x, y, "|")
 
 if true:
   echo "0"
   write stdout, "1"
-  write stdout, "2"
+  writeln stdout, "2"
   write stdout, "3"
   echo "4"