summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/node-fin.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-fin.lua99
1 files changed, 2 insertions, 97 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua b/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
index a848cef69da..373cce3ce60 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-fin'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-fin.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -375,6 +376,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)
@@ -634,100 +636,3 @@ end
statistics.register("attribute processing time", function()
return statistics.elapsedseconds(attributes,"front- and backend")
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