diff options
| -rw-r--r-- | nomsu.lua | 3 | ||||
| -rwxr-xr-x | nomsu.moon | 3 |
2 files changed, 4 insertions, 2 deletions
@@ -1188,6 +1188,7 @@ if arg then end end if args.flags["-i"] then + local vars = { } c:run('require "lib/core.nom"', "stdin") while true do local buff = "" @@ -1203,7 +1204,7 @@ if arg then break end local ok, ret = pcall(function() - return c:run(buff, "stdin") + return c:run(buff, "stdin", vars) end) if ok and ret ~= nil then print("= " .. repr(ret)) @@ -810,6 +810,7 @@ if arg if args.flags["-i"] -- REPL + vars = {} c\run('require "lib/core.nom"', "stdin") while true buff = "" @@ -821,7 +822,7 @@ if arg buff ..= line if #buff == 0 break - ok, ret = pcall(-> c\run(buff, "stdin")) + ok, ret = pcall(-> c\run(buff, "stdin", vars)) if ok and ret != nil print "= "..repr(ret) |
