summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-12-16 21:05:20 +0000
committerKarl Berry <karl@freefriends.org>2022-12-16 21:05:20 +0000
commit2811b370a9db2922ccdd8b3a3619299ea3b759d1 (patch)
tree750b4f4ed4a7dc373d52ec7df1a4d65d1c9f2266 /Master/texmf-dist/tex/luatex
parentbe7f325aa40bdbe6f972a5b99206422d9c215c13 (diff)
luakeys (16dec22)
git-svn-id: svn://tug.org/texlive/trunk@65294 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty2
-rw-r--r--Master/texmf-dist/tex/luatex/luakeys/luakeys.lua38
-rw-r--r--Master/texmf-dist/tex/luatex/luakeys/luakeys.sty2
3 files changed, 31 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty b/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty
index c7748db068f..6d60271dd88 100644
--- a/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty
+++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty
@@ -17,6 +17,6 @@
% luakeys-debug.sty and luakeys-debug.tex.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luakeys-debug}[2022/11/21 0.9.0 Debug package for luakeys.]
+\ProvidesPackage{luakeys-debug}[2022/12/16 0.10.0 Debug package for luakeys.]
\input luakeys-debug.tex
diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua b/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua
index a2204133906..333b3573084 100644
--- a/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua
+++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua
@@ -178,15 +178,18 @@ local namespace = {
default = true,
defaults = false,
defs = false,
+ false_aliases = { 'false', 'FALSE', 'False' },
format_keys = false,
group_begin = '{',
group_end = '}',
hooks = {},
+ invert_flag = '!',
list_separator = ',',
naked_as_value = false,
no_error = false,
quotation_begin = '"',
quotation_end = '"',
+ true_aliases = { 'true', 'TRUE', 'True' },
unpack = true,
},
@@ -439,6 +442,18 @@ local function generate_parser(initial_rule, opts)
return white_space ^ 0 * Pattern(match) * white_space ^ 0
end
+ local line_up_pattern = function(patterns)
+ local result
+ for _, pattern in ipairs(patterns) do
+ if result == nil then
+ result = Pattern(pattern)
+ else
+ result = result + Pattern(pattern)
+ end
+ end
+ return result
+ end
+
--- Convert a dimension to an normalized dimension string or an
--- integer in the scaled points format.
---
@@ -534,15 +549,9 @@ local function generate_parser(initial_rule, opts)
Variable('boolean_false') * CaptureConstant(false)
),
- boolean_true =
- Pattern('true') +
- Pattern('TRUE') +
- Pattern('True'),
+ boolean_true = line_up_pattern(opts.true_aliases),
- boolean_false =
- Pattern('false') +
- Pattern('FALSE') +
- Pattern('False'),
+ boolean_false = line_up_pattern(opts.false_aliases),
-- for is.dimension()
dimension_only = Variable('dimension') * -1,
@@ -1191,6 +1200,13 @@ local function parse(kv_string, opts)
end
return key, value
end,
+
+ apply_invert_flag = function(key, value)
+ if type(key) == 'string' and key:find(opts.invert_flag) then
+ return key:gsub(opts.invert_flag, ''), not value
+ end
+ return key, value
+ end,
}
if opts.unpack then
@@ -1210,6 +1226,10 @@ local function parse(kv_string, opts)
result = visit_tree(result, callbacks.format_key)
end
+ if opts.invert_flag then
+ result = visit_tree(result, callbacks.apply_invert_flag)
+ end
+
return result
end
result = apply_opts(result, opts)
@@ -1250,7 +1270,7 @@ local result_store = {}
-- @section
local export = {
- version = { 0, 9, 0 },
+ version = { 0, 10, 0 },
namespace = namespace,
diff --git a/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty b/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty
index 459a9157aec..c76025c114b 100644
--- a/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty
+++ b/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty
@@ -17,5 +17,5 @@
% luakeys-debug.sty and luakeys-debug.tex.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luakeys}[2022/11/21 0.9.0 Parsing key-value options using Lua.]
+\ProvidesPackage{luakeys}[2022/12/16 0.10.0 Parsing key-value options using Lua.]
\directlua{luakeys = require('luakeys')}