diff options
Diffstat (limited to 'tests/macros/tstringinterp.nim')
-rw-r--r-- | tests/macros/tstringinterp.nim | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/macros/tstringinterp.nim b/tests/macros/tstringinterp.nim index bc79cdaba..305f40ac5 100644 --- a/tests/macros/tstringinterp.nim +++ b/tests/macros/tstringinterp.nim @@ -9,7 +9,7 @@ proc concat(strings: varargs[string]): string = result = newString(0) for s in items(strings): result.add(s) -template processInterpolations(e: expr) = +template processInterpolations(e) = var s = e[1].strVal for f in interpolatedFragments(s): case f.kind @@ -17,7 +17,7 @@ template processInterpolations(e: expr) = of ikDollar: addDollar() of ikVar, ikExpr: addExpr(newCall("$", parseExpr(f.value))) -macro formatStyleInterpolation(e: expr): expr = +macro formatStyleInterpolation(e: untyped): untyped = let e = callsite() var formatString = "" @@ -41,7 +41,7 @@ macro formatStyleInterpolation(e: expr): expr = result[1].strVal = formatString result[2] = arrayNode -macro concatStyleInterpolation(e: expr): expr = +macro concatStyleInterpolation(e: untyped): untyped = let e = callsite() var args: seq[NimNode] newSeq(args, 0) @@ -71,4 +71,3 @@ var s2 = formatStyleInterpolation"Hello ${bob}, ${sum(alice.len, bob.len, 2)}$$" write(stdout, s1 & " | " & s2) - |