texlive[56693] Master/texmf-dist: expkv-cs (18oct20)

commits+karl at tug.org commits+karl at tug.org
Sun Oct 18 22:50:36 CEST 2020


Revision: 56693
          http://tug.org/svn/texlive?view=revision&revision=56693
Author:   karl
Date:     2020-10-18 22:50:35 +0200 (Sun, 18 Oct 2020)
Log Message:
-----------
expkv-cs (18oct20)

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	2020-10-18 20:50:19 UTC (rev 56692)
+++ trunk/Master/texmf-dist/doc/latex/expkv-cs/README.md	2020-10-18 20:50:35 UTC (rev 56693)
@@ -1,7 +1,7 @@
 -------------------------------------------------------------------------------
 # expkv-cs -- define expandable key=val macros using expkv
 
-Version 2020-10-11 v0.5
+Version 2020-10-18 v0.6
 
 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	2020-10-18 20:50:19 UTC (rev 56692)
+++ trunk/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx	2020-10-18 20:50:35 UTC (rev 56693)
@@ -800,8 +800,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.5}
-\def\ekvcDate{2020-10-11}
+\def\ekvcVersion{0.6}
+\def\ekvcDate{2020-10-18}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -821,6 +821,22 @@
 % |\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 |\chardef|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 |\chardef| variant, we have to actually provide
+%   such a token.
+%    \begin{macrocode}
+\chardef\ekvc at zero0
+%    \end{macrocode}
+% \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.
@@ -1378,12 +1394,11 @@
                   ####1%
                 {%
                   \unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
-                  ####1\unexpanded{\ekvc at mark}{ }%
+                  ####1\unexpanded{\ekvc at mark\ekvc at zero}%
                   \unexpanded\expandafter
                     {%
-                      \csname ekvc at hashmark@#1\endcsname
-                      {\ekvc at err@missing at hash{#1} }%
-                      \ekvc at mark{}\ekvc at stop
+                      \csname ekvc at hashmark@#1\endcsname\ekvc at zero
+                      \ekvc at mark{\ekvc at err@missing at hash{#1}}\ekvc at stop
                     }%
                 }%
               \long\gdef
@@ -1438,12 +1453,12 @@
 %   hash macro exists) and then call that hash-grabbing macro that will also
 %   test whether the hash is inside of |#2| or not.
 %    \begin{macrocode}
-\long\def\ekvcValue#1#2%
+\long\def\ekvcValue#1%
   {%
-    \romannumeral`\^^@%
+    \romannumeral
     \ekv at ifdefined{ekvc at safehash@#1}%
-      {\csname ekvc at safehash@#1\endcsname{#2}}%
-      {\ekvc at err@unknown at hash{#1} }% keep this space
+      {\csname ekvc at safehash@#1\endcsname}%
+      {\ekvc at err@unknown at hash{#1}\@firstoftwo\ekvc at zero}%
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1456,15 +1471,19 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\ekvcValueSplit}
+% \begin{macro}{\ekvcValueSplit,\ekvcValueSplit at recover}
 %   This splits off a single value.
 %    \begin{macrocode}
-\long\def\ekvcValueSplit#1#2#3%
+\long\def\ekvcValueSplit#1%
   {%
     \ekv at ifdefined{ekvc at safesplithash@#1}%
-      {\csname ekvc at safesplithash@#1\endcsname{#2}{#3}}%
-      {\ekvc at err@unknown at hash{#1}#3{}{#2}}%
+      {\csname ekvc at safesplithash@#1\endcsname}%
+      {\ekvc at err@unknown at hash{#1}\ekvcValueSplit at recover}%
   }
+\long\def\ekvcValueSplit at recover#1#2%
+  {%
+    #2{#1}{}%
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1494,17 +1513,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[internal]{\ekvcValueSplitFast at a}
-%   This step then expands the hash function once and passes the result to |#3|
-%   which should be a single control sequence.
-%    \begin{macrocode}
-\long\def\ekvcValueSplitFast@#1#2#3%
-  {%
-    \expandafter#3\expandafter{#1#2\ekvc at stop}%
-  }
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{macro}[internal]
 %   {
 %     \ekvc at safehash@,\ekvc at fasthash@,
@@ -1516,7 +1524,7 @@
 %   thrown by |\ekvcValueFast| in three expansion steps. The safe hash variant
 %   has to also stop the |\romannumeral| expansion.
 %    \begin{macrocode}
-\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash\@gobble{} }% keep this space
+\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash\ekvc at zero}
 \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	2020-10-18 20:50:19 UTC (rev 56692)
+++ trunk/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex	2020-10-18 20:50:35 UTC (rev 56693)
@@ -35,11 +35,12 @@
 \else
   \expandafter\endinput
 \fi
-\def\ekvcVersion{0.5}
-\def\ekvcDate{2020-10-11}
+\def\ekvcVersion{0.6}
+\def\ekvcDate{2020-10-18}
 \csname ekvc at tmp\endcsname
 \expandafter\chardef\csname ekvc at tmp\endcsname=\catcode`\@
 \catcode`\@=11
+\chardef\ekvc at zero0
 \newcount\ekvc at keycount
 \def\ekvc at long{}
 \def\ekvc at any@long{}
@@ -397,12 +398,11 @@
                   ####1%
                 {%
                   \unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
-                  ####1\unexpanded{\ekvc at mark}{ }%
+                  ####1\unexpanded{\ekvc at mark\ekvc at zero}%
                   \unexpanded\expandafter
                     {%
-                      \csname ekvc at hashmark@#1\endcsname
-                      {\ekvc at err@missing at hash{#1} }%
-                      \ekvc at mark{}\ekvc at stop
+                      \csname ekvc at hashmark@#1\endcsname\ekvc at zero
+                      \ekvc at mark{\ekvc at err@missing at hash{#1}}\ekvc at stop
                     }%
                 }%
               \long\gdef
@@ -449,20 +449,24 @@
         \endgroup
       }%
   }
-\long\def\ekvcValue#1#2%
+\long\def\ekvcValue#1%
   {%
-    \romannumeral`\^^@%
+    \romannumeral
     \ekv at ifdefined{ekvc at safehash@#1}%
-      {\csname ekvc at safehash@#1\endcsname{#2}}%
-      {\ekvc at err@unknown at hash{#1} }% keep this space
+      {\csname ekvc at safehash@#1\endcsname}%
+      {\ekvc at err@unknown at hash{#1}\@firstoftwo\ekvc at zero}%
   }
 \long\def\ekvcValueFast#1#2{\csname ekvc at fasthash@#1\endcsname#2\ekvc at stop}
-\long\def\ekvcValueSplit#1#2#3%
+\long\def\ekvcValueSplit#1%
   {%
     \ekv at ifdefined{ekvc at safesplithash@#1}%
-      {\csname ekvc at safesplithash@#1\endcsname{#2}{#3}}%
-      {\ekvc at err@unknown at hash{#1}#3{}{#2}}%
+      {\csname ekvc at safesplithash@#1\endcsname}%
+      {\ekvc at err@unknown at hash{#1}\ekvcValueSplit at recover}%
   }
+\long\def\ekvcValueSplit at recover#1#2%
+  {%
+    #2{#1}{}%
+  }
 \long\def\ekvc at safe@found at hash#1#2\ekvc at stop#3%
   {%
     #3{#2}{#1}%
@@ -475,11 +479,7 @@
   {%
     \csname ekvc at fastsplithash@#1\endcsname#2\ekvc at stop
   }
-\long\def\ekvcValueSplitFast@#1#2#3%
-  {%
-    \expandafter#3\expandafter{#1#2\ekvc at stop}%
-  }
-\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash\@gobble{} }% keep this space
+\long\def\ekvc at safehash@#1{\ekvc at err@empty at hash\ekvc at zero}
 \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.