local a={}function a.string(a)return'"'..a:gsub("[%z\1-\31\34\92\127-\159]",function(a)local a=a:byte()if a==7 then return"\\a"end;if a==8 then return"\\b"end;if a==9 then return"\\t"end;if a==10 then return"\\n"end;if a==11 then return"\\v"end;if a==12 then return"\\f"end;if a==13 then return"\\r"end;if a==34 then return"\\\""end;if a==92 then return"\\\\"end;return string.format("\\x%02x",a)end)..'"'end;function a.table(b,c,d)d=table.copy(d or{})table.insert(d,b)local e=0;local f=true;local g=""local h=true;for b,i in pairs(b)do if not h then g=g..",\n"end;h=false;g=g.." "if type(b)=="string"then if b:match("^[%a_][%w_]*$")then g=g..b.."="else g=g..'['..a.string(b)..']='end else g=g.."["..tostring(b).."]="end;if type(b)~="number"then f=false end;local a,b=pcall(function()local b=""if type(i)=="table"then if#d>4 or table.find(d,i)then b="..."else b=a.table(i,c,d)end elseif type(i)=="string"then local c={}for a in(i.."\n"):gmatch("([^\n]*)\n")do table.insert(c,a)end;if#c[#c]==0 then c[#c]=nil;c[#c]=c[#c].."\n"end;for b=1,#c do if b<#c then c[b]=a.string(c[b].."\n")else c[b]=a.string(c[b])end end;b=table.concat(c," ..\n ")else b=tostring(i)end;local a={}for b in(b.."\n"):gmatch("([^\n]*)\n")do table.insert(a,b)end;g=g..table.concat(a,"\n ")a=nil;e=e+1 end)if not a then if c then g=g.."\x1b[91m"end;g=g.."["..tostring(b).."]"if c then g=g.."\x1b[39m"end end;coroutine.yield()end;local h=getmetatable(b)local i={}if type(h)=="table"then for a,b in pairs(h)do f=false;table.insert(i,a)end end;if#i>0 then g=g.."\n "if c then g=g.."\x1b[92m"end;if table.find(i,"__tostring")then g=g.."tostring: "..a.string(tostring(b)).."\n "table.remove(i,table.find(i,"__tostring"))end;g=g..table.concat(i,", ")if c then g=g.."\x1b[39m"end end;if e==0 then return"{}"end;if f then local e={}for b,b in pairs(b)do if#e>=5 and#d>1 then table.insert(e,"...")break end;if type(b)=="table"then table.insert(e,a.table(b,c,d))elseif type(b)=="string"then table.insert(e,a.string(b))else table.insert(e,tostring(b))end end;return"{"..table.concat(e,", ").."}"end;return"{\n"..g.."\n}"end;return a