diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-14 15:35:06 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-14 15:35:06 -0700 |
| commit | f8f5e7b6535264e7142bf94692fcb6e2ef007fbc (patch) | |
| tree | ef40c71a8249a74cec2f603b17b553db4640ec0f | |
| parent | bce6cd2e216b01d28d041f47d927ea0819c27533 (diff) | |
Added REPL.
| -rw-r--r-- | nomsu.lua | 17 | ||||
| -rwxr-xr-x | nomsu.moon | 14 |
2 files changed, 31 insertions, 0 deletions
@@ -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 @@ -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 |
