diff --git a/inspect.lua b/inspect.lua index 1040061..6137e3f 100644 --- a/inspect.lua +++ b/inspect.lua @@ -140,19 +140,13 @@ end function inspect.dump(rootObject, depth) 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 function down(f) - level = level + 1 - f() - level = level - 1 - end + local buffer = {} + local maxIds = setmetatable({}, maxIdsMetaTable) + local ids = setmetatable({}, idsMetaTable) + local level = 0 + local blen = 0 -- buffer length local function puts(...) local args = {...} @@ -162,6 +156,12 @@ function inspect.dump(rootObject, depth) end end + local function down(f) + level = level + 1 + f() + level = level - 1 + end + local function tabify() puts("\n", string.rep(" ", level)) end