From aa85ede2a8508b44b819f968999e84f9f0de11b5 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 17 May 2013 10:05:53 +0200 Subject: sync with Context as of 2013-05-17 --- lualibs-util-prs.lua | 41 ++++++++++++++++++++++++++++++++++++----- lualibs.dtx | 2 +- 2 files changed, 37 insertions(+), 6 deletions(-) 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 -- cgit v1.2.3 From b91257a9bf59501ccce4d0feece42783480ae4b6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 18 May 2013 09:48:18 +0200 Subject: remove untracked ``util-fmt`` from test --- test-lualibs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", -- cgit v1.2.3 From 90e7da4496c82a27a85845f5929d5cfc18be7740 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 18 May 2013 09:56:43 +0200 Subject: fix Makefile; README --- Makefile | 3 ++- README | 1 - 2 files changed, 2 insertions(+), 2 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 -- cgit v1.2.3