summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-lst.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
committerMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
commitdbbbbfac3d158709a07af8c26e68284d1b0ea202 (patch)
treeb9cb25022fc2858c0dcbc190ad466ba89c69861d /tex/context/base/strc-lst.lua
parent7c7fe9c9e18355f42d0dba1b248235252728060b (diff)
downloadcontext-dbbbbfac3d158709a07af8c26e68284d1b0ea202.tar.gz
beta 2011.04.11 16:45
Diffstat (limited to 'tex/context/base/strc-lst.lua')
-rw-r--r--tex/context/base/strc-lst.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua
index f09444f26..6a7a7d8c7 100644
--- a/tex/context/base/strc-lst.lua
+++ b/tex/context/base/strc-lst.lua
@@ -17,7 +17,7 @@ local texsprint, texprint, texwrite, texcount = tex.sprint, tex.print, tex.write
local concat, insert, remove = table.concat, table.insert, table.remove
local lpegmatch = lpeg.match
local simple_hash_to_string, settings_to_hash = utilities.parsers.simple_hash_to_string, utilities.parsers.settings_to_hash
-local allocate, mark, checked = utilities.storage.allocate, utilities.storage.mark, utilities.storage.checked
+local allocate, checked = utilities.storage.allocate, utilities.storage.checked
local trace_lists = false trackers.register("structures.lists", function(v) trace_lists = v end)
@@ -75,7 +75,7 @@ end
local function initializer()
-- create a cross reference between internal references
-- and list entries
- local collected = mark(lists.collected)
+ local collected = lists.collected
local internals = checked(references.internals)
local ordered = lists.ordered
for i=1,#collected do
@@ -110,14 +110,12 @@ end
job.register('structures.lists.collected', tobesaved, initializer)
function lists.push(t)
+ local m = t.metadata
local r = t.references
local i = (r and r.internal) or 0 -- brrr
local p = pushed[i]
if not p then
p = #cached + 1
- if r.tag == nil then
- r.tag = tags.last and tags.last(t.metadata.kind) -- maybe kind but then also check elsewhere
- end
cached[p] = helpers.simplify(t)
pushed[i] = p
end
@@ -134,14 +132,21 @@ function lists.enhance(n)
-- todo: symbolic names for counters
local l = cached[n]
if l then
+ local metadata = l.metadata
+ local references = l.references
--
l.directives = nil -- might change
-- save in the right order (happens at shipout)
lists.tobesaved[#lists.tobesaved+1] = l
-- default enhancer (cross referencing)
- l.references.realpage = texcount.realpageno
+ references.realpage = texcount.realpageno
+ -- tags
+ local kind = metadata.kind
+ local name = metadata.name
+ if references then
+ references.tag = tags.getid(kind,name)
+ end
-- specific enhancer (kind of obsolete)
- local kind = l.metadata.kind
local enhancer = kind and lists.enhancers[kind]
if enhancer then
enhancer(l)