mirror of
https://github.com/pkulchenko/serpent.git
synced 2024-11-21 23:24:24 +00:00
Added using debug.metatable
when available.
This commit is contained in:
parent
664b6eebea
commit
dca4b8c1d8
@ -1,7 +1,8 @@
|
|||||||
local n, v = "serpent", 0.281 -- (C) 2012-15 Paul Kulchenko; MIT License
|
local n, v = "serpent", 0.282 -- (C) 2012-15 Paul Kulchenko; MIT License
|
||||||
local c, d = "Paul Kulchenko", "Lua serializer and pretty printer"
|
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 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 badtype = {thread = true, userdata = true, cdata = true}
|
||||||
|
local getmetatable = debug and debug.getmetatable or getmetatable
|
||||||
local keyword, globals, G = {}, {}, (_G or _ENV)
|
local keyword, globals, G = {}, {}, (_G or _ENV)
|
||||||
for _,k in ipairs({'and', 'break', 'do', 'else', 'elseif', 'end', 'false',
|
for _,k in ipairs({'and', 'break', 'do', 'else', 'elseif', 'end', 'false',
|
||||||
'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat',
|
'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat',
|
||||||
|
Loading…
Reference in New Issue
Block a user