summaryrefslogtreecommitdiff
path: root/lualibs.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-14 02:19:52 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-14 02:19:52 +0200
commit120ce3327618dea784a0482f1db6295b4168062c (patch)
tree0d6be55744f10da7361ad55d381cafc32a8eb2c9 /lualibs.lua
parent419e509d1b2760c0f84bd825ed6a0cb107cee45f (diff)
downloadlualibs-120ce3327618dea784a0482f1db6295b4168062c.tar.gz
work around merging restrictions
Diffstat (limited to 'lualibs.lua')
-rw-r--r--lualibs.lua29
1 files changed, 3 insertions, 26 deletions
diff --git a/lualibs.lua b/lualibs.lua
index cd0034e..59d7907 100644
--- a/lualibs.lua
+++ b/lualibs.lua
@@ -12,7 +12,7 @@ local lualibs_module = {
}
--- TODO should be set in some global config
-local prefer_merged = true ---false
+prefer_merged = true ---false
local load_extended = true ---false
if config and config.lualibs then
@@ -59,36 +59,13 @@ local p_nosuffix = (1 - p_suffix)^0
local p_hassuffix = (p_nosuffix) * p_suffix
local p_stripsuffix = lpeg.C(p_nosuffix) * p_suffix
-local loadmerged = function (basename)
- basename = lualibs_module.name .. "-" .. basename
- if not lpegmatch(p_hassuffix, basename) then -- force .lua suffix
- basename = basename .. ".lua"
- end
- local res
- if prefer_merged then
- local mergedname = lpegmatch(p_stripsuffix, basename) .. merged_suffix
- res = loadmodule(mergedname, "merged package")
- else
- info"Ignoring merged packages."
- end
- if not res then -- package not present, load individual libs
- info(stringformat("Falling back to “%s”.", basename))
- res = loadmodule(basename, "metapackage")
- end
- if res == false then
- error(stringformat("Could not load metapackage “%s”.", basename))
- end
-end
-
--[[doc--
The separation of the “basic” from the “extended” sets coincides with
the split into luat-bas.mkiv and luat-lib.mkiv.
--doc]]--
-loadmerged"basic.lua"
---inspect(table.keys(table))
---inspect(table.keys(string))
+loadmodule"lualibs-basic.lua"
if load_extended == true then
- loadmerged"extended.lua"
+ loadmodule"lualibs-extended.lua"
end
-- vim:tw=71:sw=2:ts=2:expandtab