Renamed lookupPaths to moduleLookupPaths

This commit is contained in:
Mattia Giambirtone 2022-11-03 11:01:28 +01:00
parent 55a112a1ab
commit 5e1c16bb39
3 changed files with 3 additions and 3 deletions

View File

@ -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 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)
const lookupPaths*: seq[string] = @["", "src/peon/stdlib"]
const moduleLookupPaths*: seq[string] = @["", "src/peon/stdlib"]
when HeapGrowFactor <= 1:
{.fatal: "Heap growth factor must be > 1".}
const PeonVersion* = (major: 0, minor: 1, patch: 0)

View File

@ -2284,7 +2284,7 @@ proc compileModule(self: Compiler, moduleName: string) =
## Compiles an imported module into an existing chunk
## using the compiler's internal parser and lexer objects
var path = ""
for i, searchPath in lookupPaths:
for i, searchPath in moduleLookupPaths:
path = joinPath(getCurrentDir(), joinPath(searchPath, moduleName))
if fileExists(path):
break

View File

@ -731,7 +731,7 @@ proc importStmt(self: Parser, fromStmt: bool = false): Statement =
var lexer = newLexer()
lexer.fillSymbolTable()
var path = ""
for i, searchPath in lookupPaths:
for i, searchPath in moduleLookupPaths:
path = joinPath(getCurrentDir(), joinPath(searchPath, moduleName))
if fileExists(path):
break