summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luaotfload/fontloader-l-table.lua
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-11-06 03:00:54 +0000
committerNorbert Preining <norbert@preining.info>2019-11-06 03:00:54 +0000
commit590fd8b560523cdaea19c59aea61e781138e87f8 (patch)
tree0da2c5c68b4f6860feef746ecf9e8b76157c80bb /macros/luatex/generic/luaotfload/fontloader-l-table.lua
parenta78951f836b9edaab2dd593f38e33732f0d03cbd (diff)
CTAN sync 201911060300
Diffstat (limited to 'macros/luatex/generic/luaotfload/fontloader-l-table.lua')
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-l-table.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/macros/luatex/generic/luaotfload/fontloader-l-table.lua b/macros/luatex/generic/luaotfload/fontloader-l-table.lua
index cffdcc23e2..e828203867 100644
--- a/macros/luatex/generic/luaotfload/fontloader-l-table.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-l-table.lua
@@ -287,6 +287,37 @@ local function sortedhash(t,cmp)
return nothing
end
+-- local function iterate(t,i)
+-- local i = i + 1
+-- if i <= t.n then
+-- local k = t[i]
+-- return i, k, t.t[k]
+-- end
+-- end
+--
+-- local function indexedhash(t,cmp)
+-- if t then
+-- local s
+-- if cmp then
+-- -- it would be nice if the sort function would accept a third argument (or nicer, an optional first)
+-- s = sortedhashkeys(t,function(a,b) return cmp(t,a,b) end)
+-- else
+-- s = sortedkeys(t) -- the robust one
+-- end
+-- local m = #s
+-- if m == 1 then
+-- return next, t
+-- elseif m > 0 then
+-- s.n = m
+-- s.t = t
+-- return iterate, s, 0
+-- end
+-- end
+-- return nothing
+-- end
+--
+-- -- for i, k, v in indexedhash(t) do print(k,v,s) end
+
table.sortedhash = sortedhash
table.sortedpairs = sortedhash -- obsolete