diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
commit | 974640d66e61e81cb197ad96fdff7b08343e4c5a (patch) | |
tree | 2e1f75f32f312b7f24ba82b4590ae230bcd6f399 /Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua | |
parent | b4fa72e61230aca75f7f6fbf988821f71edfb6b2 (diff) |
context
git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua index 6873f89eb72..6e26f6f3701 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/strc-reg.lua @@ -460,6 +460,7 @@ local function preprocessentries(rawdata) local processors = rawdata.processors local et = entries.entries local kt = entries.keys + local pt = entries.processors local entryproc = processors and processors.entry local pageproc = processors and processors.page local coding = rawdata.metadata.coding @@ -483,16 +484,20 @@ local function preprocessentries(rawdata) end kt = lpegmatch(coding == "xml" and entrysplitter_xml or entrysplitter_tex,k) end + if not pt then + pt = { } + end -- entries = { } local ok = false for k=#et,1,-1 do local etk = et[k] local ktk = kt[k] + local ptk = pt[k] if not ok and etk == "" then entries[k] = nil else - entries[k] = { etk or "", ktk ~= "" and ktk or nil } + entries[k] = { etk or "", ktk ~= "" and ktk or false, ptk ~= "" and ptk or false } ok = true end end @@ -677,31 +682,33 @@ implement { { "catcodes", "integer" }, { "own" }, { "xmlroot" }, - { "xmlsetup" } + { "xmlsetup" }, } }, { "entries", { { "entries", "list" }, { "keys", "list" }, + { "processors", "list" }, { "entry" }, - { "key" } + { "key" }, + { "processor" }, } }, { "references", { { "internal", "integer" }, { "section", "integer" }, { "view" }, - { "label" } + { "label" }, } }, { "seeword", { - { "text" } + { "text" }, } }, { "processors", { { "entry" }, { "key" }, - { "page" } + { "page" }, } }, { "userdata" }, @@ -1258,6 +1265,7 @@ function registers.flush(data,options,prefixspec,pagespec) while d < #data do d = d + 1 local entry = data[d] +-- inspect(entry) local metadata = entry.metadata local kind = metadata.kind local list = entry.list @@ -1266,8 +1274,9 @@ function registers.flush(data,options,prefixspec,pagespec) e[i] = false end for i=1,maxlevel do + local li = list[i] if list[i] then - e[i] = list[i][1] + e[i] = li[1] end if e[i] == done[i] then -- skip @@ -1309,7 +1318,7 @@ function registers.flush(data,options,prefixspec,pagespec) local processors = entry.processors local internal = references.internal or 0 local seeparent = references.seeparent or "" - local processor = processors and processors[1] or "" + local processor = (li and li[3]) or (processors and processors[1]) or "" -- so, we need to keep e as is (local), or we need local title = e[i] ... which might be -- more of a problem ctx_startregisterentry(0) -- will become a counter |