The .nimble extension is now used for both ini and nims .nimble files.

This is done by parsing the .nimble file using the ini parser first, then if that fails evaluating it using nimscript.
This commit is contained in:
Dominik Picheta 2015-12-23 20:48:05 +00:00
commit dbd478bc20
4 changed files with 61 additions and 20 deletions

View file

@ -93,6 +93,16 @@ proc readPackageInfoFromNims*(scriptName: string; result: var PackageInfo) =
## Executes the `scriptName` nimscript file. Reads the package information
## that it populates.
# Setup custom error handling.
msgs.gErrorMax = high(int)
var previousMsg = ""
msgs.writeLnHook =
proc (output: string) =
# The error counter is incremented after the writeLnHook is invoked.
if msgs.gErrorCounter > 0:
raise newException(NimbleError, previousMsg)
previousMsg = output
# Execute the nimscript file.
execScript(scriptName)