floating point checks
This commit is contained in:
parent
911c1cb301
commit
3b7ef2288f
30 changed files with 611 additions and 631 deletions
|
|
@ -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)
|
||||
quit(options.gExitcode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue