Merge remote-tracking branch 'origin/devel' into bitsize-pragma

This commit is contained in:
Aman Gupta 2015-09-29 15:38:30 -07:00
commit e5ba94b1f8
14 changed files with 348 additions and 45 deletions

View file

@ -48,7 +48,7 @@ proc handleCmdLine() =
gProjectFull = canonicalizePath(gProjectName)
except OSError:
gProjectFull = gProjectName
var p = splitFile(gProjectFull)
let p = splitFile(gProjectFull)
gProjectPath = p.dir
gProjectName = p.name
else:
@ -59,6 +59,9 @@ proc handleCmdLine() =
runNimScript(scriptFile)
# 'nim foo.nims' means to just run the NimScript file and do nothing more:
if scriptFile == gProjectFull: return
elif fileExists(gProjectPath / "config.nims"):
# directory wide NimScript file
runNimScript(gProjectPath / "config.nims")
# now process command line arguments again, because some options in the
# command line can overwite the config file's settings
extccomp.initVars()

View file

@ -105,6 +105,13 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext =
setResult(a, strutils.cmpIgnoreCase(a.getString 0, a.getString 1))
cbconf setCommand:
options.command = a.getString 0
let arg = a.getString 1
if arg.len > 0:
gProjectName = arg
try:
gProjectFull = canonicalizePath(gProjectPath / gProjectName)
except OSError:
gProjectFull = gProjectName
cbconf getCommand:
setResult(a, options.command)
cbconf switch:

View file

@ -1383,7 +1383,6 @@ proc genArrAccess(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags) =
elif arrayType == tyTypeDesc:
c.genTypeLit(n.typ, dest)
else:
echo renderTree(n)
genArrAccess2(c, n, dest, opcLdArr, flags)
proc getNullValueAux(obj: PNode, result: PNode) =