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.moon | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'nomsu.moon') 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 -- cgit v1.2.3