aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nomsu.lua4
-rwxr-xr-xnomsu.moon4
2 files changed, 4 insertions, 4 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 200b45a..bc7ec80 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -805,7 +805,7 @@ do
end
Compiler = _class_0
end
-if arg[1] then
+if arg and arg[1] then
local c = Compiler()
local input = io.open(arg[1]):read("*a")
local _print = print
@@ -831,7 +831,7 @@ if arg[1] then
end
local utils = require('utils')
local Compiler = require('nomsu')
- local c = Compiler(require('core'))
+ local c = Compiler()
load()(c, {})
]])
end
diff --git a/nomsu.moon b/nomsu.moon
index 243dd64..1c87a8e 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -532,7 +532,7 @@ class Compiler
-- Run on the command line via "./nomsu.moon input_file.nom" to execute
-- and "./nomsu.moon input_file.nom output_file.lua" to compile (use "-" to compile to stdout)
-if arg[1]
+if arg and arg[1]
c = Compiler()
input = io.open(arg[1])\read("*a")
-- Kinda hacky, if run via "./nomsu.moon file.nom -", then silence print and io.write
@@ -560,7 +560,7 @@ if arg[1]
end
local utils = require('utils')
local Compiler = require('nomsu')
- local c = Compiler(require('core'))
+ local c = Compiler()
load()(c, {})
]]