Added support for cdata type in LuaJIT (thanks to [Evan](https://github.com/neomantra)).

This commit is contained in:
Paul Kulchenko 2013-03-24 15:23:31 -07:00
parent a716bd877d
commit 0c1483c799
4 changed files with 61 additions and 2 deletions

View File

@ -159,6 +159,15 @@ See LICENSE file.
## History
### v0.23 (Mar 24 2013)
- Added support for `cdata` type in LuaJIT (thanks to [Evan](https://github.com/neomantra)).
- Added comment to indicate incomplete output.
- Added support for metatables with __serialize method.
- Added handling of metatables with __tostring method.
- Fixed an issue with having too many locals in self-reference section.
- Fixed emitting premature circular reference in self-reference section, which caused invalid serialization.
- Modified the sort function signature to also pass the original table, so not only keys are available when sorting, but also the values in the original table.
### v0.22 (Jan 15 2013)
- Added ability to process __tostring results that may be non-string values.

View File

@ -0,0 +1,25 @@
package = "serpent"
version = "0.22-1"
source = {
url = "git://github.com/pkulchenko/serpent.git",
tag = "0.22"
}
description = {
summary = "Lua serializer and pretty printer",
homepage = "https://github.com/pkulchenko/serpent",
maintainer = "Paul Kulchenko <paul@kulchenko.com>",
license = "MIT",
}
dependencies = {
"lua >= 5.1",
}
build = {
type = "builtin",
modules = {
["serpent"] = "src/serpent.lua",
},
copy_directories = { "t" },
}

View File

@ -0,0 +1,25 @@
package = "serpent"
version = "0.23-1"
source = {
url = "git://github.com/pkulchenko/serpent.git",
tag = "0.23"
}
description = {
summary = "Lua serializer and pretty printer",
homepage = "https://github.com/pkulchenko/serpent",
maintainer = "Paul Kulchenko <paul@kulchenko.com>",
license = "MIT",
}
dependencies = {
"lua >= 5.1",
}
build = {
type = "builtin",
modules = {
["serpent"] = "src/serpent.lua",
},
copy_directories = { "t" },
}

View File

@ -1,7 +1,7 @@
local n, v = "serpent", 0.225 -- (C) 2012-13 Paul Kulchenko; MIT License
local n, v = "serpent", 0.23 -- (C) 2012-13 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}
local badtype = {thread = true, userdata = true, cdata = true}
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',