diff options
Diffstat (limited to 'tex/context/base/mkiv/node-fin.lua')
-rw-r--r-- | tex/context/base/mkiv/node-fin.lua | 189 |
1 files changed, 95 insertions, 94 deletions
diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua index a848cef69..a67ec5905 100644 --- a/tex/context/base/mkiv/node-fin.lua +++ b/tex/context/base/mkiv/node-fin.lua @@ -375,6 +375,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes else check = has_dimensions(stack) end + else end if check then local c = getattr(stack,attribute) @@ -637,97 +638,97 @@ end) -- -- -- -do - - local cleaners = { } - local trace = true -- false - - function attributes.cleanup() - if next(cleaners) then - local values = setmetatableindex("table") - - if trace then - starttiming(values) - end - - local function check(l) - for n, id in nextnode, l do - if id == hlist_code or id == vlist_code or id == glue_code then - local l = getlist(n) - if l then - check(l) - end - end - for a in next, cleaners do - local v = getattr(n,a) - if v then - -- values[a] = values[a] + 1 - values[a][v] = true - end - end - end - end - - local top = texgetnest("ptr") - for i=1,top do - local l = texgetnest(i) - if l then - check(tonut(l.head)) - end - end - - do local l - l = tonut(texlists.page_ins_head) if l then check(l) end - l = tonut(texlists.contrib_head) if l then check(l) end - l = tonut(texlists.page_discards_head) if l then check(l) end - l = tonut(texlists.split_discards_head) if l then check(l) end - l = tonut(texlists.page_head) if l then check(l) end - end - - -- todo: traverseboxes - - for i=0,65535 do - local b = getbox(i) - if b then - local l = getlist(b) - if l then - check(l) - end - end - end - - for a, t in next, values do - cleaners[a](a,t) - end - - if trace then - stoptiming(values) - local a = table.sortedkeys(values) - local t = statistics.elapsedtime(values) - local r = tex.getcount("realpageno") - if #a == 0 then - logs.report("attributes","cleaning up at page %i took %s seconds, no attributes",r,t) - else - logs.report("attributes","cleaning up at page %i took %s seconds, attributes: % t",r,t,a) - end - end - end - end - - -- not yet used but when we do ... delay a call till we enable it (attr-ini.mkiv) - - -- local function show(a,t) for k, v in next, t do print(a,k) end end - -- - -- attributes.registercleaner( 1, show) - -- attributes.registercleaner( 2, show) - - function attributes.registercleaner(a,f) - cleaners[a] = f - end - - implement { - name = "cleanupattributes", - actions = attributes.cleanup, - } - -end +-- do +-- +-- local cleaners = { } +-- local trace = true -- false +-- +-- function attributes.cleanup() +-- if next(cleaners) then +-- local values = setmetatableindex("table") +-- +-- if trace then +-- starttiming(values) +-- end +-- +-- local function check(l) +-- for n, id in nextnode, l do +-- if id == hlist_code or id == vlist_code or id == glue_code then +-- local l = getlist(n) +-- if l then +-- check(l) +-- end +-- end +-- for a in next, cleaners do +-- local v = getattr(n,a) +-- if v then +-- -- values[a] = values[a] + 1 +-- values[a][v] = true +-- end +-- end +-- end +-- end +-- +-- local top = texgetnest("ptr") +-- for i=1,top do +-- local l = texgetnest(i) +-- if l then +-- check(tonut(l.head)) +-- end +-- end +-- +-- do local l +-- l = tonut(texlists.page_ins_head) if l then check(l) end +-- l = tonut(texlists.contrib_head) if l then check(l) end +-- l = tonut(texlists.page_discards_head) if l then check(l) end +-- l = tonut(texlists.split_discards_head) if l then check(l) end +-- l = tonut(texlists.page_head) if l then check(l) end +-- end +-- +-- -- todo: traverseboxes +-- +-- for i=0,65535 do +-- local b = getbox(i) +-- if b then +-- local l = getlist(b) +-- if l then +-- check(l) +-- end +-- end +-- end +-- +-- for a, t in next, values do +-- cleaners[a](a,t) +-- end +-- +-- if trace then +-- stoptiming(values) +-- local a = table.sortedkeys(values) +-- local t = statistics.elapsedtime(values) +-- local r = tex.getcount("realpageno") +-- if #a == 0 then +-- logs.report("attributes","cleaning up at page %i took %s seconds, no attributes",r,t) +-- else +-- logs.report("attributes","cleaning up at page %i took %s seconds, attributes: % t",r,t,a) +-- end +-- end +-- end +-- end +-- +-- -- not yet used but when we do ... delay a call till we enable it (attr-ini.mkiv) +-- +-- -- local function show(a,t) for k, v in next, t do print(a,k) end end +-- -- +-- -- attributes.registercleaner(1, show) +-- -- attributes.registercleaner(2, show) +-- +-- function attributes.registercleaner(a,f) +-- cleaners[a] = f +-- end +-- +-- implement { +-- name = "cleanupattributes", +-- actions = attributes.cleanup, +-- } +-- +-- end |