Added support for "=" input prefix to mimic Lua REPL

This commit is contained in:
rxi 2015-08-30 20:01:32 +01:00
parent df58a85248
commit 07e97d5627

View File

@ -37,6 +37,9 @@ if req.parsedbody.input then
if lovebird.echoinput then
lovebird.pushline({ type = 'input', str = str })
end
if str:find("^=") then
str = "print(" .. str:sub(2) .. ")"
end
xpcall(function() assert(lovebird.loadstring(str, "input"))() end,
lovebird.onerror)
end