Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- serpent.lua.org 2012-06-13 15:04:36.894692373 +0200
- +++ serpent.lua 2012-06-13 15:04:39.126693082 +0200
- @@ -14,6 +14,7 @@
- local name, indent, fatal = opts['name'], opts['indent'], opts['fatal']
- local sparse, nocode, custom = opts['sparse'], opts['nocode'], opts['custom']
- local huge, space = not opts['nohuge'], (opts['compact'] and '' or ' ')
- + local maxlevel = opts['maxlevel']
- local seen, sref = {}, {}
- local function gensym(val) return tostring(val):gsub("[^%w]","") end
- local function safestr(s) return type(s) == "number" and (huge and snum[tostring(s)] or s)
- @@ -51,6 +52,7 @@
- "loadstring("..safestr(res)..",'@serialized')"..comment(t))
- return tag..(func or globerr(t))
- elseif ttype == "table" then
- + if level >= maxlevel then return '{}'..comment('maxlevel') end
- seen[t] = spath
- if next(t) == nil then return tag..'{}'..comment(t) end -- table empty
- local maxn, o, out = #t, {}, {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement