summaryrefslogtreecommitdiff
path: root/macros/generic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-19 03:01:17 +0000
committerNorbert Preining <norbert@preining.info>2020-10-19 03:01:17 +0000
commit3fdf82ec77f470d0bf97c17c3085ef2fd58ea65f (patch)
treeb5a02fdc2b644489adba7459ebbf1d5d2f2739f5 /macros/generic
parent94b94cfd7a578d12bd5335c40e5f43400140c3f4 (diff)
CTAN sync 202010190301
Diffstat (limited to 'macros/generic')
-rw-r--r--macros/generic/expkv-cs/README.md2
-rw-r--r--macros/generic/expkv-cs/expkv-cs.dtx60
-rw-r--r--macros/generic/expkv-cs/expkv-cs.pdfbin321211 -> 321681 bytes
3 files changed, 35 insertions, 27 deletions
diff --git a/macros/generic/expkv-cs/README.md b/macros/generic/expkv-cs/README.md
index d7ca7d3bce..704f877adf 100644
--- a/macros/generic/expkv-cs/README.md
+++ b/macros/generic/expkv-cs/README.md
@@ -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
diff --git a/macros/generic/expkv-cs/expkv-cs.dtx b/macros/generic/expkv-cs/expkv-cs.dtx
index 28218c7984..7dd4c6aad6 100644
--- a/macros/generic/expkv-cs/expkv-cs.dtx
+++ b/macros/generic/expkv-cs/expkv-cs.dtx
@@ -800,8 +800,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.5}
-\def\ekvcDate{2020-10-11}
+\def\ekvcVersion{0.6}
+\def\ekvcDate{2020-10-18}
% \end{macrocode}
% \end{macro}
%
@@ -821,6 +821,22 @@ 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 |\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@zero0
+% \end{macrocode}
+% \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.
@@ -1378,12 +1394,11 @@ and the derived files expkv-cs.pdf
####1%
{%
\unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
- ####1\unexpanded{\ekvc@mark}{ }%
+ ####1\unexpanded{\ekvc@mark\ekvc@zero}%
\unexpanded\expandafter
{%
- \csname ekvc@hashmark@#1\endcsname
- {\ekvc@err@missing@hash{#1} }%
- \ekvc@mark{}\ekvc@stop
+ \csname ekvc@hashmark@#1\endcsname\ekvc@zero
+ \ekvc@mark{\ekvc@err@missing@hash{#1}}\ekvc@stop
}%
}%
\long\gdef
@@ -1438,12 +1453,12 @@ and the derived files expkv-cs.pdf
% 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@ifdefined{ekvc@safehash@#1}%
- {\csname ekvc@safehash@#1\endcsname{#2}}%
- {\ekvc@err@unknown@hash{#1} }% keep this space
+ {\csname ekvc@safehash@#1\endcsname}%
+ {\ekvc@err@unknown@hash{#1}\@firstoftwo\ekvc@zero}%
}
% \end{macrocode}
% \end{macro}
@@ -1456,14 +1471,18 @@ and the derived files expkv-cs.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekvcValueSplit}
+% \begin{macro}{\ekvcValueSplit,\ekvcValueSplit@recover}
% This splits off a single value.
% \begin{macrocode}
-\long\def\ekvcValueSplit#1#2#3%
+\long\def\ekvcValueSplit#1%
{%
\ekv@ifdefined{ekvc@safesplithash@#1}%
- {\csname ekvc@safesplithash@#1\endcsname{#2}{#3}}%
- {\ekvc@err@unknown@hash{#1}#3{}{#2}}%
+ {\csname ekvc@safesplithash@#1\endcsname}%
+ {\ekvc@err@unknown@hash{#1}\ekvcValueSplit@recover}%
+ }
+\long\def\ekvcValueSplit@recover#1#2%
+ {%
+ #2{#1}{}%
}
% \end{macrocode}
% \end{macro}
@@ -1494,17 +1513,6 @@ and the derived files expkv-cs.pdf
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[internal]{\ekvcValueSplitFast@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@stop}%
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}[internal]
% {
% \ekvc@safehash@,\ekvc@fasthash@,
@@ -1516,7 +1524,7 @@ and the derived files expkv-cs.pdf
% thrown by |\ekvcValueFast| in three expansion steps. The safe hash variant
% has to also stop the |\romannumeral| expansion.
% \begin{macrocode}
-\long\def\ekvc@safehash@#1{\ekvc@err@empty@hash\@gobble{} }% keep this space
+\long\def\ekvc@safehash@#1{\ekvc@err@empty@hash\ekvc@zero}
\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/macros/generic/expkv-cs/expkv-cs.pdf b/macros/generic/expkv-cs/expkv-cs.pdf
index e2188f691a..d8b76f5514 100644
--- a/macros/generic/expkv-cs/expkv-cs.pdf
+++ b/macros/generic/expkv-cs/expkv-cs.pdf
Binary files differ