summary refs log tree commit diff stats
path: root/rod/nimrod.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-desktop>2009-12-14 01:38:05 +0100
committerAndreas Rumpf <andreas@andreas-desktop>2009-12-14 01:38:05 +0100
commit3b7ef2288f60bc5c355ad9aeaa127431ec3aee7b (patch)
tree5e028b11cf337290942b3cf6ecc599854de36747 /rod/nimrod.nim
parent911c1cb301a8483e463772b785b0aee79cf2a68c (diff)
downloadNim-3b7ef2288f60bc5c355ad9aeaa127431ec3aee7b.tar.gz
floating point checks
Diffstat (limited to 'rod/nimrod.nim')
-rwxr-xr-xrod/nimrod.nim35
1 files changed, 12 insertions, 23 deletions
diff --git a/rod/nimrod.nim b/rod/nimrod.nim
index 950c687e0..b5ed532c9 100755
--- a/rod/nimrod.nim
+++ b/rod/nimrod.nim
@@ -17,11 +17,7 @@ var
   cmdLineInfo: TLineInfo
 
 proc ProcessCmdLine(pass: TCmdLinePass, command, filename: var string) = 
-  var 
-    p: TOptParser
-    bracketLe: int
-    key, val: string
-  p = parseopt.init()
+  var p = parseopt.init()
   while true: 
     parseopt.next(p)
     case p.kind
@@ -30,10 +26,10 @@ proc ProcessCmdLine(pass: TCmdLinePass, command, filename: var string) =
     of cmdLongOption, cmdShortOption: 
       # hint[X]:off is parsed as (p.key = "hint[X]", p.val = "off")
       # we fix this here
-      bracketLe = strutils.find(p.key, '[')
+      var bracketLe = strutils.find(p.key, '[')
       if bracketLe >= 0: 
-        key = copy(p.key, 0, bracketLe - 1)
-        val = copy(p.key, bracketLe + 1) & ':' & p.val
+        var key = copy(p.key, 0, bracketLe - 1)
+        var val = copy(p.key, bracketLe + 1) & ':' & p.val
         ProcessSwitch(key, val, pass, cmdLineInfo)
       else: 
         ProcessSwitch(p.key, p.val, pass, cmdLineInfo)
@@ -49,21 +45,18 @@ proc ProcessCmdLine(pass: TCmdLinePass, command, filename: var string) =
       rawMessage(errArgsNeedRunOption)
   
 proc HandleCmdLine() = 
-  var 
-    command, filename, prog: string
-    start: TTime
-  start = getTime()
+  var start = getTime()
   if paramCount() == 0: 
     writeCommandLineUsage()
   else: 
     # Process command line arguments:
-    command = ""
-    filename = ""
+    var command = ""
+    var filename = ""
     ProcessCmdLine(passCmd1, command, filename)
     if filename != "": options.projectPath = splitFile(filename).dir
     nimconf.LoadConfig(filename) # load the right config file
-                                 # now process command line arguments again, because some options in the
-                                 # command line can overwite the config file's settings
+    # now process command line arguments again, because some options in the
+    # command line can overwite the config file's settings
     extccomp.initVars()
     command = ""
     filename = ""
@@ -74,16 +67,12 @@ proc HandleCmdLine() =
       rawMessage(hintSuccessX, [$(gLinesCompiled), $(getTime() - start)])
     if optRun in gGlobalOptions: 
       when defined(unix): 
-        prog = "./" & quoteIfContainsWhite(changeFileExt(filename, ""))
+        var prog = "./" & quoteIfContainsWhite(changeFileExt(filename, ""))
       else: 
-        prog = quoteIfContainsWhite(changeFileExt(filename, ""))
+        var prog = quoteIfContainsWhite(changeFileExt(filename, ""))
       execExternalProgram(prog & ' ' & arguments)
 
-#{@emit
-#  GC_disableMarkAndSweep();
-#}
-
 cmdLineInfo = newLineInfo("command line", - 1, - 1)
 condsyms.InitDefines()
 HandleCmdLine()
-quit(options.gExitcode)
\ No newline at end of file
+quit(options.gExitcode)