summary refs log tree commit diff stats
path: root/compiler/nimconf.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-02-07 18:11:00 +0100
committerAndreas Rumpf <rumpf_a@web.de>2015-02-07 18:11:00 +0100
commit31074e0015c50d8956d884e811545be2b2edbdf4 (patch)
treeb9ab4ee658524d6dac4cc6ed97032fa0940f0087 /compiler/nimconf.nim
parentdc85c2498b2d555125510fe91905cd1beffb6d10 (diff)
parent2b9d7068cbb38fd9281dde00936eac6d48fe91b1 (diff)
downloadNim-31074e0015c50d8956d884e811545be2b2edbdf4.tar.gz
Merge pull request #2058 from def-/nimrod-cfgs
Rename *.nimrod.cfg to *.nim.cfg
Diffstat (limited to 'compiler/nimconf.nim')
-rw-r--r--compiler/nimconf.nim15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim
index a433bf98e..711b476e6 100644
--- a/compiler/nimconf.nim
+++ b/compiler/nimconf.nim
@@ -14,7 +14,7 @@ import
   options, idents, wordrecg, strtabs
 
 # ---------------- configuration file parser -----------------------------
-# we use Nim's scanner here to safe space and work
+# we use Nim's scanner here to save space and work
 
 proc ppGetTok(L: var TLexer, tok: var TToken) = 
   # simple filter
@@ -158,7 +158,7 @@ proc checkSymbol(L: TLexer, tok: TToken) =
 proc parseAssignment(L: var TLexer, tok: var TToken) = 
   if tok.ident.id == getIdent("-").id or tok.ident.id == getIdent("--").id:
     confTok(L, tok)           # skip unnecessary prefix
-  var info = getLineInfo(L, tok) # safe for later in case of an error
+  var info = getLineInfo(L, tok) # save for later in case of an error
   checkSymbol(L, tok)
   var s = tokToStr(tok)
   confTok(L, tok)             # skip symbol
@@ -252,6 +252,11 @@ proc loadConfigs*(cfg: string) =
     
     if gProjectName.len != 0:
       # new project wide config file:
-      let projectConfig = changeFileExt(gProjectFull, "nim.cfg")
-      if fileExists(projectConfig): readConfigFile(projectConfig)
-      else: readConfigFile(changeFileExt(gProjectFull, "nimrod.cfg"))
+      var projectConfig = changeFileExt(gProjectFull, "nimcfg")
+      if not fileExists(projectConfig):
+        projectConfig = changeFileExt(gProjectFull, "nim.cfg")
+      if not fileExists(projectConfig):
+        projectConfig = changeFileExt(gProjectFull, "nimrod.cfg")
+        if fileExists(projectConfig):
+          rawMessage(warnDeprecated, projectConfig)
+      readConfigFile(projectConfig)