summary refs log tree commit diff stats
path: root/tests/trmacros
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2017-07-25 09:28:23 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-07-25 09:28:23 +0200
commit000b8afd26fa16684a116d9afe798ea94df9c270 (patch)
treee5295df748b90c5027e44adfa3a442031534572c /tests/trmacros
parent52ff244d5d2775fa4d13f4e2b9a996f411281312 (diff)
downloadNim-000b8afd26fa16684a116d9afe798ea94df9c270.tar.gz
Remove expr/stmt (#5857)
Diffstat (limited to 'tests/trmacros')
-rw-r--r--tests/trmacros/targlist.nim2
-rw-r--r--tests/trmacros/tcse.nim4
-rw-r--r--tests/trmacros/tmatrix.nim2
-rw-r--r--tests/trmacros/tnoalias.nim2
-rw-r--r--tests/trmacros/tnoalias2.nim2
-rw-r--r--tests/trmacros/tnoendlessrec.nim2
-rw-r--r--tests/trmacros/tor.nim8
-rw-r--r--tests/trmacros/tpartial.nim4
-rw-r--r--tests/trmacros/tstar.nim2
-rw-r--r--tests/trmacros/tstmtlist.nim2
10 files changed, 15 insertions, 15 deletions
diff --git a/tests/trmacros/targlist.nim b/tests/trmacros/targlist.nim
index f9d2cb6c6..46235dab1 100644
--- a/tests/trmacros/targlist.nim
+++ b/tests/trmacros/targlist.nim
@@ -3,7 +3,7 @@ discard """
 """
 
 proc f(x: varargs[string, `$`]) = discard
-template optF{f(x)}(x: varargs[expr]) =
+template optF{f(x)}(x: varargs[untyped]) =
   writeLine(stdout, x)
 
 f 1, 2, false, 3, "ha"
diff --git a/tests/trmacros/tcse.nim b/tests/trmacros/tcse.nim
index 023a8f298..315570d8f 100644
--- a/tests/trmacros/tcse.nim
+++ b/tests/trmacros/tcse.nim
@@ -2,8 +2,8 @@ discard """
   output: "4"
 """
 
-template cse{f(a, a, x)}(a: expr{(nkDotExpr|call|nkBracketExpr)&noSideEffect},
-                         f: expr, x: varargs[expr]): expr =
+template cse{f(a, a, x)}(a: typed{(nkDotExpr|call|nkBracketExpr)&noSideEffect},
+                         f: typed, x: varargs[typed]): untyped =
   let aa = a
   f(aa, aa, x)+4
 
diff --git a/tests/trmacros/tmatrix.nim b/tests/trmacros/tmatrix.nim
index f409434c5..a14ad2db0 100644
--- a/tests/trmacros/tmatrix.nim
+++ b/tests/trmacros/tmatrix.nim
@@ -15,7 +15,7 @@ proc `$`(a: TMat): string = result = $a.dummy
 proc mat21(): TMat =
   result.dummy = 21
 
-macro optOps{ (`+`|`-`|`*`) ** a }(a: TMat): expr =
+macro optOps{ (`+`|`-`|`*`) ** a }(a: TMat): untyped =
   echo treeRepr(a)
   result = newCall(bindSym"mat21")
 
diff --git a/tests/trmacros/tnoalias.nim b/tests/trmacros/tnoalias.nim
index 1d5671362..ec12d4712 100644
--- a/tests/trmacros/tnoalias.nim
+++ b/tests/trmacros/tnoalias.nim
@@ -2,7 +2,7 @@ discard """
   output: "23"
 """
 
-template optslice{a = b + c}(a: expr{noalias}, b, c: expr): stmt =
+template optslice{a = b + c}(a: untyped{noalias}, b, c: untyped): typed =
   a = b
   inc a, c
 
diff --git a/tests/trmacros/tnoalias2.nim b/tests/trmacros/tnoalias2.nim
index 5a816acb9..9362e764f 100644
--- a/tests/trmacros/tnoalias2.nim
+++ b/tests/trmacros/tnoalias2.nim
@@ -3,7 +3,7 @@ discard """
 """
 
 # bug #206
-template optimizeOut{testFunc(a, b)}(a: int, b: int{alias}) : expr = 0
+template optimizeOut{testFunc(a, b)}(a: int, b: int{alias}): untyped = 0
 
 proc testFunc(a, b: int): int = result = a + b
 var testVar = 1
diff --git a/tests/trmacros/tnoendlessrec.nim b/tests/trmacros/tnoendlessrec.nim
index 53891bcc0..508770ca7 100644
--- a/tests/trmacros/tnoendlessrec.nim
+++ b/tests/trmacros/tnoendlessrec.nim
@@ -4,7 +4,7 @@ discard """
 
 # test that an endless recursion is avoided:
 
-template optLen{len(x)}(x: expr): expr = len(x)
+template optLen{len(x)}(x: typed): int = len(x)
 
 var s = "lala"
 echo len(s)
diff --git a/tests/trmacros/tor.nim b/tests/trmacros/tor.nim
index 500851582..d698e928d 100644
--- a/tests/trmacros/tor.nim
+++ b/tests/trmacros/tor.nim
@@ -4,13 +4,13 @@ true
 3'''
 """
 
-template arithOps: expr = (`+` | `-` | `*`)
-template testOr{ (arithOps{f})(a, b) }(a, b, f: expr): expr = f(a+1, b)
+template arithOps: untyped = (`+` | `-` | `*`)
+template testOr{ (arithOps{f})(a, b) }(a, b, f: untyped): untyped = f(a+1, b)
 
 let xx = 10
 echo 10*xx
 
-template t{x = (~x){y} and (~x){z}}(x, y, z: bool): stmt =
+template t{x = (~x){y} and (~x){z}}(x, y, z: bool): typed =
   x = y
   if x: x = z
 
@@ -22,7 +22,7 @@ a = b and a
 echo a
 
 # bug #798
-template t012{(0|1|2){x}}(x: expr): expr = x+1
+template t012{(0|1|2){x}}(x: untyped): untyped = x+1
 let z = 1
 # outputs 3 thanks to fixpoint iteration:
 echo z
diff --git a/tests/trmacros/tpartial.nim b/tests/trmacros/tpartial.nim
index fdaa3414a..c636684d7 100644
--- a/tests/trmacros/tpartial.nim
+++ b/tests/trmacros/tpartial.nim
@@ -5,7 +5,7 @@ discard """
 proc p(x, y: int; cond: bool): int =
   result = if cond: x + y else: x - y
 
-template optP{p(x, y, true)}(x, y: expr): expr = x - y
-template optP{p(x, y, false)}(x, y: expr): expr = x + y
+template optP{p(x, y, true)}(x, y): untyped = x - y
+template optP{p(x, y, false)}(x, y): untyped = x + y
 
 echo p(2, 4, true)
diff --git a/tests/trmacros/tstar.nim b/tests/trmacros/tstar.nim
index 536289ff0..86f698232 100644
--- a/tests/trmacros/tstar.nim
+++ b/tests/trmacros/tstar.nim
@@ -10,7 +10,7 @@ proc `&&`(s: varargs[string]): string =
   for i in 1..len(s)-1: result.add s[i]
   inc calls
 
-template optConc{ `&&` * a }(a: string): expr = &&a
+template optConc{ `&&` * a }(a: string): string = &&a
 
 let space = " "
 echo "my" && (space & "awe" && "some " ) && "concat"
diff --git a/tests/trmacros/tstmtlist.nim b/tests/trmacros/tstmtlist.nim
index 5202f778b..751acb79a 100644
--- a/tests/trmacros/tstmtlist.nim
+++ b/tests/trmacros/tstmtlist.nim
@@ -8,7 +8,7 @@ discard """
 template optWrite{
   write(f, x)
   ((write|writeLine){w})(f, y)
-}(x, y: varargs[expr], f, w: expr) =
+}(x, y: varargs[untyped], f, w: untyped) =
   w(f, "|", x, y, "|")
 
 if true: