summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-06-03 20:48:51 +0000
committerKarl Berry <karl@freefriends.org>2021-06-03 20:48:51 +0000
commit26d6a69b3340ebf6ecc0c57feb17f2f8d5ad7636 (patch)
treebd20db8c33aa2104f5b45a168bd36cacba135269 /Master/texmf-dist
parent4ba2c89964e65f1841e894193920d61268fdc6ae (diff)
expkv-cs (3jun21)
git-svn-id: svn://tug.org/texlive/trunk@59451 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/expkv-cs/README.md2
-rw-r--r--Master/texmf-dist/doc/latex/expkv-cs/expkv-cs.pdfbin363784 -> 361934 bytes
-rw-r--r--Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx47
-rw-r--r--Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex18
4 files changed, 27 insertions, 40 deletions
diff --git a/Master/texmf-dist/doc/latex/expkv-cs/README.md b/Master/texmf-dist/doc/latex/expkv-cs/README.md
index a9df8b801f9..89ab6b6de69 100644
--- a/Master/texmf-dist/doc/latex/expkv-cs/README.md
+++ b/Master/texmf-dist/doc/latex/expkv-cs/README.md
@@ -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
diff --git a/Master/texmf-dist/doc/latex/expkv-cs/expkv-cs.pdf b/Master/texmf-dist/doc/latex/expkv-cs/expkv-cs.pdf
index 50dd5124bff..1e19349f76e 100644
--- a/Master/texmf-dist/doc/latex/expkv-cs/expkv-cs.pdf
+++ b/Master/texmf-dist/doc/latex/expkv-cs/expkv-cs.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx b/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
index 38a70349d74..55a6a134aa4 100644
--- a/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
+++ b/Master/texmf-dist/source/latex/expkv-cs/expkv-cs.dtx
@@ -282,7 +282,7 @@ and the derived files expkv-cs.pdf
\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 @@ and the derived files expkv-cs.pdf
% \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 @@ and the derived files expkv-cs.pdf
% \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 @@ and the derived files expkv-cs.pdf
% |\ekvc@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@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@zero|, which we can use in \expkvc.
-% \end{macro}
-%
% \begin{macro}[internal]{\ekvc@keycount}
% We'll need to keep count how many keys must be defined for each macro in the
% |split| variants.
@@ -1713,8 +1700,8 @@ and the derived files expkv-cs.pdf
% \end{macro}
%
% \begin{macro}[internal]{\ekvc@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@mark|s and |\ekvc@stop| to throw errors if the hash isn't
@@ -1723,7 +1710,7 @@ and the derived files expkv-cs.pdf
% \begin{macrocode}
\protected\def\ekvc@setup@hashmacro#1%
{%
- \ekv@ifdefined{ekvc@hash@#1}{}%
+ \ekv@ifdefined{ekvc@fasthash@#1}{}%
{%
\begingroup
\edef\ekvc@tmp
@@ -1739,10 +1726,10 @@ and the derived files expkv-cs.pdf
####1%
{%
\unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
- ####1\unexpanded{\ekvc@mark\ekv@zero}%
+ ####1\unexpanded{\ekvc@mark}{}%
\unexpanded\expandafter
{%
- \csname ekvc@hashmark@#1\endcsname\ekv@zero
+ \csname ekvc@hashmark@#1\endcsname{}%
\ekvc@mark{\ekvc@err@missing@hash{#1}}\ekvc@stop
}%
}%
@@ -1753,7 +1740,7 @@ and the derived files expkv-cs.pdf
####2####3\unexpanded{\ekvc@mark}####4####5%
\unexpanded{\ekvc@stop}%
{%
- ####4####2%
+ ####4{####2}%
}%
\long\gdef\unexpanded\expandafter
{\csname ekvc@fastsplithash@#1\endcsname}%
@@ -1800,10 +1787,10 @@ and the derived files expkv-cs.pdf
% \begin{macrocode}
\long\def\ekvcValue#1%
{%
- \romannumeral
+ \unexpanded
\ekv@ifdefined{ekvc@safehash@#1}%
{\csname ekvc@safehash@#1\endcsname}%
- {\ekvc@err@unknown@hash{#1}\@firstoftwo\ekv@zero}%
+ {\ekvc@err@unknown@hash{#1}\@firstoftwo{{}}}%
}
% \end{macrocode}
% \end{macro}
@@ -1867,9 +1854,9 @@ and the derived files expkv-cs.pdf
% 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@safehash@#1{\ekvc@err@empty@hash\ekv@zero}
+\long\def\ekvc@safehash@#1{\ekvc@err@empty@hash{}}
\long\def\ekvc@fasthash@#1\ekvc@stop{\ekvc@err@empty@hash}
\long\def\ekvc@safesplithash@#1#2{\ekvc@err@empty@hash#2{#1}{}}
\long\def\ekvc@fastsplithash@#1\ekvc@stop#2{\ekvc@err@empty@hash#2{#1}{}}
diff --git a/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex b/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex
index 5bdadad97a9..500356b7069 100644
--- a/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex
+++ b/Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex
@@ -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@tmp\endcsname
\expandafter\chardef\csname ekvc@tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -394,7 +394,7 @@
}
\protected\def\ekvc@setup@hashmacro#1%
{%
- \ekv@ifdefined{ekvc@hash@#1}{}%
+ \ekv@ifdefined{ekvc@fasthash@#1}{}%
{%
\begingroup
\edef\ekvc@tmp
@@ -410,10 +410,10 @@
####1%
{%
\unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
- ####1\unexpanded{\ekvc@mark\ekv@zero}%
+ ####1\unexpanded{\ekvc@mark}{}%
\unexpanded\expandafter
{%
- \csname ekvc@hashmark@#1\endcsname\ekv@zero
+ \csname ekvc@hashmark@#1\endcsname{}%
\ekvc@mark{\ekvc@err@missing@hash{#1}}\ekvc@stop
}%
}%
@@ -424,7 +424,7 @@
####2####3\unexpanded{\ekvc@mark}####4####5%
\unexpanded{\ekvc@stop}%
{%
- ####4####2%
+ ####4{####2}%
}%
\long\gdef\unexpanded\expandafter
{\csname ekvc@fastsplithash@#1\endcsname}%
@@ -463,10 +463,10 @@
}
\long\def\ekvcValue#1%
{%
- \romannumeral
+ \unexpanded
\ekv@ifdefined{ekvc@safehash@#1}%
{\csname ekvc@safehash@#1\endcsname}%
- {\ekvc@err@unknown@hash{#1}\@firstoftwo\ekv@zero}%
+ {\ekvc@err@unknown@hash{#1}\@firstoftwo{{}}}%
}
\long\def\ekvcValueFast#1#2{\csname ekvc@fasthash@#1\endcsname#2\ekvc@stop}
\long\def\ekvcValueSplit#1%
@@ -491,7 +491,7 @@
{%
\csname ekvc@fastsplithash@#1\endcsname#2\ekvc@stop
}
-\long\def\ekvc@safehash@#1{\ekvc@err@empty@hash\ekv@zero}
+\long\def\ekvc@safehash@#1{\ekvc@err@empty@hash{}}
\long\def\ekvc@fasthash@#1\ekvc@stop{\ekvc@err@empty@hash}
\long\def\ekvc@safesplithash@#1#2{\ekvc@err@empty@hash#2{#1}{}}
\long\def\ekvc@fastsplithash@#1\ekvc@stop#2{\ekvc@err@empty@hash#2{#1}{}}