diff --git a/examples/allany.nim b/examples/allany.nim
index de36a1d9bd..52a794204a 100644
--- a/examples/allany.nim
+++ b/examples/allany.nim
@@ -18,9 +18,9 @@ template any(container, cond: expr): expr {.immediate.} =
break
result
-if all("mystring", {'a'..'z'}.contains) and any("myohmy", 'y'.`==`):
+if all("mystring", {'a'..'z'}.contains) and any("myohmy", 'y'.`==`):
echo "works"
-else:
+else:
echo "does not work"
diff --git a/examples/c++iface/irrlichtex.nim b/examples/c++iface/irrlichtex.nim
index 4dd1d79ee8..373a78ce7a 100644
--- a/examples/c++iface/irrlichtex.nim
+++ b/examples/c++iface/irrlichtex.nim
@@ -18,13 +18,13 @@ type
TDimension2d {.final, header: irr, importc: "dimension2d".} = object
Tvector3df {.final, header: irr, importc: "vector3df".} = object
TColor {.final, header: irr, importc: "SColor".} = object
-
+
TIrrlichtDevice {.final, header: irr, importc: "IrrlichtDevice".} = object
TIVideoDriver {.final, header: irr, importc: "IVideoDriver".} = object
TISceneManager {.final, header: irr, importc: "ISceneManager".} = object
TIGUIEnvironment {.final, header: irr, importc: "IGUIEnvironment".} = object
TIAnimatedMesh {.final, header: irr, importc: "IAnimatedMesh".} = object
- TIAnimatedMeshSceneNode {.final, header: irr,
+ TIAnimatedMeshSceneNode {.final, header: irr,
importc: "IAnimatedMeshSceneNode".} = object
TITexture {.final, header: irr, importc: "ITexture".} = object
@@ -100,7 +100,7 @@ var node = smgr.addAnimatedMeshSceneNode(mesh)
if node != nil:
#node->setMaterialFlag(EMF_LIGHTING, false)
#node->setMD2Animation(scene::EMAT_STAND)
- node.setMaterialTexture(0,
+ node.setMaterialTexture(0,
driver.getTexture(
"/home/andreas/download/irrlicht-1.7.2/media/media/sydney.bmp"))
diff --git a/examples/cross_calculator/nim_backend/backend.nim b/examples/cross_calculator/nim_backend/backend.nim
index ffa4311f9d..c8684581ca 100644
--- a/examples/cross_calculator/nim_backend/backend.nim
+++ b/examples/cross_calculator/nim_backend/backend.nim
@@ -1,5 +1,5 @@
-# Backend for the different user interfaces.
-
-proc myAdd*(x, y: int): int {.cdecl, exportc.} =
- result = x + y
-
+# Backend for the different user interfaces.
+
+proc myAdd*(x, y: int): int {.cdecl, exportc.} =
+ result = x + y
+
diff --git a/examples/curlex.nim b/examples/curlex.nim
index 017956818d..21786a6eeb 100644
--- a/examples/curlex.nim
+++ b/examples/curlex.nim
@@ -1,8 +1,8 @@
-import
+import
libcurl
var hCurl = easy_init()
-if hCurl != nil:
+if hCurl != nil:
discard easy_setopt(hCurl, OPT_VERBOSE, true)
discard easy_setopt(hCurl, OPT_URL, "http://nim-lang.org/")
discard easy_perform(hCurl)
diff --git a/examples/filterex.nim b/examples/filterex.nim
index 3713f4b64d..d9bfb67822 100644
--- a/examples/filterex.nim
+++ b/examples/filterex.nim
@@ -1,6 +1,6 @@
#! stdtmpl | standard
#proc generateHTMLPage(title, currentTab, content: string,
-# tabs: openArray[string]): string =
+# tabs: openArray[string]): string =
# result = ""
$title
@@ -8,7 +8,7 @@
#for tab in items(tabs):
#if currentTab == tab:
- - tag we are interested in always has an attribute,
# thus we search for ``xmlElementOpen`` and not for ``xmlElementStart``
- if x.elementName =?= "a":
+ if x.elementName =?= "a":
x.next()
- if x.kind == xmlAttribute:
+ if x.kind == xmlAttribute:
if x.attrKey =?= "href":
var link = x.attrValue
inc(links)
# skip until we have an ``xmlElementClose`` event
- while true:
+ while true:
x.next()
case x.kind
of xmlEof: break mainLoop
@@ -40,14 +40,14 @@ block mainLoop:
x.next() # skip ``xmlElementClose``
# now we have the description for the ``a`` element
var desc = ""
- while x.kind == xmlCharData:
+ while x.kind == xmlCharData:
desc.add(x.charData)
x.next()
echo(desc & ": " & link)
else:
- x.next()
+ x.next()
of xmlEof: break # end of file reached
- of xmlError:
+ of xmlError:
echo(errorMsg(x))
x.next()
else: x.next() # skip other events
diff --git a/examples/htmltitle.nim b/examples/htmltitle.nim
index 7e66fabaac..96bfc7d91c 100644
--- a/examples/htmltitle.nim
+++ b/examples/htmltitle.nim
@@ -15,11 +15,11 @@ open(x, s, filename)
while true:
x.next()
case x.kind
- of xmlElementStart:
- if cmpIgnoreCase(x.elementName, "title") == 0:
+ of xmlElementStart:
+ if cmpIgnoreCase(x.elementName, "title") == 0:
var title = ""
x.next() # skip ""
- while x.kind == xmlCharData:
+ while x.kind == xmlCharData:
title.add(x.charData)
x.next()
if x.kind == xmlElementEnd and cmpIgnoreCase(x.elementName, "title") == 0:
@@ -27,7 +27,7 @@ while true:
quit(0) # Success!
else:
echo(x.errorMsgExpected("/title"))
-
+
of xmlEof: break # end of file reached
else: discard # ignore other events
diff --git a/examples/httpserver2.nim b/examples/httpserver2.nim
index 13fea9e219..050684d3e4 100644
--- a/examples/httpserver2.nim
+++ b/examples/httpserver2.nim
@@ -90,7 +90,7 @@ proc serveFile(client: Socket, filename: string) =
# ------------------ CGI execution -------------------------------------------
-proc executeCgi(server: var TServer, client: Socket, path, query: string,
+proc executeCgi(server: var TServer, client: Socket, path, query: string,
meth: TRequestMethod) =
var env = newStringTable(modeCaseInsensitive)
var contentLength = -1
@@ -123,12 +123,12 @@ proc executeCgi(server: var TServer, client: Socket, path, query: string,
send(client, "HTTP/1.0 200 OK" & wwwNL)
var process = startProcess(command=path, env=env)
-
+
var job: TJob
job.process = process
job.client = client
server.job.add(job)
-
+
if meth == reqPost:
# get from client and post to CGI program:
var buf = alloc(contentLength)
diff --git a/examples/maximum.nim b/examples/maximum.nim
index ac6160f762..aa3fe375ab 100644
--- a/examples/maximum.nim
+++ b/examples/maximum.nim
@@ -1,6 +1,6 @@
-# Test high level features
-
-import strutils
-
-echo "Give a list of numbers (separated by spaces): "
-stdin.readLine.split.map(parseInt).max.`$`.echo(" is the maximum!")
+# Test high level features
+
+import strutils
+
+echo "Give a list of numbers (separated by spaces): "
+stdin.readLine.split.map(parseInt).max.`$`.echo(" is the maximum!")
diff --git a/examples/parsecfgex.nim b/examples/parsecfgex.nim
index 0f37a0378f..0fa03ffb5f 100644
--- a/examples/parsecfgex.nim
+++ b/examples/parsecfgex.nim
@@ -1,7 +1,7 @@
import
os, parsecfg, strutils, streams
-
+
var f = newFileStream(paramStr(1), fmRead)
if f != nil:
var p: CfgParser
@@ -9,7 +9,7 @@ if f != nil:
while true:
var e = next(p)
case e.kind
- of cfgEof:
+ of cfgEof:
echo("EOF!")
break
of cfgSectionStart: ## a ``[section]`` has been parsed
diff --git a/examples/sdlex.nim b/examples/sdlex.nim
index 3dd474d8e8..7a4ebf3db9 100644
--- a/examples/sdlex.nim
+++ b/examples/sdlex.nim
@@ -1,52 +1,52 @@
-# Test the SDL interface:
-
-import
- sdl, sdl_image, colors
-
-var
- screen, greeting: PSurface
- r: TRect
- event: TEvent
- bgColor = colChocolate.int32
-
-if init(INIT_VIDEO) != 0:
- quit "SDL failed to initialize!"
-
-screen = setVideoMode(640, 480, 16, SWSURFACE or ANYFORMAT)
-if screen.isNil:
- quit($sdl.getError())
-
-greeting = imgLoad("tux.png")
-if greeting.isNil:
- echo "Failed to load tux.png"
-else:
- ## convert the image to alpha and free the old one
- var s = greeting.displayFormatAlpha()
- swap(greeting, s)
- s.freeSurface()
-
-r.x = 0
-r.y = 0
-
-block game_loop:
- while true:
-
- while pollEvent(addr event) > 0:
- case event.kind
- of QUITEV:
- break game_loop
- of KEYDOWN:
- if evKeyboard(addr event).keysym.sym == K_ESCAPE:
- break game_loop
- else:
- discard
-
- discard fillRect(screen, nil, bgColor)
- discard blitSurface(greeting, nil, screen, addr r)
- discard flip(screen)
-
-greeting.freeSurface()
-screen.freeSurface()
-sdl.quit()
-
-## fowl wuz here 10/2012
\ No newline at end of file
+# Test the SDL interface:
+
+import
+ sdl, sdl_image, colors
+
+var
+ screen, greeting: PSurface
+ r: TRect
+ event: TEvent
+ bgColor = colChocolate.int32
+
+if init(INIT_VIDEO) != 0:
+ quit "SDL failed to initialize!"
+
+screen = setVideoMode(640, 480, 16, SWSURFACE or ANYFORMAT)
+if screen.isNil:
+ quit($sdl.getError())
+
+greeting = imgLoad("tux.png")
+if greeting.isNil:
+ echo "Failed to load tux.png"
+else:
+ ## convert the image to alpha and free the old one
+ var s = greeting.displayFormatAlpha()
+ swap(greeting, s)
+ s.freeSurface()
+
+r.x = 0
+r.y = 0
+
+block game_loop:
+ while true:
+
+ while pollEvent(addr event) > 0:
+ case event.kind
+ of QUITEV:
+ break game_loop
+ of KEYDOWN:
+ if evKeyboard(addr event).keysym.sym == K_ESCAPE:
+ break game_loop
+ else:
+ discard
+
+ discard fillRect(screen, nil, bgColor)
+ discard blitSurface(greeting, nil, screen, addr r)
+ discard flip(screen)
+
+greeting.freeSurface()
+screen.freeSurface()
+sdl.quit()
+
+## fowl wuz here 10/2012
diff --git a/examples/statcsv.nim b/examples/statcsv.nim
index cd1de62afd..f2cf809e20 100644
--- a/examples/statcsv.nim
+++ b/examples/statcsv.nim
@@ -28,7 +28,7 @@ while readRow(x):
for i in 0..x.row.len-1: header[i] = "Col " & $(i+1)
else:
# data line:
- for i in 0..x.row.len-1:
+ for i in 0..x.row.len-1:
push(res[i], parseFloat(x.row[i]))
x.close()
diff --git a/examples/talk/tags.nim b/examples/talk/tags.nim
index d47b09e077..12b9a08c33 100644
--- a/examples/talk/tags.nim
+++ b/examples/talk/tags.nim
@@ -1,7 +1,7 @@
template htmlTag(tag: expr) {.immediate.} =
proc tag(): string = "<" & astToStr(tag) & ">"
-
+
htmlTag(br)
htmlTag(html)
diff --git a/examples/tunit.nim b/examples/tunit.nim
index d0e9751197..d7b1fcbbd2 100644
--- a/examples/tunit.nim
+++ b/examples/tunit.nim
@@ -1,47 +1,47 @@
-import
- unittest, macros
-
-var
- a = 1
- b = 22
- c = 1
- d = 3
-
-suite "my suite":
- setup:
- echo "suite setup"
- var testVar = "from setup"
-
- teardown:
- echo "suite teardown"
-
- test "first suite test":
- testVar = "modified"
- echo "test var: " & testVar
- check a > b
-
- test "second suite test":
- echo "test var: " & testVar
-
-proc foo: bool =
- echo "running foo"
- return true
-
-proc err =
- raise newException(EArithmetic, "some exception")
-
-test "final test":
- echo "inside suite-less test"
-
- check:
- a == c
- foo()
- d > 10
-
-test "arithmetic failure":
- expect(EArithmetic):
- err()
-
- expect(EArithmetic, ESystem):
- discard foo()
-
+import
+ unittest, macros
+
+var
+ a = 1
+ b = 22
+ c = 1
+ d = 3
+
+suite "my suite":
+ setup:
+ echo "suite setup"
+ var testVar = "from setup"
+
+ teardown:
+ echo "suite teardown"
+
+ test "first suite test":
+ testVar = "modified"
+ echo "test var: " & testVar
+ check a > b
+
+ test "second suite test":
+ echo "test var: " & testVar
+
+proc foo: bool =
+ echo "running foo"
+ return true
+
+proc err =
+ raise newException(EArithmetic, "some exception")
+
+test "final test":
+ echo "inside suite-less test"
+
+ check:
+ a == c
+ foo()
+ d > 10
+
+test "arithmetic failure":
+ expect(EArithmetic):
+ err()
+
+ expect(EArithmetic, ESystem):
+ discard foo()
+
diff --git a/web/snippets/snippet1.nim b/web/snippets/snippet1.nim
index 85cb98142a..b0895e0c09 100644
--- a/web/snippets/snippet1.nim
+++ b/web/snippets/snippet1.nim
@@ -1,4 +1,4 @@
import strutils
-echo "Give a list of integers (separated by spaces): ",
+echo "Give a list of integers (separated by spaces): ",
stdin.readLine.split.each(parseInt).max,
- " is the maximum!"
+ " is the maximum!"