diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-15 15:53:31 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-15 15:54:28 -0800 |
| commit | bf37295faeb9535c56671f4b2050260e1b88cd32 (patch) | |
| tree | d544b68bca8c5bdf0926cc20a12f925c1761cfda /nomsu.lua | |
| parent | ef70abe4b7ed8d04574ab24ea4fd74fe2a64221f (diff) | |
Updating to v6.15, which includes "external (...)" instead of separate
'externally' versions of stuff, and some auto-formatting.
Diffstat (limited to 'nomsu.lua')
| -rw-r--r-- | nomsu.lua | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -131,6 +131,7 @@ local NOMSU_PACKAGEPATH = NOMSU_PACKAGEPATH or "/opt/nomsu" add_path(NOMSU_PACKAGEPATH) add_path(".") package.nomsupath = table.concat(nomsupath, ";") +package.nomsuloaded = Dict({ }) local nomsu_environment = require('nomsu_environment') nomsu_environment.COMMAND_LINE_ARGS = nomsu_args nomsu_environment.OPTIMIZATION = optimization @@ -173,6 +174,10 @@ run = function() nomsu_environment._1_parsed(NomsuCode:from(source, code)) print("Parse succeeded: " .. tostring(filename)) elseif args.compile then + local code = Files.read(filename) + if not code then + error("Could not find file '" .. tostring(filename) .. "'") + end if filename:match("%.lua$") then error("Cannot compile a lua file (expected a nomsu file as input)") end @@ -182,7 +187,6 @@ run = function() else output = io.open(filename:gsub("%.nom$", ".lua"), "w") end - local code = Files.read(filename) local source = Source(filename, 1, #code) code = NomsuCode:from(source, code) local env = nomsu_environment.new_environment() |
