diff options
| author | Philipp Gesang <phg42.2a@gmail.com> | 2013-04-14 19:23:40 +0200 | 
|---|---|---|
| committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-04-14 19:23:40 +0200 | 
| commit | 9d3e292ead8e354c836d0c4dcd25e0b4aa03486c (patch) | |
| tree | b38ef12adc506d92f03887da28e9f68269d039a0 | |
| parent | eb3482f39ca47f5d1a5bb4b5177fb6cd0c8bafb0 (diff) | |
| download | lualibs-9d3e292ead8e354c836d0c4dcd25e0b4aa03486c.tar.gz | |
add compatibility for luaotfload v.1
| -rw-r--r-- | lualibs-compat.lua | 29 | ||||
| -rw-r--r-- | lualibs.lua | 9 | 
2 files changed, 31 insertions, 7 deletions
| diff --git a/lualibs-compat.lua b/lualibs-compat.lua new file mode 100644 index 0000000..cb9d8f0 --- /dev/null +++ b/lualibs-compat.lua @@ -0,0 +1,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 diff --git a/lualibs.lua b/lualibs.lua index 59d7907..4f354b5 100644 --- a/lualibs.lua +++ b/lualibs.lua @@ -52,18 +52,13 @@ loadmodule = _G.loadmodule or function (name, t)    return true  end -local merged_suffix = "-merged.lua" - -local p_suffix      = lpeg.P".lua" * lpeg.P(-1) -local p_nosuffix    = (1 - p_suffix)^0 -local p_hassuffix   = (p_nosuffix) * p_suffix -local p_stripsuffix = lpeg.C(p_nosuffix) * p_suffix -  --[[doc--  The separation of the “basic” from the “extended” sets coincides with  the split into luat-bas.mkiv and luat-lib.mkiv.  --doc]]--  loadmodule"lualibs-basic.lua" +loadmodule"lualibs-compat.lua" --- restore stuff gone since v1.* +  if load_extended == true then    loadmodule"lualibs-extended.lua"  end | 
