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

@ -66,7 +66,7 @@ proc setItem[T,D](Akey: T, Avalue: D, ANode: PNode[T,D]): ref TItem[T,D] {.inlin
proc cmp[T:int8|int16|int32|int64|int] (a,b: T): T {.inline.} =
return a-b
template binSearchImpl *(docmp: expr) {.immediate.} =
template binSearchImpl *(docmp: untyped) =
var bFound = false
result = 0
var H = haystack.len - 1

View file

@ -5,7 +5,7 @@ discard """
# bug #3498
template defaultOf[T](t: T): expr = (var d: T; d)
template defaultOf[T](t: T): untyped = (var d: T; d)
echo defaultOf(1) #<- excpected 0

View file

@ -27,5 +27,5 @@ ttmpl[int] #<- crash case #3
# but still allow normal use of [] on non-generic templates
template tarr: expr = [1, 2, 3, 4]
template tarr: untyped = [1, 2, 3, 4]
echo tarr[1]

View file

@ -36,7 +36,7 @@ proc derefExpr(exprRef: string): NimNode {.compileTime.} =
type Mapped[Input; predicate: static[string]] = object
input: Input
macro map(input, predicate: expr): expr =
macro map(input, predicate: untyped): untyped =
let predicate = callsite()[2]
newNimNode(nnkObjConstr).add(
newNimNode(nnkBracketExpr).add(
@ -47,7 +47,7 @@ macro map(input, predicate: expr): expr =
ident"input", input))
proc `[]`(m: Mapped, i: int): auto =
macro buildResult: expr =
macro buildResult: untyped =
newCall(
derefExpr(m.predicate),
newNimNode(nnkBracketExpr).add(