texlive[65294] Master/texmf-dist: luakeys (16dec22)

commits+karl at tug.org commits+karl at tug.org
Fri Dec 16 22:05:20 CET 2022


Revision: 65294
          http://tug.org/svn/texlive?view=revision&revision=65294
Author:   karl
Date:     2022-12-16 22:05:20 +0100 (Fri, 16 Dec 2022)
Log Message:
-----------
luakeys (16dec22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/luakeys/README.md
    trunk/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.pdf
    trunk/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex
    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/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luakeys/README.md	2022-12-16 21:04:54 UTC (rev 65293)
+++ trunk/Master/texmf-dist/doc/luatex/luakeys/README.md	2022-12-16 21:05:20 UTC (rev 65294)
@@ -97,6 +97,9 @@
   -- Key-value pair definitions.
   defs = { key = { default = 'value' } },
 
+  -- Specify the strings that are recognized as boolean false values.
+  false_aliases = { 'false', 'FALSE', 'False' },
+
   -- lower, snake, upper
   format_keys = { 'snake' },
 
@@ -140,6 +143,8 @@
     end,
   },
 
+  invert_flag = '!',
+
   -- Configure the delimiter that separates list items from each other.
   list_separator = ',',
 
@@ -156,6 +161,9 @@
   -- Configure the delimiter that marks the end of a string.
   quotation_end = '"',
 
+  -- Specify the strings that are recognized as boolean true values.
+  true_aliases = { 'true', 'TRUE', 'True' },
+
   -- { key = { 'value' } } -> { key = 'value' }
   unpack = false,
 }
