tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
This commit is contained in:
parent
ac9c1cd6b9
commit
e80465dacf
372 changed files with 4486 additions and 4486 deletions
|
|
@ -3,6 +3,6 @@ discard """
|
|||
errormsg: "type mismatch: got (int literal(1)) but expected 'bool'"
|
||||
"""
|
||||
|
||||
if 1:
|
||||
if 1:
|
||||
echo "wtf?"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ type Node = tuple[left: ref Node]
|
|||
|
||||
proc traverse(root: ref Node) =
|
||||
if root.left != nil: traverse(root.left)
|
||||
|
||||
|
||||
type A = tuple[B: ptr A]
|
||||
proc C(D: ptr A) = C(D.B)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@ discard """
|
|||
line: 20
|
||||
errormsg: "type mismatch"
|
||||
"""
|
||||
# test for ref types (including refs to procs)
|
||||
|
||||
type
|
||||
TProc = proc (a, b: int): int {.stdcall.}
|
||||
|
||||
proc foo(c, d: int): int {.stdcall.} =
|
||||
return 0
|
||||
|
||||
proc wrongfoo(c, e: int): int {.inline.} =
|
||||
return 0
|
||||
|
||||
var p: TProc
|
||||
p = foo
|
||||
write(stdout, "success!")
|
||||
p = wrongfoo #ERROR_MSG type mismatch
|
||||
|
||||
# test for ref types (including refs to procs)
|
||||
|
||||
type
|
||||
TProc = proc (a, b: int): int {.stdcall.}
|
||||
|
||||
proc foo(c, d: int): int {.stdcall.} =
|
||||
return 0
|
||||
|
||||
proc wrongfoo(c, e: int): int {.inline.} =
|
||||
return 0
|
||||
|
||||
var p: TProc
|
||||
p = foo
|
||||
write(stdout, "success!")
|
||||
p = wrongfoo #ERROR_MSG type mismatch
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ type
|
|||
APtr = RegionA ptr int
|
||||
RegionB = object
|
||||
BPtr = RegionB ptr int
|
||||
|
||||
|
||||
var x,xx: APtr
|
||||
var y: BPtr
|
||||
x = nil
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ type
|
|||
next: ThingyPtr
|
||||
name: string
|
||||
|
||||
proc iname(t: ThingyPtr) =
|
||||
proc iname(t: ThingyPtr) =
|
||||
var x = t
|
||||
|
||||
while not x.isNil:
|
||||
echo x.name
|
||||
x = x.next
|
||||
|
||||
proc go() =
|
||||
proc go() =
|
||||
var athing : ThingyPtr
|
||||
|
||||
iname(athing)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ proc `[]=` (self: var TFoo, x, y: int) =
|
|||
proc second(self: var TFoo): var TSecond =
|
||||
return TSecond(self)
|
||||
|
||||
proc `[]`(self: var TSecond, x: int): var int =
|
||||
proc `[]`(self: var TSecond, x: int): var int =
|
||||
return TFoo(self).data[2*x]
|
||||
|
||||
var f: TFoo
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ for key, val in items(romanNumbers):
|
|||
proc PrintBiTuple(t: tuple[k: string, v: int]): int =
|
||||
stdout.write(t.k & "=" & $t.v & ", ")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ type
|
|||
TBinHeap[T] = object
|
||||
heap: seq[TNode[T]]
|
||||
last: int
|
||||
|
||||
|
||||
PBinHeap[T] = ref TBinHeap[T]
|
||||
|
||||
proc newBinHeap*[T](heap: var PBinHeap[T], size: int) =
|
||||
|
|
@ -19,7 +19,7 @@ proc newBinHeap*[T](heap: var PBinHeap[T], size: int) =
|
|||
heap.last = 0
|
||||
newSeq(heap.heap, size)
|
||||
#newSeq(heap.seq, size)
|
||||
|
||||
|
||||
proc parent(elem: int): int {.inline.} =
|
||||
return (elem-1) div 2
|
||||
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@ proc nothing(x, y: void): void =
|
|||
echo "ha"
|
||||
|
||||
proc callProc[T](p: proc (x: T) {.nimcall.}, x: T) =
|
||||
when T is void:
|
||||
when T is void:
|
||||
p()
|
||||
else:
|
||||
p(x)
|
||||
|
||||
proc intProc(x: int) =
|
||||
echo x
|
||||
|
||||
|
||||
proc emptyProc() =
|
||||
echo "empty"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ type
|
|||
TMyObj = TYourObj
|
||||
TYourObj = object of RootObj
|
||||
x, y: int
|
||||
|
||||
|
||||
proc init: TYourObj =
|
||||
result.x = 0
|
||||
result.y = -1
|
||||
|
||||
|
||||
proc f(x: var TYourObj) =
|
||||
discard
|
||||
|
||||
|
||||
var m: TMyObj = init()
|
||||
f(m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue