texlive[59451] Master/texmf-dist: expkv-cs (3jun21)

commits+karl at tug.org commits+karl at tug.org
Thu Jun 3 22:48:52 CEST 2021


Revision: 59451
          http://tug.org/svn/texlive?view=revision&revision=59451
Author:   karl
Date:     2021-06-03 22:48:51 +0200 (Thu, 03 Jun 2021)
Log Message:
-----------
expkv-cs (3jun21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/expkv-cs/README.md
    trunk/Master/texmf-dist/doc/latex/expkv-cs/expkv-cs.pdf
    trunk/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
    trunk/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex

Modified: trunk/Master/texmf-dist/doc/latex/expkv-cs/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-cs/README.md	2021-06-03 20:48:40 UTC (rev 59450)
+++ trunk/Master/texmf-dist/doc/latex/expkv-cs/README.md	2021-06-03 20:48:51 UTC (rev 59451)
@@ -1,7 +1,7 @@
 -------------------------------------------------------------------------------
 # expkv-cs -- define expandable key=val macros using expkv
 
-Version 2021-05-24 v0.9
+Version 2021-06-03 v0.10
 
 Released under the LaTeX Project Public License v1.3c or later
 See http://www.latex-project.org/lppl.txt

Modified: trunk/Master/texmf-dist/doc/latex/expkv-cs/expkv-cs.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx	2021-06-03 20:48:40 UTC (rev 59450)
+++ trunk/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx	2021-06-03 20:48:51 UTC (rev 59451)
@@ -282,7 +282,7 @@
 \DoNotIndex{\protected,\ProvidesFile,\ProvidesPackage,\relax,\space,\advance}
 \DoNotIndex{\@,\unexpanded,\string,\expanded,\dimexpr,\global,\glueexpr,\hbox}
 \DoNotIndex{\numexpr,\RequirePackage,\setbox,\the,\unless,\xdef,\gdef,\newcount}
-\DoNotIndex{\romannumeral,\^,\@firstofone,\@firstoftwo,\@gobble}
+\DoNotIndex{\^,\@firstofone,\@firstoftwo,\@gobble}
 \DoNotIndex{\ifcsname}
 \DoNotIndex{\ifx}
 \DoNotIndex{\ifnum}
@@ -506,13 +506,15 @@
 %   \begin{syntax}
 %     \cs{ekvcValue}\{\key\}\marg{key list}
 %   \end{syntax}
-%   This is a safe (but slow) way to access your keys in a hash variant. \key\
+%   This is a safe way to access your keys in a hash variant. \key\
 %   is the key which's \val\ you want to use out of the \meta{key list}.
 %   \meta{key list} should be the key list argument forwarded to your underlying
 %   macro by |\ekvcHash|, |\ekvcHashAndForward|, or |\ekvcHashAndUse|. It will
 %   be tested whether the hash function to access that \key\ exists, the \key\
 %   argument is not empty, and that the \meta{key list} really contains a \val\
-%   of that \key. This macro needs exactly two steps of expansion.
+%   of that \key. This macro needs exactly two steps of expansion and if used
+%   inside of an |\edef| or |\expanded| context will protect the \val\ from
+%   further expanding.
 % \end{function}
 %
 % \begin{function}{\ekvcValueFast}
@@ -1125,8 +1127,8 @@
 % \begin{macro}{\ekvcVersion,\ekvcDate}
 % We're on our first input, so lets store the version and date in a macro.
 %    \begin{macrocode}
-\def\ekvcVersion{0.9}
-\def\ekvcDate{2021-05-24}
+\def\ekvcVersion{0.10}
+\def\ekvcDate{2021-06-03}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1146,21 +1148,6 @@
 % |\ekvc at tmp| will be reused later, but we don't need it to ever store
 % information long-term after \expkvc\ was initialized.
 %
-% \begin{macro}[internal]{\ekvc at zero}
-%   There are different ways to define a |\romannumeral| expansion. If the
-%   control is never given to user input, the fastest way is to just execute
-%   your code and use a |\dimendef|ed zero to end it afterwards.  If the control
-%   is given to user input (so user input should be expanded) the fastest and
-%   best way is to use |\romannumeral`\^^@|, this will expand the user input
-%   until something unexpandable is found or a space (which would then be
-%   gobbled). However, we want to use the former approach since we don't want to
-%   expand any user input, just make sure own code is expanded in two steps.
-%   Since we want to use the |\dimendef| variant, we have to actually provide
-%   such a token. Since both plain \TeX\ and \LaTeX\ define |\z@| we can use
-%   that (but we use a private name for it). Luckily, \expkv\ already contains
-%   |\ekv at zero|, which we can use in \expkvc.
-% \end{macro}
-%
 % \begin{macro}[internal]{\ekvc at keycount}
 %   We'll need to keep count how many keys must be defined for each macro in the
 %   |split| variants.
@@ -1713,8 +1700,8 @@
 % \end{macro}
 %
 % \begin{macro}[internal]{\ekvc at setup@hashmacro}
-%   The safe hash macros will be executed inside of a |\romannumeral| expansion
-%   context, so they have to insert a stop mark for that once they are done.
+%   The safe hash macros will be executed inside of an |\unexpanded| expansion
+%   context, so they have to insert braces for that once they are done.
 %   Most of the tests which have to be executed will already be done, but we
 %   have to play safe if the hash doesn't show up in the hash list. Therefore we
 %   use some |\ekvc at mark|s and |\ekvc at stop| to throw errors if the hash isn't
@@ -1723,7 +1710,7 @@
 %    \begin{macrocode}
 \protected\def\ekvc at setup@hashmacro#1%
   {%
-    \ekv at ifdefined{ekvc at hash@#1}{}%
+    \ekv at ifdefined{ekvc at fasthash@#1}{}%
       {%
         \begingroup
           \edef\ekvc at tmp
@@ -1739,10 +1726,10 @@
                   ####1%
                 {%
                   \unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
-                  ####1\unexpanded{\ekvc at mark\ekv at zero}%
+                  ####1\unexpanded{\ekvc at mark}{}%
                   \unexpanded\expandafter
                     {%
-                      \csname ekvc at hashmark@#1\endcsname\ekv at zero
+                      \csname ekvc at hashmark@#1\endcsname{}%
                       \ekvc at mark{\ekvc at err@missing at hash{#1}}\ekvc at stop
                     }%
                 }%
@@ -1753,7 +1740,7 @@
                   ####2####3\unexpanded{\ekvc at mark}####4####5%
                   \unexpanded{\ekvc at stop}%
                 {%
-                  ####4####2%
+                  ####4{####2}%
                 }%
               \long\gdef\unexpanded\expandafter
                 {\csname ekvc at fastsplithash@#1\endcsname}%
@@ -1800,10 +1787,10 @@
 %    \begin{macrocode}
 \long\def\ekvcValue#1%
   {%
-    \romannumeral
+    \unexpanded
     \ekv at ifdefined{ekvc at safehash@#1}%
       {\csname ekvc at safehash@#1\endcsname}%
-      {\ekvc at err@unknown at hash{#1}\@firstoftwo\ekv at zero}%
+      {\ekvc at err@unknown at hash{#1}\@firstoftwo{{}}}%
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1867,9 +1854,9 @@
 %   without affecting performance by just defining the macro that would be build
 %   in that case. There is of course a downside to this, the error will not be
 %   thrown by |\ekvcValueFast| in three expansion steps. The safe hash variant
-%   has to also stop the |\romannumeral| expansion.
+%   has to also stop the |\unexpanded| expansion.
 %    \begin{macrocode}
-\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash\ekv at zero}
+\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash{}}
 \long\def\ekvc at fasthash@#1\ekvc at stop{\ekvc at err@empty at hash}
 \long\def\ekvc at safesplithash@#1#2{\ekvc at err@empty at hash#2{#1}{}}
 \long\def\ekvc at fastsplithash@#1\ekvc at stop#2{\ekvc at err@empty at hash#2{#1}{}}

Modified: trunk/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex	2021-06-03 20:48:40 UTC (rev 59450)
+++ trunk/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex	2021-06-03 20:48:51 UTC (rev 59451)
@@ -35,8 +35,8 @@
 \else
   \expandafter\endinput
 \fi
-\def\ekvcVersion{0.9}
-\def\ekvcDate{2021-05-24}
+\def\ekvcVersion{0.10}
+\def\ekvcDate{2021-06-03}
 \csname ekvc at tmp\endcsname
 \expandafter\chardef\csname ekvc at tmp\endcsname=\catcode`\@
 \catcode`\@=11
@@ -394,7 +394,7 @@
   }
 \protected\def\ekvc at setup@hashmacro#1%
   {%
-    \ekv at ifdefined{ekvc at hash@#1}{}%
+    \ekv at ifdefined{ekvc at fasthash@#1}{}%
       {%
         \begingroup
           \edef\ekvc at tmp
@@ -410,10 +410,10 @@
                   ####1%
                 {%
                   \unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
-                  ####1\unexpanded{\ekvc at mark\ekv at zero}%
+                  ####1\unexpanded{\ekvc at mark}{}%
                   \unexpanded\expandafter
                     {%
-                      \csname ekvc at hashmark@#1\endcsname\ekv at zero
+                      \csname ekvc at hashmark@#1\endcsname{}%
                       \ekvc at mark{\ekvc at err@missing at hash{#1}}\ekvc at stop
                     }%
                 }%
@@ -424,7 +424,7 @@
                   ####2####3\unexpanded{\ekvc at mark}####4####5%
                   \unexpanded{\ekvc at stop}%
                 {%
-                  ####4####2%
+                  ####4{####2}%
                 }%
               \long\gdef\unexpanded\expandafter
                 {\csname ekvc at fastsplithash@#1\endcsname}%
@@ -463,10 +463,10 @@
   }
 \long\def\ekvcValue#1%
   {%
-    \romannumeral
+    \unexpanded
     \ekv at ifdefined{ekvc at safehash@#1}%
       {\csname ekvc at safehash@#1\endcsname}%
-      {\ekvc at err@unknown at hash{#1}\@firstoftwo\ekv at zero}%
+      {\ekvc at err@unknown at hash{#1}\@firstoftwo{{}}}%
   }
 \long\def\ekvcValueFast#1#2{\csname ekvc at fasthash@#1\endcsname#2\ekvc at stop}
 \long\def\ekvcValueSplit#1%
@@ -491,7 +491,7 @@
   {%
     \csname ekvc at fastsplithash@#1\endcsname#2\ekvc at stop
   }
-\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash\ekv at zero}
+\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash{}}
 \long\def\ekvc at fasthash@#1\ekvc at stop{\ekvc at err@empty at hash}
 \long\def\ekvc at safesplithash@#1#2{\ekvc at err@empty at hash#2{#1}{}}
 \long\def\ekvc at fastsplithash@#1\ekvc at stop#2{\ekvc at err@empty at hash#2{#1}{}}



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