summaryrefslogtreecommitdiff
path: root/lualibs-compat.lua
blob: cb9d8f0fd64d8e053605fecb6d164566c81796f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env texlua

local stringgsub  = string.gsub
local stringlower = string.lower
local next        = next
local Ct, splitat = lpeg.Ct, lpeg.splitat

--[[doc
Needed by legacy luat-dum.lua.
--doc]]--
table.reverse_hash = function (h)
    local r = { }
    for k,v in next, h do
        r[v] = stringlower(stringgsub(k," ",""))
    end
    return r
end

--[[doc
Needed by legacy font-otn.lua.
--doc]]--
lpeg.splitters = { [" "] = Ct(splitat" ") }

--[[doc
Needed by legacy font-nms.lua.
--doc]]--

file.split_path    = file.splitpath
file.collapse_path = file.collapsepath