You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
894 B
Lua
41 lines
894 B
Lua
local inspect_lib = require "inspect"
|
|
|
|
function inspect(value)
|
|
return inspect_lib(value, {
|
|
process = function(item, path)
|
|
if type(item) == "function" then
|
|
return nil
|
|
end
|
|
|
|
if path[#path] == inspect_lib.METATABLE then
|
|
return nil
|
|
end
|
|
|
|
return item
|
|
end,
|
|
newline = " ",
|
|
indent = ""
|
|
})
|
|
end
|
|
|
|
function DUMP(value)
|
|
return inspect_lib(value, {
|
|
process = function(item, path)
|
|
return item
|
|
end,
|
|
newline = " ",
|
|
indent = ""
|
|
})
|
|
end
|
|
|
|
function TraceBack()
|
|
for level = 1, math.huge do
|
|
local info = debug.getinfo(level, "nSl")
|
|
if not info then break end
|
|
if info.what == "C" then -- is a C function?
|
|
DEBUG(level, "C function")
|
|
else
|
|
DEBUG(info.name,string.format("%d, [%s] : %d", level, info.short_src, info.currentline))
|
|
end
|
|
end
|
|
end |