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
|
|
@ -29,7 +29,7 @@ proc doWithOneAndTwo(f: (int, int) -> int): int =
|
|||
echo twoParams(proc (a, b): auto = a + b)
|
||||
echo twoParams((x, y) => x + y)
|
||||
|
||||
echo oneParam(x => x+5)
|
||||
echo oneParam(x => x+5)
|
||||
|
||||
echo noParams(() => 3)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ discard """
|
|||
|
||||
import macros, strutils
|
||||
|
||||
proc testBlock(): string {.compileTime.} =
|
||||
proc testBlock(): string {.compileTime.} =
|
||||
block myBlock:
|
||||
while true:
|
||||
echo "inner block"
|
||||
|
|
@ -21,7 +21,7 @@ macro mac(n: expr): expr =
|
|||
s = s.replace("l", "!!")
|
||||
result = newStrLitNode("Your value sir: '$#'" % [s])
|
||||
|
||||
const s = testBlock()
|
||||
const s = testBlock()
|
||||
const t = mac("HEllo World")
|
||||
echo s, " ", t
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ macro makeBar(A, B: typedesc): typedesc =
|
|||
echo "instantiation ", counter, " with ", A.name, " and ", B.name
|
||||
result = A
|
||||
|
||||
type
|
||||
type
|
||||
Bar[T, U] = makeBar(T, U)
|
||||
|
||||
var bb1: Bar[int, float]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ of r"[\+\-\*\?]+":
|
|||
return tkOperator
|
||||
else:
|
||||
return tkUnknown
|
||||
|
||||
|
||||
case_token: inc i
|
||||
|
||||
#bug #488
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@ discard """
|
|||
file: "tprintf.nim"
|
||||
output: "Andreas Rumpf"
|
||||
"""
|
||||
# Test a printf proc
|
||||
|
||||
proc printf(file: TFile, args: openarray[string]) =
|
||||
var i = 0
|
||||
while i < args.len:
|
||||
write(file, args[i])
|
||||
inc(i)
|
||||
|
||||
printf(stdout, ["Andreas ", "Rumpf\n"])
|
||||
#OUT Andreas Rumpf
|
||||
# Test a printf proc
|
||||
|
||||
proc printf(file: TFile, args: openarray[string]) =
|
||||
var i = 0
|
||||
while i < args.len:
|
||||
write(file, args[i])
|
||||
inc(i)
|
||||
|
||||
printf(stdout, ["Andreas ", "Rumpf\n"])
|
||||
#OUT Andreas Rumpf
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ discard """
|
|||
|
||||
import macros
|
||||
|
||||
macro quoteWords(n: expr): expr {.immediate.} =
|
||||
macro quoteWords(n: expr): expr {.immediate.} =
|
||||
let n = callsite()
|
||||
result = newNimNode(nnkBracket, n)
|
||||
for i in 1..n.len-1:
|
||||
expectKind(n[i], nnkIdent)
|
||||
result.add(toStrLit(n[i]))
|
||||
|
||||
|
||||
const
|
||||
myWordList = quoteWords(this, an, example)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ bb
|
|||
numbers
|
||||
11
|
||||
22
|
||||
AST a
|
||||
AST a
|
||||
[(11, 22), (33, 44)]
|
||||
AST b
|
||||
AST b
|
||||
(e: [55, 66], f: [77, 88])
|
||||
55
|
||||
10
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ type
|
|||
# an untyped table to store the proc pointers
|
||||
# it's also possible to use a strongly typed tuple here
|
||||
VTable = array[0..1, pointer]
|
||||
|
||||
|
||||
TBase = object {.inheritable.}
|
||||
vtbl: ptr VTable
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue