Remove expr/stmt (#5857)

This commit is contained in:
Arne Döring 2017-07-25 09:28:23 +02:00 • committed by Andreas Rumpf
commit 000b8afd26
168 changed files with 497 additions and 529 deletions

View file

@ -10,7 +10,7 @@ import macros
proc invalidFormatString() =
echo "invalidFormatString"
template formatImpl(handleChar: expr) =
template formatImpl(handleChar: untyped) =
var i = 0
while i < f.len:
if f[i] == '$':
@ -29,11 +29,11 @@ template formatImpl(handleChar: expr) =
i += 1
proc `%`*(f: string, a: openArray[string]): string =
template identity(x: expr): expr = x
template identity(x: untyped): untyped = x
result = ""
formatImpl(identity)
macro optFormat{`%`(f, a)}(f: string{lit}, a: openArray[string]): expr =
macro optFormat{`%`(f, a)}(f: string{lit}, a: openArray[string]): untyped =
result = newNimNode(nnkBracket)
let f = f.strVal
formatImpl(newLit)