summaryrefslogtreecommitdiff
path: root/tex/context/base/node-ser.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-06-11 18:00:15 +0300
committerMarius <mariausol@gmail.com>2011-06-11 18:00:15 +0300
commit510cb140d2e8baed13b8b27daa02f3ad2f5df3e1 (patch)
tree180c914c5c27bcd130cd13098b426b03abd1a508 /tex/context/base/node-ser.lua
parent247a7c0fccc1f980a837daf19e0ef2be6102a18f (diff)
downloadcontext-510cb140d2e8baed13b8b27daa02f3ad2f5df3e1.tar.gz
beta 2011.06.11 16:45
Diffstat (limited to 'tex/context/base/node-ser.lua')
-rw-r--r--tex/context/base/node-ser.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/tex/context/base/node-ser.lua b/tex/context/base/node-ser.lua
index aa4615626..a460a0953 100644
--- a/tex/context/base/node-ser.lua
+++ b/tex/context/base/node-ser.lua
@@ -9,7 +9,8 @@ if not modules then modules = { } end modules ['node-ser'] = {
-- beware, some field names will change in a next releases
-- of luatex; this is pretty old code that needs an overhaul
-local type, format, concat, rep = type, string.format, table.concat, string.rep
+local type, format, rep = type, string.format, string.rep
+local concat, tohash, sortedkeys = table.concat, table.tohash, table.sortedkeys
local allocate = utilities.storage.allocate
@@ -23,7 +24,7 @@ local nodefields = nodes.fields
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
-local expand = allocate ( table.tohash {
+local expand = allocate ( tohash {
"list", -- list_ptr & ins_ptr & adjust_ptr
"pre", --
"post", --
@@ -43,13 +44,13 @@ local expand = allocate ( table.tohash {
-- page_insert: "height", "last_ins_ptr", "best_ins_ptr"
-- split_insert: "height", "last_ins_ptr", "best_ins_ptr", "broken_ptr", "broken_ins"
-local ignore = allocate ( table.tohash {
+local ignore = allocate ( tohash {
"page_insert",
"split_insert",
"ref_count",
} )
-local dimension = allocate ( table.tohash {
+local dimension = allocate ( tohash {
"width", "height", "depth", "shift",
"stretch", "shrink",
"xoffset", "yoffset",
@@ -178,7 +179,7 @@ local function serialize(root,name,handle,depth,m)
if root.id then
fld = nodefields(root) -- we can cache these (todo)
else
- fld = table.sortedkeys(root)
+ fld = sortedkeys(root)
end
if type(root) == 'table' and root['type'] then -- userdata or table
handle(format("%s %s=%q,",depth,'type',root['type']))