summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--README1
-rw-r--r--lualibs-util-prs.lua41
-rw-r--r--lualibs.dtx2
-rw-r--r--test-lualibs.lua2
5 files changed, 40 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 4a08cf0..453d6cc 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,8 @@
NAME = lualibs
DTX = $(wildcard *.dtx)
DOC_DTX = $(patsubst %.dtx, %.pdf, $(DTX))
-MODULES = $(wildcard lualibs-*.lua)
+LUALIBS = $(wildcard lualibs-*.lua)
+MODULES = $(filter-out $(UNPACKED),$(LUALIBS))
# Files grouped by generation mode
TESTSCRIPT = test-lualibs.lua
diff --git a/README b/README
index 499ceb8..a196129 100644
--- a/README
+++ b/README
@@ -66,7 +66,6 @@ Source files:
lualibs-util-sto.lua tex/luatex/lualibs/lualibs-util-sto.lua
lualibs-util-str.lua tex/luatex/lualibs/lualibs-util-str.lua
lualibs-util-tab.lua tex/luatex/lualibs/lualibs-util-tab.lua
- lualibs-util-fmt.lua tex/luatex/lualibs/lualibs-util-fmt.lua
lualibs-util-tpl.lua tex/luatex/lualibs/lualibs-util-tpl.lua
LICENSE doc/luatex/lualibs/LICENSE
Makefile source/luatex/lualibs/Makefile
diff --git a/lualibs-util-prs.lua b/lualibs-util-prs.lua
index 31e7ffa..cdf4975 100644
--- a/lualibs-util-prs.lua
+++ b/lualibs-util-prs.lua
@@ -93,7 +93,9 @@ patterns.settings_to_hash_b = pattern_b_s
patterns.settings_to_hash_c = pattern_c_s
function parsers.make_settings_to_hash_pattern(set,how)
- if how == "strict" then
+ if type(str) == "table" then
+ return set
+ elseif how == "strict" then
return (pattern_c/set)^1
elseif how == "tolerant" then
return (pattern_b/set)^1
@@ -103,7 +105,16 @@ function parsers.make_settings_to_hash_pattern(set,how)
end
function parsers.settings_to_hash(str,existing)
- if str and str ~= "" then
+ if type(str) == "table" then
+ if existing then
+ for k, v in next, str do
+ existing[k] = v
+ end
+ return exiting
+ else
+ return str
+ end
+ elseif str and str ~= "" then
hash = existing or { }
lpegmatch(pattern_a_s,str)
return hash
@@ -113,7 +124,16 @@ function parsers.settings_to_hash(str,existing)
end
function parsers.settings_to_hash_tolerant(str,existing)
- if str and str ~= "" then
+ if type(str) == "table" then
+ if existing then
+ for k, v in next, str do
+ existing[k] = v
+ end
+ return exiting
+ else
+ return str
+ end
+ elseif str and str ~= "" then
hash = existing or { }
lpegmatch(pattern_b_s,str)
return hash
@@ -123,7 +143,16 @@ function parsers.settings_to_hash_tolerant(str,existing)
end
function parsers.settings_to_hash_strict(str,existing)
- if str and str ~= "" then
+ if type(str) == "table" then
+ if existing then
+ for k, v in next, str do
+ existing[k] = v
+ end
+ return exiting
+ else
+ return str
+ end
+ elseif str and str ~= "" then
hash = existing or { }
lpegmatch(pattern_c_s,str)
return next(hash) and hash
@@ -144,7 +173,9 @@ patterns.settings_to_array = pattern
-- we could use a weak table as cache
function parsers.settings_to_array(str,strict)
- if not str or str == "" then
+ if type(str) == "table" then
+ return str
+ elseif not str or str == "" then
return { }
elseif strict then
if find(str,"{") then
diff --git a/lualibs.dtx b/lualibs.dtx
index b3e6bdb..bc466e1 100644
--- a/lualibs.dtx
+++ b/lualibs.dtx
@@ -533,7 +533,7 @@ end
--- This restores the default of loading everything should a package
--- have requested otherwise. Will be gone once there is a canonical
--- interface for parameterized loading of libraries.
-lualibs.load_extended = true
+config.lualibs.load_extended = true
-- vim:tw=71:sw=2:ts=2:expandtab
diff --git a/test-lualibs.lua b/test-lualibs.lua
index b74fde1..55cecfb 100644
--- a/test-lualibs.lua
+++ b/test-lualibs.lua
@@ -15,7 +15,7 @@ local luafiles = {
"lualibs-util-jsn.lua", "lualibs-util-lua.lua",
"lualibs-util-prs.lua", "lualibs-util-sta.lua",
"lualibs-util-sto.lua", "lualibs-util-str.lua",
- "lualibs-util-tab.lua", "lualibs-util-fmt.lua",
+ "lualibs-util-tab.lua",
"lualibs-util-tpl.lua", "lualibs.lua",
"lualibs-basic.lua", "lualibs-basic-merged.lua",
"lualibs-extended.lua", "lualibs-extended-merged.lua",