nimfix supports specialized '.nimfix' modules
This commit is contained in:
parent
7333237be6
commit
c53a27f0dc
4 changed files with 31 additions and 18 deletions
|
|
@ -337,6 +337,16 @@ proc findFile*(f: string): string {.procvar.} =
|
|||
|
||||
proc findModule*(modulename, currentModule: string): string =
|
||||
# returns path to module
|
||||
when defined(nimfix):
|
||||
# '.nimfix' modules are preferred over '.nim' modules so that specialized
|
||||
# versions can be kept for 'nimfix'.
|
||||
block:
|
||||
let m = addFileExt(modulename, "nimfix")
|
||||
let currentPath = currentModule.splitFile.dir
|
||||
result = currentPath / m
|
||||
if not existsFile(result):
|
||||
result = findFile(m)
|
||||
if existsFile(result): return result
|
||||
let m = addFileExt(modulename, NimExt)
|
||||
let currentPath = currentModule.splitFile.dir
|
||||
result = currentPath / m
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue