summaryrefslogtreecommitdiff
path: root/lualibs-compat.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-29 15:04:45 -0700
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-29 15:04:45 -0700
commit202f064c65283e482f149868437e2881a73ebe3d (patch)
treeb31b5a94146a0a300b3fd09cb50d5736a002f086 /lualibs-compat.lua
parent5ff06a36a0e82f3350bc955fac3825d7a1969289 (diff)
parent1e04ecc2c4918448e8ff30a2e6363025267cac79 (diff)
downloadlualibs-202f064c65283e482f149868437e2881a73ebe3d.tar.gz
Merge pull request #2 from phi-gamma/master
merge experimental branch
Diffstat (limited to 'lualibs-compat.lua')
-rw-r--r--lualibs-compat.lua29
1 files changed, 29 insertions, 0 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