From f8f5e7b6535264e7142bf94692fcb6e2ef007fbc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Sep 2017 15:35:06 -0700 Subject: Added REPL. --- nomsu.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'nomsu.lua') 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 -- cgit v1.2.3