mirror of
https://github.com/TangentFoxy/lovebird.git
synced 2025-07-28 11:02:19 +00:00
Added support for "=" input prefix to mimic Lua REPL
This commit is contained in:
@@ -37,6 +37,9 @@ if req.parsedbody.input then
|
|||||||
if lovebird.echoinput then
|
if lovebird.echoinput then
|
||||||
lovebird.pushline({ type = 'input', str = str })
|
lovebird.pushline({ type = 'input', str = str })
|
||||||
end
|
end
|
||||||
|
if str:find("^=") then
|
||||||
|
str = "print(" .. str:sub(2) .. ")"
|
||||||
|
end
|
||||||
xpcall(function() assert(lovebird.loadstring(str, "input"))() end,
|
xpcall(function() assert(lovebird.loadstring(str, "input"))() end,
|
||||||
lovebird.onerror)
|
lovebird.onerror)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user