summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex')
-rw-r--r--Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex104
1 files changed, 85 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex b/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
index 83df70fc0ea..b5a89d29fbb 100644
--- a/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
+++ b/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% --------------------------------------------------------------
%%
-%% Copyright (C) 2020 Jonathan P. Spratte
+%% Copyright (C) 2020-2021 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -35,8 +35,8 @@
\else
\expandafter\endinput
\fi
-\def\ekvdVersion{0.7}
-\def\ekvdDate{2020-12-28}
+\def\ekvdVersion{0.8}
+\def\ekvdDate{2021-04-10}
\csname ekvd@tmp\endcsname
\expandafter\chardef\csname ekvd@tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -557,12 +557,7 @@
}
\protected\long\expandafter\def\csname ekvd@t@unknown-choice\endcsname#1#2%
{%
- \ifx\ekvd@ifnew\ekvd@assert@new
- \ekv@fi@firstoftwo
- \fi
- \@secondoftwo
- {\ekv@ifdefined{\ekvd@unknown@choice@name\ekvd@set{#1}}\ekvd@err@not@new}%
- \@firstofone
+ \ekvd@assert@new@for@name{\ekvd@unknown@choice@name\ekvd@set{#1}}%
{%
\ekvd@assert@arg
{%
@@ -573,6 +568,72 @@
}%
}%
}
+\protected\long\def\ekvd@t@unknown#1#2%
+ {%
+ \ekv@ifdefined{ekvd@type@unknown@\detokenize{#1}}%
+ {\csname ekvd@type@unknown@\detokenize{#1}\endcsname{#2}}%
+ \ekvd@err@misused@unknown
+ }
+\protected\long\def\ekvd@type@unknown@noval#1%
+ {%
+ \ekvd@assert@new@for@name{\ekv@name\ekvd@set{}uN}%
+ {%
+ \ekvd@assert@arg
+ {%
+ \ekvd@assert@not@also
+ \ekvd@assert@not@long
+ \ekvd@prot\ekvdefunknownNoVal\ekvd@set{#1}%
+ }%
+ }%
+ }
+\protected\long\def\ekvd@type@unknown@code#1%
+ {%
+ \ekvd@assert@new@for@name{\ekv@name\ekvd@set{}u}%
+ {%
+ \ekvd@assert@arg
+ {%
+ \ekvd@assert@not@also
+ \begingroup
+ \def\ekvd@tmp##1##2{#1}%
+ \ekv@exparg
+ {%
+ \endgroup
+ \ekvd@prot\ekvd@long\ekvdefunknown\ekvd@set
+ }%
+ {\ekvd@tmp{##2}{##1}}%
+ }%
+ }%
+ }
+\protected\edef\ekvd@type@unknown@redirect#1%
+ {%
+ \expandafter\noexpand\csname ekvd@type@unknown@redirect-code\endcsname{#1}%
+ \expandafter\noexpand\csname ekvd@type@unknown@redirect-noval\endcsname{#1}%
+ }
+\protected\expandafter\def\csname ekvd@type@unknown@redirect-code\endcsname#1%
+ {%
+ \ekvd@assert@new@for@name{\ekv@name\ekvd@set{}u}%
+ {%
+ \ekvd@assert@arg
+ {%
+ \ekvd@assert@not@also
+ \ekvd@assert@not@protected
+ \expandafter\ekvredirectunknown\expandafter{\ekvd@set}{#1}%
+ }%
+ }%
+ }
+\protected\expandafter\def\csname ekvd@type@unknown@redirect-noval\endcsname#1%
+ {%
+ \ekvd@assert@new@for@name{\ekv@name\ekvd@set{}uN}%
+ {%
+ \ekvd@assert@arg
+ {%
+ \ekvd@assert@not@also
+ \ekvd@assert@not@protected
+ \ekvd@assert@not@long
+ \expandafter\ekvredirectunknownNoVal\expandafter{\ekvd@set}{#1}%
+ }%
+ }%
+ }
\def\ekvd@h@choice#1%
{%
\expandafter\ekvd@h@choice@
@@ -733,6 +794,15 @@
{\csname ekvifdefined#1\endcsname\ekvd@set{#2}{\ekvd@err@not@new}}
\def\ekvd@assert@not@new
{\ifx\ekvd@ifnew\ekvd@assert@new\ekvd@err@no@prefix{new}\fi}
+\def\ekvd@assert@new@for@name#1%
+ {%
+ \ifx\ekvd@ifnew\ekvd@assert@new
+ \ekv@fi@firstoftwo
+ \fi
+ \@secondoftwo
+ {\ekv@ifdefined{#1}\ekvd@err@not@new}%
+ \@firstofone
+ }
\protected\def\ekvd@if@not@already@choice#1%
{%
\expandafter\ekvd@if@not@already@choice@a
@@ -794,6 +864,8 @@
}
\protected\def\ekvd@err@not@new
{\ekvd@errm{The key for `\ekvd@cur' is already defined}}
+\protected\long\def\ekvd@err@misused@unknown
+ {\ekvd@errm{Misuse of the unknown type found while processing `\ekvd@cur'}}
\def\ekvd@err@choice@invalid#1%
{%
\ekvd@err@choice@invalid@#1\ekv@stop
@@ -817,18 +889,12 @@
{\ekvd@err{invalid choice `#3' (`#2', set `#1')}}%
}
}
-\begingroup
-\edef\ekvd@err
+\def\ekvd@err#1%
{%
- \endgroup
- \unexpanded{\long\def\ekvd@err}##1%
- {%
- \unexpanded{\expandafter\ekv@err@\@firstofone}%
- {\unexpanded\expandafter{\csname ! expkv-def Error:\endcsname}##1.}%
- \unexpanded{\ekv@stop}%
- }%
+ \long\def\ekvd@err##1{\expandafter\ekv@err@\@firstofone{#1##1.}\ekv@stop}%
}
-\ekvd@err
+\begingroup\expandafter\endgroup
+\expandafter\ekvd@err\csname ! expkv-def Error:\endcsname
\catcode`\@=\ekvd@tmp
%%
%%