Nimscript: added support for 'patchFile'

This commit is contained in:
Andreas Rumpf
2016-07-09 14:26:00 +02:00
parent 66f37971e9
commit 5e82ffc8d5
7 changed files with 52 additions and 3 deletions

View File

@@ -13,7 +13,7 @@
import
ast, modules, passes, passaux, condsyms,
options, nimconf, lists, sem, semdata, llstream, vm, vmdef, commands, msgs,
os, times, osproc, wordrecg
os, times, osproc, wordrecg, strtabs
# we support 'cmpIgnoreStyle' natively for efficiency:
from strutils import cmpIgnoreStyle
@@ -122,6 +122,12 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext =
cbconf warningImpl:
processSpecificNote(a.getString 0, wWarning, passPP, unknownLineInfo(),
a.getString 1)
cbconf patchFile:
let key = a.getString(0) & "_" & a.getString(1)
var val = a.getString(2).addFileExt(NimExt)
if not isAbsolute(val):
val = vthisDir / val
gModuleOverrides[key] = val
proc runNimScript*(scriptName: string; freshDefines=true) =
passes.gIncludeFile = includeModule