aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-14 15:35:06 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-14 15:35:06 -0700
commitf8f5e7b6535264e7142bf94692fcb6e2ef007fbc (patch)
treeef40c71a8249a74cec2f603b17b553db4640ec0f /nomsu.moon
parentbce6cd2e216b01d28d041f47d927ea0819c27533 (diff)
Added REPL.
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon14
1 files changed, 14 insertions, 0 deletions
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