Improve dumpTable function
This commit is contained in:
parent
d34c5204df
commit
9bd53b7e75
@ -11,9 +11,14 @@ TEXTURE_HEIGHT = 128
|
|||||||
function dumpTable(o)
|
function dumpTable(o)
|
||||||
if type(o) == 'table' then
|
if type(o) == 'table' then
|
||||||
local s = '{ '
|
local s = '{ '
|
||||||
|
local first_loop=true
|
||||||
for k,v in pairs(o) do
|
for k,v in pairs(o) do
|
||||||
|
if not first_loop then
|
||||||
|
s = s .. ', '
|
||||||
|
end
|
||||||
|
first_loop=false
|
||||||
if type(k) ~= 'number' then k = '"'..k..'"' end
|
if type(k) ~= 'number' then k = '"'..k..'"' end
|
||||||
s = s .. '['..k..'] = ' .. dumpTable(v) .. ','
|
s = s .. '['..k..'] = ' .. dumpTable(v)
|
||||||
end
|
end
|
||||||
return s .. '} '
|
return s .. '} '
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user