From 5e1c16bb39cbd3f32137dbfd341530c1994b5b90 Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Thu, 3 Nov 2022 11:01:28 +0100 Subject: [PATCH] Renamed lookupPaths to moduleLookupPaths --- src/config.nim | 2 +- src/frontend/compiler.nim | 2 +- src/frontend/parser.nim | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.nim b/src/config.nim index 8da4169..22deca9 100644 --- a/src/config.nim +++ b/src/config.nim @@ -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) diff --git a/src/frontend/compiler.nim b/src/frontend/compiler.nim index 8c109ab..3b92371 100644 --- a/src/frontend/compiler.nim +++ b/src/frontend/compiler.nim @@ -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 diff --git a/src/frontend/parser.nim b/src/frontend/parser.nim index 5f01dae..66bf41c 100644 --- a/src/frontend/parser.nim +++ b/src/frontend/parser.nim @@ -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