summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mult-chk.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mult-chk.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mult-chk.lua47
1 files changed, 27 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/context/base/mult-chk.lua b/Master/texmf-dist/tex/context/base/mult-chk.lua
index bdbd1dd22f9..4b1ba12ee3e 100644
--- a/Master/texmf-dist/tex/context/base/mult-chk.lua
+++ b/Master/texmf-dist/tex/context/base/mult-chk.lua
@@ -10,57 +10,64 @@ local format = string.format
local lpegmatch = lpeg.match
local type = type
local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes
+local make_settings_to_hash_pattern, settings_to_set = utilities.parsers.make_settings_to_hash_pattern, utilities.parsers.settings_to_set
+
+local allocate = utilities.storage.allocate
+
+local report_interface = logs.reporter("interface","checking")
interfaces = interfaces or { }
-interfaces.syntax = {
+interfaces.syntax = allocate {
test = { keys = table.tohash { "a","b","c","d","e","f","g" } }
}
-function interfaces.invalidkey(kind,key)
- commands.writestatus("syntax","invalid key '%s' for '%s' in line %s",key,kind,tex.inputlineno)
+function interfaces.invalidkey(category,key)
+ report_interface("invalid key '%s' for '%s' in line %s",key,category,tex.inputlineno)
end
-function interfaces.setvalidkeys(kind,list)
- local s = interfaces.syntax[kind]
+function interfaces.setvalidkeys(category,list)
+ local s = interfaces.syntax[category]
if not s then
- interfaces.syntax[kind] = {
- keys = aux.settings_to_set(list)
+ interfaces.syntax[category] = {
+ keys = settings_to_set(list)
}
else
- s.keys = aux.settings_to_set(list)
+ s.keys = settings_to_set(list)
end
end
-function interfaces.addvalidkeys(kind,list)
- local s = interfaces.syntax[kind]
+function interfaces.addvalidkeys(category,list)
+ local s = interfaces.syntax[category]
if not s then
- interfaces.syntax[kind] = {
- keys = aux.settings_to_set(list)
+ interfaces.syntax[category] = {
+ keys = settings_to_set(list)
}
else
- aux.settings_to_set(list,s.keys)
+ settings_to_set(list,s.keys)
end
end
-local prefix, kind, keys
+-- weird code, looks incomplete ... probbably an experiment
+
+local prefix, category, keys
local function set(key,value)
if keys and not keys[key] then
- interfaces.invalidkey(kind,key)
+ interfaces.invalidkey(category,key)
else
- texsprint(ctxcatcodes,format("\\setsomevalue{%s}{%s}{%s}",prefix,key,value))
+ context.setsomevalue(prefix,key,value)
end
end
-local pattern = aux.make_settings_to_hash_pattern(set,"tolerant")
+local pattern = make_settings_to_hash_pattern(set,"tolerant")
-function commands.getcheckedparameters(k,p,s)
+function interfaces.getcheckedparameters(k,p,s)
if s and s ~= "" then
- prefix, kind = p, k
+ prefix, category = p, k
keys = k and k ~= "" and interfaces.syntax[k].keys
lpegmatch(pattern,s)
end
end
-_gcp_ = commands.getcheckedparameters
+-- _igcp_ = interfaces.getcheckedparameters