diff options
Diffstat (limited to 'Sluift/core.lua')
-rw-r--r-- | Sluift/core.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Sluift/core.lua b/Sluift/core.lua index daa8636..f35a603 100644 --- a/Sluift/core.lua +++ b/Sluift/core.lua @@ -1,39 +1,40 @@ --[[ Copyright (c) 2013-2017 Isode Limited. All rights reserved. See the COPYING file for more information. --]] local sluift = select(1, ...) local _G = _G -local pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, unpack, io = pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, unpack, io +local pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, io = pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, io +local unpack = table.unpack or unpack local setmetatable, getmetatable = setmetatable, getmetatable local string = require "string" local table = require "table" local debug = require "debug" _ENV = nil -------------------------------------------------------------------------------- -- Table utility methods -------------------------------------------------------------------------------- local function table_value_tostring(value) local result = tostring(value) if type(value) == 'number' then return result elseif type(value) == 'boolean' then return result elseif type(value) == 'string' then return "'" .. result .. "'" else return '<' .. result .. '>' end end local function table_tostring(table, print_functions, indent, accumulator, history) local INDENT = ' ' local accumulator = accumulator or '' local history = history or {} local indent = indent or '' accumulator = accumulator .. '{' history[table] = true local is_first = true for key, value in pairs(table) do if print_functions or type(value) ~= 'function' then if not is_first then |