diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-24 15:08:44 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-24 15:09:55 -0700 |
| commit | b6c99c56a1f49a9230b65200a5a016173038857c (patch) | |
| tree | bfe893f8c746fc0ab6f8a84e93eb42bf762b3b63 /nomsu_compiler.moon | |
| parent | 3cf97066be82a3a3405246b7c915bac8773e6004 (diff) | |
Updated package.nomsupath behavior to first search the installed
locations, *then* search the current directory. This makes the system `nomsu` run
properly, even if the local directory has a broken file that has the
same name as a nomsu file.
Diffstat (limited to 'nomsu_compiler.moon')
| -rw-r--r-- | nomsu_compiler.moon | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon index ee5eca4..82d0e14 100644 --- a/nomsu_compiler.moon +++ b/nomsu_compiler.moon @@ -95,7 +95,7 @@ dict = (t)-> setmetatable(t, _dict_mt) MAX_LINE = 80 -- For beautification purposes, try not to make lines much longer than this value NomsuCompiler = setmetatable({}, {__index: (k)=> if _self = rawget(@, "self") then _self[k] else nil}) with NomsuCompiler - .NOMSU_COMPILER_VERSION = 4 + .NOMSU_COMPILER_VERSION = 5 .NOMSU_SYNTAX_VERSION = Parser.version ._ENV = NomsuCompiler .nomsu = NomsuCompiler @@ -260,6 +260,7 @@ with NomsuCompiler _running_files = {} -- For detecting circular imports .run_file = (filename)=> + -- Filename should be an absolute path, i.e. package.nomsupath will not be searched for it if @LOADED[filename] return @LOADED[filename] -- Check for circular import @@ -284,7 +285,7 @@ with NomsuCompiler unless ran_lua file = Files.read(filename) if not file - error("File does not exist: #{filename}", 0) + error("Tried to run file that does not exist: #{filename}") ret = @run file, Source(filename,1,#file) else error("Invalid filetype for #{filename}", 0) |