@@ -166,8 +174,8 @@
 
 `luakeys` is developed using the
 [Lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
-extension in Visual Studio Code. This extension understands the [EmmyLua
-annotations](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations).
+extension in Visual Studio Code. This extension understands the modified
+[EmmyLua annotations](https://github.com/sumneko/lua-language-server/wiki/Annotations).
 The Lua source code documentation is generated with
 [LDoc](https://stevedonovan.github.io/ldoc/manual/doc.md.html).
 

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

Modified: trunk/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex	2022-12-16 21:04:54 UTC (rev 65293)
+++ trunk/Master/texmf-dist/doc/luatex/luakeys/luakeys-doc.tex	2022-12-16 21:05:20 UTC (rev 65294)
@@ -11,6 +11,8 @@
 \usepackage{multicol}
 \usepackage{luacode}
 \usepackage{syntax}
+\usepackage{graphicx}
+
 \usemintedstyle{friendly}
 \BeforeBeginEnvironment{minted}{\begin{mdframed}}
 \AfterEndEnvironment{minted}{\end{mdframed}}
@@ -58,7 +60,7 @@
   \href{https://github.com/Josef-Friedrich/luakeys}
        {github.com/Josef-Friedrich/luakeys}%
 }
-\date{0.9.0 from 2022/11/21}
+\date{0.10.0 from 2022/12/16}
 
 \maketitle
 
@@ -357,7 +359,7 @@
 options are supported: \catcode`_=12
 \directlua{luakeys.print_names('opts')}
 
-\InputLua[firstline=5,lastline=86]{opts/all-opts.lua}
+\InputLua[firstline=5,lastline=94]{opts/all-opts.lua}
 
 \noindent
 The options can also be set globally using the exported table
@@ -539,6 +541,32 @@
 %
 %%
 
+\subsubsection{Option “\texttt{false_aliases}”}
+\label{option:false-aliases}
+
+% Mit den den Optionen \lua{true_aliases} and \lua{false_aliases} können
+% die Zeichenketten festgelegt werden, die vom Parser als Wahrheitswerte
+% erkannt werden.
+The \lua{true_aliases} and \lua{false_aliases} options can be used to
+specify the strings that will be recognized as boolean values by the
+parser.
+% Standardmäßig sind folgende Zeichenketten konfiguriert
+The following strings are configured by default.
+
+\InputLua[firstline=4,lastline=8]{opts/boolean-aliases.lua}
+
+\InputLua[firstline=14,lastline=18]{opts/boolean-aliases.lua}
+
+\InputLua[firstline=24,lastline=28]{opts/boolean-aliases.lua}
+
+% Siehe Abschnitt \label{option:true-aliases} für die entsprechende
+% Option.
+See section \ref{option:true-aliases} for the corresponding option.
+
+%%
+%
+%%
+
 \subsubsection{Option “\texttt{format_keys}”}
 
 % Mit Hilfe der Option \lua{format_keys} können die Schlüssel formatiert
@@ -570,8 +598,8 @@
 
 \item[upper]
 
-% Um alle Schlüssel in \emph{Grossbuchstaben} umzuwandeln, geben sie in der
-% Optionentabelle \lua{upper} an.
+% Um alle Schlüssel in \emph{Grossbuchstaben} umzuwandeln, geben sie in
+% der Optionentabelle \lua{upper} an.
 To convert all keys to \emph{uppercase}, specify \lua{upper} in the
 options table.
 
@@ -611,6 +639,45 @@
 %
 %%
 
+\subsubsection{Option “\texttt{invert_flag}”}
+
+% Wird ein nackter Schlüssel mit einem vorangestellten Ausrufezeichen versehen, so wird sein Standardwert invertiert.
+If a naked key is prefixed with an exclamation mark, its default value
+is inverted.
+% Statt \lua{true} nimmt der Schlüssel jetzt den Wert \lua{falsch} an.
+Instead of \lua{true} the key now takes the value \lua{false}.
+
+\InputLua[firstline=4,lastline=5]{opts/invert-flat.lua}
+
+\noindent
+% Mit der Option \lua{invert_flag} kann dieses Invertierungszeichen
+% geändert werden.
+The \lua{invert_flag} option can be used to change this inversion
+character.
+
+\InputLua[firstline=11,lastline=12]{opts/invert-flat.lua}
+
+\noindent
+% Ist der Standardwert für nackte Schlüssel beispielweise auf \lua{false}
+% gesetzt, so nehmen die mit dem Umkehrungszeichen versehenen nackten
+% Schlüssel den Wert \lua{true} an.
+For example, if the default value for naked keys is set to \lua{false},
+the naked keys prefixed with the invert flat take the value \lua{true}.
+
+\InputLua[firstline=18,lastline=19]{opts/invert-flat.lua}
+
+\noindent
+% Setzen sie die Option \lua{invert_flag} auf \lua{false}, um diese
+% automatische Wertumkehrung zu deaktivieren.
+Set the \lua{invert_flag} option to \lua{false} to disable this
+automatic boolean value inversion.
+
+\InputLua[firstline=25,lastline=26]{opts/invert-flat.lua}
+
+%%
+%
+%%
+
 \subsubsection{Option “\texttt{hooks}”}
 
 % Die folgenden Hooks bzw. Callback-Funktionen ermöglichen es in den
@@ -777,6 +844,15 @@
 %
 %%
 
+\subsubsection{Option “\texttt{true_aliases}”}
+\label{option:true-aliases}
+
+See section \ref{option:false-aliases}.
+
+%%
+%
+%%
+
 \subsubsection{Option “\texttt{unpack}”}
 
 % Mit Hilfe der Option \lua{unpack} werden alle Tabellen, die nur aus
@@ -1841,6 +1917,12 @@
 \end{document}
 \end{minted}
 
+\section{Activity diagramm of the parsing process}
+
+\begin{center}
+\includegraphics[width=0.8\linewidth]{Activity-Diagramm.eps}
+\end{center}
+
 %-----------------------------------------------------------------------
 %
 %-----------------------------------------------------------------------
@@ -1947,7 +2029,7 @@
   “quotation_end”.
 * Extend the documentation about the option “format_keys”.
 }
-\changes{0.9.0}{2022/11/21}{
+\changes{0.10.0}{2022/12/16}{
 * 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
@@ -1955,6 +2037,12 @@
 * Add a new function called “any(value)” in the “is” table that accepts
   any data type.
 }
+\changes{0.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.
+}
+
 \pagebreak
 \PrintChanges
 \pagebreak

Modified: trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty	2022-12-16 21:04:54 UTC (rev 65293)
+++ trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys-debug.sty	2022-12-16 21:05:20 UTC (rev 65294)
@@ -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

Modified: trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua	2022-12-16 21:04:54 UTC (rev 65293)
+++ trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.lua	2022-12-16 21:05:20 UTC (rev 65294)
@@ -178,15 +178,18 @@
     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 @@
     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 @@
         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 @@
         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 @@
       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 @@
 -- @section
 
 local export = {
-  version = { 0, 9, 0 },
+  version = { 0, 10, 0 },
 
   namespace = namespace,
 

Modified: trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty	2022-12-16 21:04:54 UTC (rev 65293)
+++ trunk/Master/texmf-dist/tex/luatex/luakeys/luakeys.sty	2022-12-16 21:05:20 UTC (rev 65294)
@@ -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')}



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