diff options
author | Adam Strzelecki <ono@java.pl> | 2015-09-04 23:04:32 +0200 |
---|---|---|
committer | Adam Strzelecki <ono@java.pl> | 2015-09-04 23:04:32 +0200 |
commit | e80465dacf50f260abec30ae57d37b298c93fd83 (patch) | |
tree | 393394f8353a4adb49f95e6f13da1fd41681b7b3 /tests/lexer/tlexer.nim | |
parent | ac9c1cd6b980d4f00eeb52d1109d8e2c8cd21213 (diff) | |
download | Nim-e80465dacf50f260abec30ae57d37b298c93fd83.tar.gz |
tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
Diffstat (limited to 'tests/lexer/tlexer.nim')
-rw-r--r-- | tests/lexer/tlexer.nim | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/tests/lexer/tlexer.nim b/tests/lexer/tlexer.nim index 1dca6d9d0..e36220e7a 100644 --- a/tests/lexer/tlexer.nim +++ b/tests/lexer/tlexer.nim @@ -1,60 +1,60 @@ -discard """ - disabled: true -""" - -# We start with a comment -# This is the same comment - -# This is a new one! - -import - lexbase, os, strutils - -type - TMyRec {.final.} = object - x, y: int # coordinates - c: char # a character - a: int32 # an integer - - PMyRec = ref TMyRec # a reference to `TMyRec` - -proc splitText(txt: string): seq[string] # splits a text into several lines - # the comment continues here - # this is not easy to parse! - -proc anotherSplit(txt: string): seq[string] = - # the comment should belong to `anotherSplit`! - # another problem: comments are statements! - -const - x = 0B0_10001110100_0000101001000111101011101111111011000101001101001001'f64 # x ~~ 1.72826e35 - myNan = 0B01111111100000101100000000001000'f32 # NAN - y = """ - a rather long text. - Over many - lines. - """ - s = "\xff" - a = {0..234} - b = {0..high(int)} - v = 0'i32 - z = 6767566'f32 - -# small test program for lexbase - -proc main*(infile: string, a, b: int, someverylongnamewithtype = 0, - anotherlongthingie = 3) = - var - myInt: int = 0 - s: seq[string] - # this should be an error! - if initBaseLexer(L, infile, 30): nil - else: - writeLine(stdout, "could not open: " & infile) - writeLine(stdout, "Success!") - call(3, # we use 3 - 12, # we use 12 - 43) # we use 43 - - -main(ParamStr(1), 9, 0) +discard """ + disabled: true +""" + +# We start with a comment +# This is the same comment + +# This is a new one! + +import + lexbase, os, strutils + +type + TMyRec {.final.} = object + x, y: int # coordinates + c: char # a character + a: int32 # an integer + + PMyRec = ref TMyRec # a reference to `TMyRec` + +proc splitText(txt: string): seq[string] # splits a text into several lines + # the comment continues here + # this is not easy to parse! + +proc anotherSplit(txt: string): seq[string] = + # the comment should belong to `anotherSplit`! + # another problem: comments are statements! + +const + x = 0B0_10001110100_0000101001000111101011101111111011000101001101001001'f64 # x ~~ 1.72826e35 + myNan = 0B01111111100000101100000000001000'f32 # NAN + y = """ + a rather long text. + Over many + lines. + """ + s = "\xff" + a = {0..234} + b = {0..high(int)} + v = 0'i32 + z = 6767566'f32 + +# small test program for lexbase + +proc main*(infile: string, a, b: int, someverylongnamewithtype = 0, + anotherlongthingie = 3) = + var + myInt: int = 0 + s: seq[string] + # this should be an error! + if initBaseLexer(L, infile, 30): nil + else: + writeLine(stdout, "could not open: " & infile) + writeLine(stdout, "Success!") + call(3, # we use 3 + 12, # we use 12 + 43) # we use 43 + + +main(ParamStr(1), 9, 0) |