Skip to content

Commit

Permalink
Requested Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobDev committed Sep 11, 2017
1 parent 5588ee7 commit de757fe
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/main/resources/assets/computercraft/lua/rom/programs/lua.lua
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,15 +19,25 @@ local tEnv = {
setmetatable( tEnv, { __index = _ENV } ) setmetatable( tEnv, { __index = _ENV } )


local function displayTable( tDisplay ) local function displayTable( tDisplay )
local tSeen = {}
local sShow = "{\n" local sShow = "{\n"
for k, v in pairs( tDisplay ) do for k, v in ipairs( tDisplay ) do
sShow = sShow .. " " sShow = sShow .. " "
if type( v ) == "number" or type( v ) == "boolean" then if type( v ) == "string" then
sShow = sShow .. k .. " = " .. tostring( v ) .. ",\n" sShow = sShow .. '"' .. v .. '",\n'
elseif type( v ) == "string" then
sShow = sShow ..k .. ' = "' .. v .. '",\n'
else else
sShow = sShow .. k .. " = ".. type( v ) .. ",\n" sShow = sShow .. tostring( v ) .. ",\n"
end
tSeen[k] = true
end
for k, v in pairs( tDisplay ) do
if not tSeen[k] then
sShow = sShow .. " "
if type( v ) == "string" then
sShow = sShow ..k .. ' = "' .. v .. '",\n'
else
sShow = sShow .. k .. " = ".. tostring( v ) .. ",\n"
end
end end
end end
sShow = sShow .. "}" sShow = sShow .. "}"
Expand Down

0 comments on commit de757fe

Please sign in to comment.