Files
Halyde/halyde/apps/lua.lua
T
2026-04-30 15:09:56 +00:00

1 line
683 B
Lua

print("\27[44m".._VERSION.."\27[0m shell")print('Type "exit" to exit.')termlib.readHistory["lua"]={""}local a=import("filesystem")local b=""local a=a.list("halyde/lib")for a,a in pairs(a)do if a:match("(.+)%.lua")then b=b.."local "..a:match("(.+)%.lua")..' = import("'..a:match("(.+)%.lua")..'")\n'end end;while true do local a=read("lua","\27[44mlua>\27[0m ")if a=="exit"then return else local function c()local a=load(b.."return "..a,"=stdin")or load(b..a,"=stdin")local a={assert(a)()}if a and(type(a[1])~="nil"or type(a[2])~="nil")then print(table.unpack(a))end end;local a,b=xpcall(c,function(a)return a.."\n\n"..debug.traceback()end)if not a then print("\27[91m"..b)end end end