aboutsummaryrefslogtreecommitdiff
path: root/nomsu_environment.lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-20 14:52:59 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-20 14:54:40 -0800
commit2bbc035f5dcc3ecd62724b9d1de0e7e3ea902379 (patch)
tree34a83497f7570946b6252183b3e8fe0ce2010595 /nomsu_environment.lua
parentf30413853063483147d941ffccc4b663b71bc943 (diff)
Simplifying the filesystem code (no longer entangled with nomsupath) and
using that to simplify the tools. Now the tools directly take lists of file paths rather than things that might go through nomsupath or directories or get processed by filetype. Use your shell for globbing stuff like `nomsu tools/test.nom core/*.nom`
Diffstat (limited to 'nomsu_environment.lua')
-rw-r--r--nomsu_environment.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/nomsu_environment.lua b/nomsu_environment.lua
index 7b26852..6f46640 100644
--- a/nomsu_environment.lua
+++ b/nomsu_environment.lua
@@ -296,6 +296,7 @@ local nomsu_environment = Importer({
end
_currently_running_files:add(path)
local mod = _1_forked(environment)
+ local did_anything = false
for nomsupath in package.nomsupath:gmatch("[^;]+") do
local _continue_0 = false
repeat
@@ -323,6 +324,7 @@ local nomsu_environment = Importer({
code = NomsuCode:from(Source(filename, 1, #file), file)
end
environment.run_1_in(code, mod)
+ did_anything = true
_continue_1 = true
until true
if not _continue_1 then
@@ -337,6 +339,9 @@ local nomsu_environment = Importer({
break
end
end
+ if not (did_anything) then
+ error("File not found: " .. tostring(path), 0)
+ end
import_to_1_from(environment, mod, prefix)
environment.FILE_CACHE[path] = mod
return _currently_running_files:remove()