From 506e60b2004265fb193e991d9ffc14e206c21720 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 19 Jan 2014 00:10:00 +0100 Subject: beta 2014.01.19 00:10 --- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4086 -> 4083 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/publ-aut.lua | 46 ++++++++++++++------- tex/context/base/sort-ini.lua | 43 +++++++++++++------ tex/context/base/status-files.pdf | Bin 24785 -> 24795 bytes tex/context/base/status-lua.pdf | Bin 229057 -> 229198 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 8 files changed, 63 insertions(+), 32 deletions(-) (limited to 'tex') diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 0e5cda579..3c2859c98 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.01.18 13:23} +\newcontextversion{2014.01.19 00:10} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 39af93301..6d5db6f4a 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index b3743bbe3..90d9cb30e 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.01.18 13:23} +\edef\contextversion{2014.01.19 00:10} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/publ-aut.lua b/tex/context/base/publ-aut.lua index 12256f74e..92069245b 100644 --- a/tex/context/base/publ-aut.lua +++ b/tex/context/base/publ-aut.lua @@ -465,26 +465,40 @@ function authors.sorted(dataset,list,sorttype) -- experimental if entry then local key = entry[sorttype] local suf = tostring(i) + local split if key then - local split = { } - for i=1,#key do - local k = key[i] - local vons = table.concat(k.vons," ") - local surnames = table.concat(k.surnames," ") - local assembled = (#vons > 0 and vons .. " " .. surnames) or surnames - split[i] = splitter(strip(assembled .. ":" .. suf)) + split = { } + local n = #key + if n > 0 then + -- least efficient + for i=1,n do + local k = key[i] + local vons = k.vons + local surs = k.surnames + local vons = vons and concat(vons," ") + local surs = surs and concat(surs," ") or "" + local assembled = (vons and #vons > 0 and vons .. " " .. surs) or surs + split[i] = splitter(strip(assembled),true) + end + split[n+1] = splitter(suf) + else + -- medium efficient + local k = key[1] + local vons = k.vons + local surs = k.surnames + local vons = vons and concat(vons," ") + local surs = surs and concat(surs," ") or "" + local assembled = (vons and #vons > 0 and vons .. " " .. surs) or surs + split = splitter(strip(assembled..":"..suf),true) end - valid[i] = { - index = i, - split = split, - } else - local split = splitter(suf) - valid[i] = { - index = i, - split = split, - } + -- efficient fallback + split = splitter(suf,true) end + valid[i] = { + index = i, + split = split, + } end end -- inspect(valid) diff --git a/tex/context/base/sort-ini.lua b/tex/context/base/sort-ini.lua index 479d1c489..2a3ea1e89 100644 --- a/tex/context/base/sort-ini.lua +++ b/tex/context/base/sort-ini.lua @@ -120,7 +120,7 @@ local sorters = sorters local constants = sorters.constants local data, language, method, digits -local replacements, m_mappings, z_mappings, p_mappings, entries, orders, lower, upper, method, sequence +local replacements, m_mappings, z_mappings, p_mappings, entries, orders, lower, upper, method, sequence, usedinsequence local thefirstofsplit local mte = { -- todo: assign to t @@ -334,6 +334,8 @@ local function setlanguage(l,m,d,u) end end data.sequence = sequence + usedinsequence = table.tohash(sequence) + data.usedinsequence = usedinsequence if trace_tests then report_sorters("using sort sequence: % t",sequence) end @@ -372,6 +374,8 @@ local function basicsort(sort_a,sort_b) return 0 end +-- todo: compile compare function + function comparers.basic(a,b) -- trace ea and eb local ea, eb = a.split, b.split local na, nb = #ea, #eb @@ -477,7 +481,7 @@ sorters.firstofsplit = firstofsplit -- for the moment we use an inefficient bunch of tables but once -- we know what combinations make sense we can optimize this -function splitters.utf(str) -- we could append m and u but this is cleaner, s is for tracing +function splitters.utf(str,checked) -- we could append m and u but this is cleaner, s is for tracing if #replacements > 0 then -- todo make an lpeg for this for k=1,#replacements do @@ -580,18 +584,31 @@ function splitters.utf(str) -- we could append m and u but this is cleaner, s is -- p_mapping = { p_mappings[fs][1] } -- end -- end - local t = { - ch = char, - uc = byte, - mc = m_case, - zc = z_case, - pc = p_case, - mm = m_mapping, - zm = z_mapping, - pm = p_mapping, - } - return t + if checked then + return { + ch = usedinsequence.ch and char or nil, -- not in sequence + uc = usedinsequence.uc and byte or nil, + mc = usedinsequence.mc and m_case or nil, + zc = usedinsequence.zc and z_case or nil, + pc = usedinsequence.pc and p_case or nil, + mm = usedinsequence.mm and m_mapping or nil, + zm = usedinsequence.zm and z_mapping or nil, + pm = usedinsequence.pm and p_mapping or nil, + } + else + return { + ch = char, + uc = byte, + mc = m_case, + zc = z_case, + pc = p_case, + mm = m_mapping, + zm = z_mapping, + pm = p_mapping, + } + end + end local function packch(entry) diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 2daf3dee7..118cfa85b 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 23966b542..aaf1a3fe1 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e85e075a6..ea6a3a34e 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/18/14 13:23:27 +-- merge date : 01/19/14 00:10:42 do -- begin closure to overcome local limits and interference -- cgit v1.2.3