summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-11 15:15:12 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-11 15:15:12 +0200
commit88b50eb56c6effbf943ce2fd9afbfe41a5cec45e (patch)
tree11239b646f9da35ab4fcb8b065846c68b3d5ab0c
parent5684a0743e65ecb5ee3bd60a085df45479b0d39e (diff)
downloadlualibs-88b50eb56c6effbf943ce2fd9afbfe41a5cec45e.tar.gz
add extended sequence
-rw-r--r--lualibs-extended.lua37
-rw-r--r--lualibs.lua10
2 files changed, 46 insertions, 1 deletions
diff --git a/lualibs-extended.lua b/lualibs-extended.lua
new file mode 100644
index 0000000..ea3ae8a
--- /dev/null
+++ b/lualibs-extended.lua
@@ -0,0 +1,37 @@
+-- This is file `lualibs-extended.lua',
+module('lualibs-extended', package.seeall)
+
+local lualibs_basic_module = {
+ name = "lualibs-extended",
+ version = 1.01,
+ date = "2013/04/10",
+ description = "Basic Lua extensions, meta package.",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "See ConTeXt's mreadme.pdf for the license",
+}
+
+local error
+if luatexbase and luatexbase.provides_module then
+ local __error,_,_ = luatexbase.provides_module(lualibs_module)
+ error = __error
+else
+ error = texio.write_nl
+end
+
+local loadmodule = lualibs.loadmodule
+
+loadmodule("lualibs-util-str")
+loadmodule("lualibs-util-tab")
+loadmodule("lualibs-util-sto")
+----------("lualibs-util-pck")--- packers; necessary?
+----------("lualibs-util-seq")--- sequencers (function chaining)
+----------("lualibs-util-mrg")--- only relevant in mtx-package
+loadmodule("lualibs-util-prs")--- miscellaneous parsers; cool. cool cool cool
+----------("lualibs-util-fmt")--- column formtatter (rarely used)
+loadmodule("lualibs-util-dim")
+loadmodule("lualibs-util-jsn")
+
+--loadmodule("lualibs-util-lua")--- operations on lua bytecode
+--
+-- End of File `lualibs-extended.lua'.
diff --git a/lualibs.lua b/lualibs.lua
index a38f974..7255147 100644
--- a/lualibs.lua
+++ b/lualibs.lua
@@ -32,7 +32,7 @@ else
find_file = kpse.find_file
end
-loadmodule = _ENV.loadmodule or function (name, t)
+loadmodule = _G.loadmodule or function (name, t)
if not t then t = "library" end
local filepath = kpse.find_file(name, "lua")
if not filepath or filepath == "" then
@@ -71,11 +71,19 @@ local loadmerged = function (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))
loadmerged"extended.lua"
+--- merge generates wrong syntax for this one, so we load it separately
+--- http://www.ntg.nl/pipermail/ntg-context/2013/072336.html
+--loadmodule"util-dim"
+
io.write"\n"
--
-- vim:tw=71:sw=2:ts=2:expandtab