summary refs log tree commit diff stats
path: root/tests/parser
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-09-04 23:04:32 +0200
committerAdam Strzelecki <ono@java.pl>2015-09-04 23:04:32 +0200
commite80465dacf50f260abec30ae57d37b298c93fd83 (patch)
tree393394f8353a4adb49f95e6f13da1fd41681b7b3 /tests/parser
parentac9c1cd6b980d4f00eeb52d1109d8e2c8cd21213 (diff)
downloadNim-e80465dacf50f260abec30ae57d37b298c93fd83.tar.gz
tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
Diffstat (limited to 'tests/parser')
-rw-r--r--tests/parser/tdomulttest.nim2
-rw-r--r--tests/parser/tinvwhen.nim16
-rw-r--r--tests/parser/toprprec.nim8
3 files changed, 13 insertions, 13 deletions
diff --git a/tests/parser/tdomulttest.nim b/tests/parser/tdomulttest.nim
index 4ee6de128..418192ac8 100644
--- a/tests/parser/tdomulttest.nim
+++ b/tests/parser/tdomulttest.nim
@@ -14,4 +14,4 @@ do (x: int) -> int:
   echo("multi lines")
   return x
 
-echo("end")
\ No newline at end of file
+echo("end")
diff --git a/tests/parser/tinvwhen.nim b/tests/parser/tinvwhen.nim
index 5ff94cc6c..99701bdf5 100644
--- a/tests/parser/tinvwhen.nim
+++ b/tests/parser/tinvwhen.nim
@@ -3,13 +3,13 @@ discard """
   line: 11
   errormsg: "invalid indentation"
 """
-# This was parsed even though it should not!

-

-proc chdir(path: cstring): cint {.importc: "chdir", header: "dirHeader".}

-

-proc getcwd(buf: cstring, buflen: cint): cstring

-    when defined(unix): {.importc: "getcwd", header: "<unistd.h>".} #ERROR_MSG invalid indentation

-    elif defined(windows): {.importc: "getcwd", header: "<direct.h>"}

-    else: {.error: "os library not ported to your OS. Please help!".}

+# This was parsed even though it should not!
+
+proc chdir(path: cstring): cint {.importc: "chdir", header: "dirHeader".}
+
+proc getcwd(buf: cstring, buflen: cint): cstring
+    when defined(unix): {.importc: "getcwd", header: "<unistd.h>".} #ERROR_MSG invalid indentation
+    elif defined(windows): {.importc: "getcwd", header: "<direct.h>"}
+    else: {.error: "os library not ported to your OS. Please help!".}
 
 
diff --git a/tests/parser/toprprec.nim b/tests/parser/toprprec.nim
index ce33934b5..2c22f5b80 100644
--- a/tests/parser/toprprec.nim
+++ b/tests/parser/toprprec.nim
@@ -2,7 +2,7 @@ discard """
   file: "toprprec.nim"
   output: "done"
 """
-# Test operator precedence: 
+# Test operator precedence:
 
 template `@` (x: expr): expr {.immediate.} = self.x
 template `@!` (x: expr): expr {.immediate.} = x
@@ -12,7 +12,7 @@ type
   TO = object
     x: int
   TA = tuple[a, b: int, obj: TO]
-  
+
 proc init(self: var TA): string =
   @a = 3
   === @b = 4
@@ -22,10 +22,10 @@ proc init(self: var TA): string =
 
 assert 3+5*5-2 == 28- -26-28
 
-proc `^-` (x, y: int): int =  
+proc `^-` (x, y: int): int =
   # now right-associative!
   result = x - y
-  
+
 assert 34 ^- 6 ^- 2 == 30
 assert 34 - 6 - 2 == 26