aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nomsu.lua17
-rwxr-xr-xnomsu.moon14
2 files changed, 31 insertions, 0 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 9fcf8ad..3d54915 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -856,5 +856,22 @@ if arg and arg[1] then
load()(c, {})
]])
end
+elseif arg then
+ local c = NomsuCompiler()
+ while true do
+ local buff = ""
+ while true do
+ io.write(">> ")
+ local line = io.read("*L")
+ if line == "\n" or not line then
+ break
+ end
+ buff = buff .. line
+ end
+ if #buff == 0 then
+ break
+ end
+ c:run(buff)
+ end
end
return NomsuCompiler
diff --git a/nomsu.moon b/nomsu.moon
index 88ec471..2095a75 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -603,5 +603,19 @@ if arg and arg[1]
local c = NomsuCompiler()
load()(c, {})
]]
+elseif arg
+ -- REPL:
+ c = NomsuCompiler()
+ while true
+ buff = ""
+ while true
+ io.write(">> ")
+ line = io.read("*L")
+ if line == "\n" or not line
+ break
+ buff ..= line
+ if #buff == 0
+ break
+ c\run(buff)
return NomsuCompiler