Renamed lookupPaths to moduleLookupPaths
This commit is contained in:
parent
55a112a1ab
commit
5e1c16bb39
|
@ -29,7 +29,7 @@ const HeapGrowFactor* = 2 # The growth factor used by the G
|
||||||
const FirstGC* = 1024 * 1024; # How many bytes to allocate before running the first GC
|
const FirstGC* = 1024 * 1024; # How many bytes to allocate before running the first GC
|
||||||
const enableVMChecks* {.booldefine.} = true; # Enables all types of compiler (nim-wise) checks in the VM
|
const enableVMChecks* {.booldefine.} = true; # Enables all types of compiler (nim-wise) checks in the VM
|
||||||
# List of paths where peon looks for modules, in order (empty path means current directory, which always takes precedence)
|
# List of paths where peon looks for modules, in order (empty path means current directory, which always takes precedence)
|
||||||
const lookupPaths*: seq[string] = @["", "src/peon/stdlib"]
|
const moduleLookupPaths*: seq[string] = @["", "src/peon/stdlib"]
|
||||||
when HeapGrowFactor <= 1:
|
when HeapGrowFactor <= 1:
|
||||||
{.fatal: "Heap growth factor must be > 1".}
|
{.fatal: "Heap growth factor must be > 1".}
|
||||||
const PeonVersion* = (major: 0, minor: 1, patch: 0)
|
const PeonVersion* = (major: 0, minor: 1, patch: 0)
|
||||||
|
|
|
@ -2284,7 +2284,7 @@ proc compileModule(self: Compiler, moduleName: string) =
|
||||||
## Compiles an imported module into an existing chunk
|
## Compiles an imported module into an existing chunk
|
||||||
## using the compiler's internal parser and lexer objects
|
## using the compiler's internal parser and lexer objects
|
||||||
var path = ""
|
var path = ""
|
||||||
for i, searchPath in lookupPaths:
|
for i, searchPath in moduleLookupPaths:
|
||||||
path = joinPath(getCurrentDir(), joinPath(searchPath, moduleName))
|
path = joinPath(getCurrentDir(), joinPath(searchPath, moduleName))
|
||||||
if fileExists(path):
|
if fileExists(path):
|
||||||
break
|
break
|
||||||
|
|
|
@ -731,7 +731,7 @@ proc importStmt(self: Parser, fromStmt: bool = false): Statement =
|
||||||
var lexer = newLexer()
|
var lexer = newLexer()
|
||||||
lexer.fillSymbolTable()
|
lexer.fillSymbolTable()
|
||||||
var path = ""
|
var path = ""
|
||||||
for i, searchPath in lookupPaths:
|
for i, searchPath in moduleLookupPaths:
|
||||||
path = joinPath(getCurrentDir(), joinPath(searchPath, moduleName))
|
path = joinPath(getCurrentDir(), joinPath(searchPath, moduleName))
|
||||||
if fileExists(path):
|
if fileExists(path):
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue