texlive[65533] Master/texmf-dist: luakeys (13jan23)

commits+karl at tug.org commits+karl at tug.org
Fri Jan 13 23:02:27 CET 2023


Revision: 65533
          http://tug.org/svn/texlive?view=revision&revision=65533
Author:   karl
Date:     2023-01-13 23:02:26 +0100 (Fri, 13 Jan 2023)
Log Message:
-----------
luakeys (13jan23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/luakeys/documentation.tex
    trunk/Master/texmf-dist/doc/luatex/luakeys/luakeys.pdf
    trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty
    trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua
    trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty

Modified: trunk/Master/texmf-dist/doc/luatex/luakeys/documentation.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luakeys/documentation.tex	2023-01-13 22:02:09 UTC (rev 65532)
+++ trunk/Master/texmf-dist/doc/luatex/luakeys/documentation.tex	2023-01-13 22:02:26 UTC (rev 65533)
@@ -64,7 +64,7 @@
   \href{https://github.com/Josef-Friedrich/luakeys}
        {github.com/Josef-Friedrich/luakeys}%
 }
-\date{v0.12.0 from 2023/01/05}
+\date{v0.13.0 from 2023/01/13}
 
 \maketitle
 
@@ -273,11 +273,14 @@
 Luakeys exports only one function that must be called to access the
 public API.
 %
-% Das Lua-Modul exportiert diese Funktionen und Tabellen:
-The Lua module exports this functions and tables:
+% Diese Exportfunktion gibt eine Tabelle zurück, die die öffentlichen
+% Funktionen und weiteren Tabellen enthält:
+This export function returns a table containing the public functions and
+additional tables:
 
 \InputLua[firstline=3,lastline=16]{export.lua}
 
+\noindent
 % Das Projekt verwendet einige wenige Abkürzungen für Variablennamen,
 % die hoffentlich für externe Leser eindeutig und bekannt sind.
 The project uses a few abbreviations for variable names that are
@@ -316,6 +319,19 @@
 \end{tabular}
 \end{center}
 
+\noindent
+% Es wird empfohlen, beim Entwickeln im Texteditor luakeys zusammen mit
+% dem Lua-Language-Server zu verwenden.
+It is recommended to use luakeys together with the
+\href{https://github.com/sumneko/lua-language-server}{github.com/sumneko/lua-language-server}
+when developing in a text editor.
+%
+% Luakeys unterstützt nämlich das vom Server angeboten Annotationsformat
+luakeys supports the annotation format offered by the server.
+% Sie sollten dann Warnungen erhalten, wenn Sie die mittlerweile
+% ziemlich große API von luakeys falsch verwenden.
+You should then get warnings if you misuse luakeys’ now rather large API.
+
 %%
 %
 %%
@@ -1524,7 +1540,7 @@
 % In der Tabelle \lua{utils} sind einige Hilfsfunktionen gebündelt.
 The \lua{utils} table bundles some auxiliary functions.
 
-\InputLua[firstline=3,lastline=34]{utils/all.lua}
+\InputLua[firstline=3,lastline=37]{utils/all.lua}
 
 %%
 %
@@ -1621,6 +1637,18 @@
 
 \InputLua[firstline=4,lastline=10]{version.lua}
 
+%%
+%
+%%
+
+\subsection{Table “error_messages”}
+
+\InputLua[firstline=4,lastline=17]{error-messages.lua}
+
+\begin{description}
+\directlua{luakeys.print_error_messages()}
+\end{description}
+
 %-----------------------------------------------------------------------
 %
 %-----------------------------------------------------------------------
@@ -2069,93 +2097,6 @@
 
 \inputminted[linenos=true]{latex}{luakeys-debug.sty}
 
-\changes{v0.1.0}{2021/01/18}{Inital release}
-\changes{v0.2.0}{2021/09/19}{
-* Allow all recognized data types as keys.
-* Allow TeX macros in the values.
-* New public Lua functions: save(identifier, result), get(identifier).
-}
-\changes{v0.3.0}{2021/11/05}{
-* Add a LuaLaTeX wrapper “luakeys.sty”.
-* Add a plain LuaTeX wrapper “luakeys.tex”.
-* Rename the previous documentation file “luakeys.tex” to luakeys-doc.tex”.
-}
-\changes{v0.4.0}{2021/12/31}{
-* Parser: Add support for nested tables (for example {{'a', 'b'}}).
-* Parser: Allow only strings and numbers as keys.
-* Parser: Remove support from Lua numbers with exponents (for example '5e+20').
-* Switch the Lua testing framework to busted.
-}
-\changes{v0.5.0}{2022/04/04}{
-* Add possibility to change options globally.
-* New option: standalone_as_true.
-* Add a recursive converter callback / hook to process the parse tree.
-* New option: case_insensitive_keys.
-}
-\changes{v0.6.0}{2022/06/09}{
-* New feature: keys now can be defined using the function
-  “define(defs, opts)” or “define(kv_string, { defs = { key = { ... } } })”
-* Rename the global options table from “default_options” to “opts”.
-* New option “format_keys”.
-* Remove option “case_insensitive_keys”. Use
-  “format_keys = \{ lower \}” to achieve the same effect.
-* The default value of the option “convert_dimension” is now false.
-* The option “standalone_as_true” is renamed to “naked_as_value”.
-  The boolean value of the option must be changed to the opposite to.
-  produce the previous effect.
-* The function “print()” is now called “debug()”.
-}
-\changes{v0.7.0}{2022/07/06}{
-* The project now uses semantic versioning.
-* New definition attribute “pick” to pick standalone values and assign
-  them to a key.
-* New function “utils.scan_oarg()” to search for an optional argument,
-  that means scan for tokens that are enclosed in square brackets.
-* Extend and improve the documentation.
-}
-\changes{v0.8.0}{2022/11/17}{
-* Add 6 new options to change the delimiters: “assignment_operator”,
-  “group_begin”, “group_end”, “list_separator”, “quotation_begin”,
-  “quotation_end”.
-* Extend the documentation about the option “format_keys”.
-}
-\changes{v0.9.0}{2022/11/21}{
-* The definition attibute “pick” accepts a new data type: “any”.
-* The attribute value “true” for the attribute “pick” is deprecated.
-* The attribute “pick” accepts now multiple data types specified in
-  a table.
-* Add a new function called “any(value)” in the “is” table that accepts
-  any data type.
-}
-\changes{v0.10.0}{2022/12/16}{
-* Add support for an invert flat that flips the value of naked keys.
-* Add new options to specify which strings are recognized as Boolean
-  values.
-}
-\changes{v0.11.0}{2022/12/23}{
-* Add a new function called “get_private_instance()” to load a private
-  version of the luakeys module.
-}
-\changes{v0.12.0}{2023/01/05}{
-Added
-* Macros \cmd{\LuakeysGetPackageOptions}, \cmd{\LuakeysGetClassOptions}.
-* Option “accumulated_result”.
-* Data type “list” to the attribute “data_type”.
-* Attribute “description”.
-* Tables “utils.log” and “utils.ansi_color”.
-* Table “errors_message” to set custom messages.
-* Short form syntax for the definition attribute “opposite_keys”.
-Changed
-* Breaking change! luakeys exports now a function instead of a table.
-  Use “require('luakeys')()” or “luakeys.new()” instead of
-  “require('luakeys')”.
-* Breaking change! “luakeys.parse()”, “luakeys.define()”, “luakeys.save()”
-  and “luakeys.get()” can’t be used anymore from the global variable luakeys.
-* New name for the function “new()” instead of “get_private_instance()".
-}
-
 \pagebreak
-\PrintChanges
-\pagebreak
 \PrintIndex
 \end{document}

Modified: trunk/Master/texmf-dist/doc/luatex/luakeys/luakeys.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty	2023-01-13 22:02:09 UTC (rev 65532)
+++ trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty	2023-01-13 22:02:26 UTC (rev 65533)
@@ -17,6 +17,6 @@
 % luakeys-debug.sty and luakeys-debug.tex.
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luakeys-debug}[2023/01/05 v0.12.0 Debug package for luakeys.]
+\ProvidesPackage{luakeys-debug}[2023/01/13 v0.13.0 Debug package for luakeys.]
 
 \input luakeys-debug.tex

Modified: trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua	2023-01-13 22:02:09 UTC (rev 65532)
+++ trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua	2023-01-13 22:02:26 UTC (rev 65533)
@@ -17,7 +17,6 @@
 ---luakeys-debug.sty and luakeys-debug.tex.
 ----A key-value parser written with Lpeg.
 ---
---- at module luakeys
 local lpeg = require('lpeg')
 
 if not tex then
@@ -34,6 +33,7 @@
   }
 end
 
+---
 local utils = (function()
   ---
   ---Merge two tables into the first specified table.
@@ -88,10 +88,10 @@
   ---
   ---Remove an element from a table.
   ---
-  --- at param source table
-  --- at param value any
+  --- at param source table # The source table.
+  --- at param value any # The value to be removed from the table.
   ---
-  --- at return any|nil
+  --- at return any|nil # If the value was found, then this value, otherwise nil.
   local function remove_from_table(source, value)
     for index, v in pairs(source) do
       if value == v then
@@ -102,8 +102,10 @@
   end
 
   ---
-  --- at param source table
+  ---Return the keys of a table as a sorted list (array like table).
   ---
+  --- at param source table # The source table.
+  ---
   --- at return table # An array table with the sorted key names.
   local function get_table_keys(source)
     local keys = {}
@@ -148,47 +150,32 @@
   end
 
   ---
-  ---Scan for an optional argument.
+  ---Print a formatted string.
   ---
-  --- at param initial_delimiter? string # The character that marks the beginning of an optional argument (by default `[`).
-  --- at param end_delimiter? string # The character that marks the end of an optional argument (by default `]`).
+  ---* `%d` or `%i`: Signed decimal integer
+  ---* `%u`: Unsigned decimal integer
+  ---* `%o`: Unsigned octal
+  ---* `%x`: Unsigned hexadecimal integer
+  ---* `%X`: Unsigned hexadecimal integer (uppercase)
+  ---* `%f`: Decimal floating point, lowercase
+  ---* `%e`: Scientific notation (mantissa/exponent), lowercase
+  ---* `%E`: Scientific notation (mantissa/exponent), uppercase
+  ---* `%g`: Use the shortest representation: %e or %f
+  ---* `%G`: Use the shortest representation: %E or %F
+  ---* `%a`: Hexadecimal floating point, lowercase
+  ---* `%A`: Hexadecimal floating point, uppercase
+  ---* `%c`: Character
+  ---* `%s`: String of characters
+  ---* `%p`: Pointer address	b8000000
+  ---* `%%`: A `%` followed by another `%` character will write a single `%` to the stream.
+  ---* `%q`: formats `booleans`, `nil`, `numbers`, and `strings` in a way that the result is a valid constant in Lua source code.
   ---
-  --- at return string|nil # The string that was enclosed by the delimiters. The delimiters themselves are not returned.
-  local function scan_oarg(initial_delimiter,
-    end_delimiter)
-    if initial_delimiter == nil then
-      initial_delimiter = '['
-    end
-
-    if end_delimiter == nil then
-      end_delimiter = ']'
-    end
-
-    local function convert_token(t)
-      if t.index ~= nil then
-        return utf8.char(t.index)
-      else
-        return '\\' .. t.csname
-      end
-    end
-
-    local function get_next_char()
-      local t = token.get_next()
-      return convert_token(t), t
-    end
-
-    local char, t = get_next_char()
-    if char == initial_delimiter then
-      local oarg = {}
-      char = get_next_char()
-      while char ~= end_delimiter do
-        table.insert(oarg, char)
-        char = get_next_char()
-      end
-      return table.concat(oarg, '')
-    else
-      token.put_next(t)
-    end
+  ---http://www.lua.org/source/5.3/lstrlib.c.html#str_format
+  ---
+  --- at param format string # A string in the `printf` format
+  --- at param ... any # A sequence of additional arguments, each containing a value to be used to replace a format specifier in the format string.
+  local function tex_printf(format, ...)
+    tex.print(string.format(format, ...))
   end
 
   ---
@@ -278,6 +265,54 @@
     throw_error_message(message, help)
   end
 
+  ---
+  ---Scan for an optional argument.
+  ---
+  --- at param initial_delimiter? string # The character that marks the beginning of an optional argument (by default `[`).
+  --- at param end_delimiter? string # The character that marks the end of an optional argument (by default `]`).
+  ---
+  --- at return string|nil # The string that was enclosed by the delimiters. The delimiters themselves are not returned.
+  local function scan_oarg(initial_delimiter,
+    end_delimiter)
+    if initial_delimiter == nil then
+      initial_delimiter = '['
+    end
+
+    if end_delimiter == nil then
+      end_delimiter = ']'
+    end
+
+    ---
+    --- at param t Token
+    ---
+    --- at return string
+    local function convert_token(t)
+      if t.index ~= nil then
+        return utf8.char(t.index)
+      else
+        return '\\' .. t.csname
+      end
+    end
+
+    local function get_next_char()
+      local t = token.get_next()
+      return convert_token(t), t
+    end
+
+    local char, t = get_next_char()
+    if char == initial_delimiter then
+      local oarg = {}
+      char = get_next_char()
+      while char ~= end_delimiter do
+        table.insert(oarg, char)
+        char = get_next_char()
+      end
+      return table.concat(oarg, '')
+    else
+      token.put_next(t)
+    end
+  end
+
   local function visit_tree(tree, callback_func)
     if type(tree) ~= 'table' then
       throw_error_message(
@@ -504,19 +539,29 @@
   ---Log levels:
   ---
   ---* 0: silent
-  ---* 1: error
-  ---* 2: warn
-  ---* 3: info
-  ---* 4: verbose
-  ---* 5: debug
+  ---* 1: error (red)
+  ---* 2: warn (yellow)
+  ---* 3: info (green)
+  ---* 4: verbose (blue)
+  ---* 5: debug (magenta)
   ---
   local log = (function()
     --- at private
     local opts = { level = 0 }
 
+    local function colorize_not(s)
+      return s
+    end
+
+    local colorize = colorize_not
+
     --- at private
     local function print_message(message, ...)
-      print(string.format(message, ...))
+      local args = {...}
+      for index, value in ipairs(args) do
+        args[index] = colorize(value)
+      end
+      print(string.format(message, table.unpack(args)))
     end
 
     ---
@@ -548,7 +593,12 @@
         end
         opts.level = level
       end
+    end
 
+    ---
+    --- at return integer
+    local function get_log_level()
+      return opts.level
     end
 
     ---
@@ -560,7 +610,9 @@
     --- at param ... any
     local function error(message, ...)
       if opts.level >= 1 then
+        colorize = ansi_color.red
         print_message(message, ...)
+        colorize = colorize_not
       end
     end
 
@@ -573,7 +625,9 @@
     --- at param ... any
     local function warn(message, ...)
       if opts.level >= 2 then
+        colorize = ansi_color.yellow
         print_message(message, ...)
+        colorize = colorize_not
       end
     end
 
@@ -586,7 +640,9 @@
     --- at param ... any
     local function info(message, ...)
       if opts.level >= 3 then
+        colorize = ansi_color.green
         print_message(message, ...)
+        colorize = colorize_not
       end
     end
 
@@ -599,7 +655,9 @@
     --- at param ... any
     local function verbose(message, ...)
       if opts.level >= 4 then
+        colorize = ansi_color.blue
         print_message(message, ...)
+        colorize = colorize_not
       end
     end
 
@@ -612,12 +670,15 @@
     --- at param ... any
     local function debug(message, ...)
       if opts.level >= 5 then
+        colorize = ansi_color.magenta
         print_message(message, ...)
+        colorize = colorize_not
       end
     end
 
     return {
-      set_log_level = set_log_level,
+      set = set_log_level,
+      get = get_log_level,
       error = error,
       warn = warn,
       info = info,
@@ -634,11 +695,12 @@
     get_table_size = get_table_size,
     get_array_size = get_array_size,
     visit_tree = visit_tree,
-    scan_oarg = scan_oarg,
+    tex_printf = tex_printf,
     throw_error_message = throw_error_message,
     throw_error_code = throw_error_code,
+    scan_oarg = scan_oarg,
+    ansi_color = ansi_color,
     log = log,
-    ansi_color = ansi_color,
   }
 end)()
 
@@ -648,7 +710,7 @@
 local visualizers = (function()
 
   ---
-  ---The function `render(tbl)` reverses the function
+  ---Reverse the function
   ---`parse(kv_string)`. It takes a Lua table and converts this table
   ---into a key-value string. The resulting string usually has a
   ---different order as the input table. In Lua only tables with
@@ -783,6 +845,64 @@
   return { render = render, stringify = stringify, debug = debug }
 end)()
 
+--- at class OptionCollection
+--- at field accumulated_result? table
+--- at field assignment_operator? string # default `=`
+--- at field convert_dimensions? boolean # default `false`
+--- at field debug? boolean # default `false`
+--- at field default? boolean # default `true`
+--- at field defaults? table
+--- at field defs? DefinitionCollection
+--- at field false_aliases? table default `{ 'false', 'FALSE', 'False' }`,
+--- at field format_keys? boolean # default `false`,
+--- at field group_begin? string default `{`,
+--- at field group_end? string default `}`,
+--- at field hooks? HookCollection
+--- at field invert_flag? string default `!`
+--- at field list_separator? string default `,`
+--- at field naked_as_value? boolean # default `false`
+--- at field no_error? boolean # default `false`
+--- at field quotation_begin? string `"`
+--- at field quotation_end? string `"`
+--- at field true_aliases? table `{ 'true', 'TRUE', 'True' }`
+--- at field unpack? boolean # default `true`
+
+--- at alias KeysHook fun(key: string, value: any, depth: integer, current: table, result: table): string, any
+--- at alias ResultHook fun(result: table): nil
+
+--- at class HookCollection
+--- at field kv_string? fun(kv_string: string): string
+--- at field keys_before_opts? KeysHook
+--- at field result_before_opts? ResultHook
+--- at field keys_before_def? KeysHook
+--- at field result_before_def? ResultHook
+--- at field keys? KeysHook
+--- at field result? ResultHook
+
+--- at alias ProcessFunction fun(value: any, input: table, result: table, unknown: table): any
+
+--- at alias PickDataType 'string'|'number'|'dimension'|'integer'|'boolean'|'any'
+
+--- at class Definition
+--- at field alias? string|table
+--- at field always_present? boolean
+--- at field choices? table
+--- at field data_type? 'boolean'|'dimension'|'integer'|'number'|'string'|'list'
+--- at field default? any
+--- at field description? string
+--- at field exclusive_group? string
+--- at field l3_tl_set? string
+--- at field macro? string
+--- at field match? string
+--- at field name? string
+--- at field opposite_keys? table
+--- at field pick? PickDataType|PickDataType[]|false
+--- at field process? ProcessFunction
+--- at field required? boolean
+--- at field sub_keys? table<string, Definition>
+
+--- at alias DefinitionCollection table<string|number, Definition>
+
 local namespace = {
   opts = {
     accumulated_result = false,
@@ -883,10 +1003,13 @@
 }
 
 ---
---- at return table # The public interface of the module.
+---Main entry point of the module.
+---
+---The return value is intentional not documented so the Lua language server can figure out the types.
 local function main()
 
   ---The default options.
+  --- at type OptionCollection
   local default_opts = utils.clone_table(namespace.opts)
 
   local error_messages = utils.clone_table(namespace.error_messages)
@@ -901,9 +1024,9 @@
   ---
   ---Normalize the parse options.
   ---
-  --- at param opts? table # Options in a raw format. The table may be empty or some keys are not set.
+  --- at param opts? OptionCollection|unknown # Options in a raw format. The table may be empty or some keys are not set.
   ---
-  --- at return table
+  --- at return OptionCollection
   local function normalize_opts(opts)
     if type(opts) ~= 'table' then
       opts = {}
@@ -1461,10 +1584,10 @@
             throw_error('E010')
           end
 
-          --- at param value string
-          local function remove_values(value)
+          --- at param v string
+          local function remove_values(v)
             local count = 0
-            while utils.remove_from_table(input, value) do
+            while utils.remove_from_table(input, v) do
               count = count + 1
             end
             return count
@@ -1485,7 +1608,9 @@
             throw_error('E020',
               { ['true'] = true_key, ['false'] = false_key })
           end
-
+          if true_count == 0 and false_count == 0 then
+            return
+          end
           return true_count == 1 or false_count == 0
         end
       end,
@@ -1681,18 +1806,29 @@
   ---Parse a LaTeX/TeX style key-value string into a Lua table.
   ---
   --- at param kv_string string # A string in the TeX/LaTeX style key-value format as described above.
-  --- at param opts? table # A table containing options.
+  --- at param opts? OptionCollection # A table containing options.
   ---
   --- at return table result # The final result of all individual parsing and normalization steps.
   --- at return table unknown # A table with unknown, undefinied key-value pairs.
   --- at return table raw # The unprocessed, raw result of the LPeg parser.
   local function parse(kv_string, opts)
+    opts = normalize_opts(opts)
+
+    local function log_result(caption, result)
+      utils.log
+        .debug('%s: \n%s', caption, visualizers.stringify(result))
+    end
+
     if kv_string == nil then
       return {}, {}, {}
     end
 
-    opts = normalize_opts(opts)
+    if opts.debug then
+      utils.log.set('debug')
+    end
 
+    utils.log.debug('kv_string: “%s”', kv_string)
+
     if type(opts.hooks.kv_string) == 'function' then
       kv_string = opts.hooks.kv_string(kv_string)
     end
@@ -1700,6 +1836,8 @@
     local result = generate_parser('list', opts):match(kv_string)
     local raw = utils.clone_table(result)
 
+    log_result('result after Lpeg Parsing', result)
+
     local function apply_hook(name)
       if type(opts.hooks[name]) == 'function' then
         if name:match('^keys') then
@@ -1727,6 +1865,8 @@
 
     apply_hooks('before_opts')
 
+    log_result('after hooks before_opts', result)
+
     ---
     ---Normalize the result table of the LPeg parser. This normalization
     ---tasks are performed on the raw input table coming directly from
@@ -1803,6 +1943,8 @@
     end
     result = apply_opts(result, opts)
 
+    log_result('after apply opts', result)
+
     ---All unknown keys are stored in this table
     local unknown = nil
     if type(opts.defs) == 'table' then
@@ -1811,6 +1953,8 @@
         {}, {}, utils.clone_table(result))
     end
 
+    log_result('after apply_definitions', result)
+
     apply_hooks()
 
     if opts.defaults ~= nil and type(opts.defaults) == 'table' then
@@ -1817,9 +1961,7 @@
       utils.merge_tables(result, opts.defaults, false)
     end
 
-    if opts.debug then
-      visualizers.debug(result)
-    end
+    log_result('End result', result)
 
     if opts.accumulated_result ~= nil and type(opts.accumulated_result) ==
       'table' then
@@ -1841,11 +1983,14 @@
   return {
     new = main,
 
-    version = { 0, 12, 0 },
+    version = { 0, 13, 0 },
 
     --- at see parse
     parse = parse,
 
+    ---
+    --- at param defs DefinitionCollection
+    --- at param opts? OptionCollection
     define = function(defs, opts)
       return function(kv_string, inner_opts)
         local options
@@ -1883,7 +2028,7 @@
     debug = visualizers.debug,
 
     ---
-    ---The function `save(identifier, result): void` saves a result (a
+    ---Save a result (a
     ---table from a previous run of `parse`) under an identifier.
     ---Therefore, it is not necessary to pollute the global namespace to
     ---store results for the later usage.
@@ -1890,17 +2035,18 @@
     ---
     --- at param identifier string # The identifier under which the result is saved.
     ---
-    --- at param result table # A result to be stored and that was created by the key-value parser.
+    --- at param result table|any # A result to be stored and that was created by the key-value parser.
     save = function(identifier, result)
       result_store[identifier] = result
     end,
 
+    ---
     ---The function `get(identifier): table` retrieves a saved result
     ---from the result store.
     ---
     --- at param identifier string # The identifier under which the result was saved.
     ---
-    --- at return table
+    --- at return table|any
     get = function(identifier)
       ---if result_store[identifier] == nil then
       ---  throw_error('No stored result was found for the identifier \'' .. identifier .. '\'')
@@ -1931,6 +2077,23 @@
       tex.print(tostring(namespace[from][name]))
     end,
 
+    print_error_messages = function()
+      local msgs = namespace.error_messages
+      local keys = utils.get_table_keys(namespace.error_messages)
+      for _, key in ipairs(keys) do
+        local msg = msgs[key]
+        --- at type string
+        local msg_text
+        if type(msg) == 'table' then
+          msg_text = msg[1]
+        else
+          msg_text = msg
+        end
+        utils.tex_printf('\\item[\\texttt{%s}]: \\texttt{%s}', key,
+          msg_text)
+      end
+    end,
+
     ---
     --- at param exported_table table
     depublish_functions = function(exported_table)

Modified: trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty	2023-01-13 22:02:09 UTC (rev 65532)
+++ trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty	2023-01-13 22:02:26 UTC (rev 65533)
@@ -17,7 +17,7 @@
 % luakeys-debug.sty and luakeys-debug.tex.
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luakeys}[2023/01/05 v0.12.0 Parsing key-value options using Lua.]
+\ProvidesPackage{luakeys}[2023/01/13 v0.13.0 Parsing key-value options using Lua.]
 \directlua{
   if luakeys == nil then
     luakeys = require('luakeys')()



More information about the tex-live-commits mailing list.