mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
reordering of code in inspect.lua
This commit is contained in:
parent
0de3c69e5d
commit
e898803196
22
inspect.lua
22
inspect.lua
@ -140,19 +140,13 @@ end
|
|||||||
function inspect.dump(rootObject, depth)
|
function inspect.dump(rootObject, depth)
|
||||||
depth = depth or math.huge
|
depth = depth or math.huge
|
||||||
|
|
||||||
local buffer = {}
|
|
||||||
local blen = 0 -- buffer length
|
|
||||||
local level = 0
|
|
||||||
local maxIds = setmetatable({}, maxIdsMetaTable)
|
|
||||||
local ids = setmetatable({}, idsMetaTable)
|
|
||||||
|
|
||||||
local tableAppearances = countTableAppearances(rootObject)
|
local tableAppearances = countTableAppearances(rootObject)
|
||||||
|
|
||||||
local function down(f)
|
local buffer = {}
|
||||||
level = level + 1
|
local maxIds = setmetatable({}, maxIdsMetaTable)
|
||||||
f()
|
local ids = setmetatable({}, idsMetaTable)
|
||||||
level = level - 1
|
local level = 0
|
||||||
end
|
local blen = 0 -- buffer length
|
||||||
|
|
||||||
local function puts(...)
|
local function puts(...)
|
||||||
local args = {...}
|
local args = {...}
|
||||||
@ -162,6 +156,12 @@ function inspect.dump(rootObject, depth)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function down(f)
|
||||||
|
level = level + 1
|
||||||
|
f()
|
||||||
|
level = level - 1
|
||||||
|
end
|
||||||
|
|
||||||
local function tabify()
|
local function tabify()
|
||||||
puts("\n", string.rep(" ", level))
|
puts("\n", string.rep(" ", level))
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user