mirror of
https://github.com/pkulchenko/serpent.git
synced 2024-11-21 23:24:24 +00:00
Updated pairs
to avoid using __pairs
in Lua 5.2+.
Ref pkulchenko/MobDebug#27, pkulchenko/MobDebug#29.
This commit is contained in:
parent
679a5a3bca
commit
10be108506
@ -1,8 +1,9 @@
|
||||
local n, v = "serpent", "0.29" -- (C) 2012-17 Paul Kulchenko; MIT License
|
||||
local n, v = "serpent", "0.291" -- (C) 2012-17 Paul Kulchenko; MIT License
|
||||
local c, d = "Paul Kulchenko", "Lua serializer and pretty printer"
|
||||
local snum = {[tostring(1/0)]='1/0 --[[math.huge]]',[tostring(-1/0)]='-1/0 --[[-math.huge]]',[tostring(0/0)]='0/0'}
|
||||
local badtype = {thread = true, userdata = true, cdata = true}
|
||||
local getmetatable = debug and debug.getmetatable or getmetatable
|
||||
local pairs = function(t) return next, t end -- avoid using __pairs in Lua 5.2+
|
||||
local keyword, globals, G = {}, {}, (_G or _ENV)
|
||||
for _,k in ipairs({'and', 'break', 'do', 'else', 'elseif', 'end', 'false',
|
||||
'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat',
|
||||
|
Loading…
Reference in New Issue
Block a user