diff options
Diffstat (limited to 'ClientHamr/GuiLua')
-rw-r--r-- | ClientHamr/GuiLua/skang.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua index 3848093..3baad4f 100644 --- a/ClientHamr/GuiLua/skang.lua +++ b/ClientHamr/GuiLua/skang.lua | |||
@@ -162,6 +162,37 @@ local _M = moduleBegin('skang', 'David Seikel', 'Copyright 2014 David Seikel', ' | |||
162 | print('Skang is running under Lua version ' .. _VERSION) | 162 | print('Skang is running under Lua version ' .. _VERSION) |
163 | 163 | ||
164 | 164 | ||
165 | |||
166 | function printTableStart(table, space, name) | ||
167 | print(space .. name .. ": ") | ||
168 | print(space .. "{") | ||
169 | printTable(table, space .. " ") | ||
170 | print(space .. "}") | ||
171 | end | ||
172 | |||
173 | function printTable(table, space) | ||
174 | for k, v in pairs(table) do | ||
175 | if type(v) == "table" then | ||
176 | printTableStart(v, space, k) | ||
177 | elseif type(v) == "string" then | ||
178 | print(space .. k .. ': "' .. v .. '";') | ||
179 | elseif type(v) == "function" then | ||
180 | print(space .. "function " .. k .. "();") | ||
181 | elseif type(v) == "userdata" then | ||
182 | print(space .. "userdata " .. k .. ";") | ||
183 | elseif type(v) == "boolean" then | ||
184 | if (v) then | ||
185 | print(space .. "boolean " .. k .. " TRUE ;") | ||
186 | else | ||
187 | print(space .. "boolean " .. k .. " FALSE ;") | ||
188 | end | ||
189 | else | ||
190 | print(space .. k .. ": " .. v .. ";") | ||
191 | end | ||
192 | end | ||
193 | end | ||
194 | |||
195 | |||
165 | csv2table = function (csv) | 196 | csv2table = function (csv) |
166 | local result = {} | 197 | local result = {} |
167 | local i = 1 | 198 | local i = 1 |