mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
renamed comma variable
This commit is contained in:
parent
c34213d266
commit
7a0dae850d
12
inspect.lua
12
inspect.lua
@ -175,8 +175,8 @@ function Inspector:puts(...)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function Inspector:commaControl(comma)
|
function Inspector:commaControl(needsComma)
|
||||||
if comma then self:puts(',') end
|
if needsComma then self:puts(',') end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -201,21 +201,21 @@ function Inspector:putTable(t)
|
|||||||
if length >= 1 then self:tabify() end -- tabify the array values
|
if length >= 1 then self:tabify() end -- tabify the array values
|
||||||
end
|
end
|
||||||
|
|
||||||
local comma = false
|
local needsComma = false
|
||||||
for i=1, length do
|
for i=1, length do
|
||||||
comma = self:commaControl(comma)
|
needsComma = self:commaControl(needsComma)
|
||||||
self:puts(' '):putValue(t[i])
|
self:puts(' '):putValue(t[i])
|
||||||
end
|
end
|
||||||
|
|
||||||
local dictKeys = getDictionaryKeys(t)
|
local dictKeys = getDictionaryKeys(t)
|
||||||
|
|
||||||
for _,k in ipairs(dictKeys) do
|
for _,k in ipairs(dictKeys) do
|
||||||
comma = self:commaControl(comma)
|
needsComma = self:commaControl(needsComma)
|
||||||
self:tabify():putKey(k):puts(' = '):putValue(t[k])
|
self:tabify():putKey(k):puts(' = '):putValue(t[k])
|
||||||
end
|
end
|
||||||
|
|
||||||
if mt then
|
if mt then
|
||||||
comma = self:commaControl(comma)
|
needsComma = self:commaControl(needsComma)
|
||||||
self:tabify():puts('<metatable> = '):putValue(mt)
|
self:tabify():puts('<metatable> = '):putValue(mt)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user