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.moon | |
| 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.moon')
| -rwxr-xr-x | nomsu.moon | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -108,6 +108,7 @@ NOMSU_PACKAGEPATH or= "/opt/nomsu" add_path NOMSU_PACKAGEPATH add_path "." package.nomsupath = table.concat(nomsupath, ";") +package.nomsuloaded = Dict{} nomsu_environment = require('nomsu_environment') nomsu_environment.COMMAND_LINE_ARGS = nomsu_args @@ -141,12 +142,14 @@ run = -> nomsu_environment._1_parsed(NomsuCode\from(source, code)) print("Parse succeeded: #{filename}") elseif args.compile + code = Files.read(filename) + if not code + error("Could not find file '#{filename}'") -- Compile .nom files into .lua if filename\match("%.lua$") error("Cannot compile a lua file (expected a nomsu file as input)") output = if filename == 'stdin' then io.output() else io.open(filename\gsub("%.nom$", ".lua"), "w") - code = Files.read(filename) source = Source(filename, 1, #code) code = NomsuCode\from(source, code) env = nomsu_environment.new_environment! |
