From 4d7993d55cbb38c06a220e7ce46c92d8a3f234b4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 27 Feb 2020 22:05:11 +0000 Subject: expkv (27feb20) git-svn-id: svn://tug.org/texlive/trunk@53939 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/expkv/expkv.tex | 37 +++++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/generic/expkv/expkv.tex b/Master/texmf-dist/tex/generic/expkv/expkv.tex index aed5e127177..fc64fb4fac2 100644 --- a/Master/texmf-dist/tex/generic/expkv/expkv.tex +++ b/Master/texmf-dist/tex/generic/expkv/expkv.tex @@ -39,8 +39,8 @@ \else \expandafter\endinput \fi -\def\ekvVersion{0.4} -\def\ekvDate{2020-02-22} +\def\ekvVersion{0.5a} +\def\ekvDate{2020-02-27} \csname ekv@tmp\endcsname \expandafter\chardef\csname ekv@tmp\endcsname=\catcode`\@ \catcode`\@=11 @@ -48,9 +48,9 @@ \long\def\@firstofone#1{#1} \long\def\@firstoftwo#1#2{#1} \long\def\@secondoftwo#1#2{#2} -\long\def\ekv@gobbletostop#1\ekv@stop{} -\long\def\ekv@fi@gobble\fi\@firstofone#1{\fi} \long\def\ekv@fi@secondoftwo\fi\@firstoftwo#1#2{\fi#2} +\long\def\ekv@gobbleto@stop#1\ekv@stop{} +\def\ekv@gobble@mark\ekv@mark{} \long\def\ekv@ifempty#1% {% \ekv@ifempty@\ekv@ifempty@A#1\ekv@ifempty@B\ekv@ifempty@true @@ -110,6 +110,7 @@ \def\ekv@name#1#2{\ekv@name@set{#1}\ekv@name@key{#2}} \def\ekv@name@set#1{ekv#1(} \def\ekv@name@key#1{#1)} +\def\ekv@undefined@set#1{! expkv Error: Set `#1' undefined.} \protected\def\ekv@checkvalid#1#2% {% \ekv@ifempty{#1}% @@ -181,19 +182,19 @@ } \protected\def\ekv@defset#1% {% - \expandafter\edef\csname\ekv@name@set{#1}\endcsname##1% + \expandafter\edef\csname\ekv@undefined@set{#1}\endcsname##1% {\ekv@name@set{#1}\ekv@name@key{##1}}% } \def\ekvset#1#2{% \endgroup \long\def\ekvset##1##2% {% - \expandafter\ekv@set\csname\ekv@name@set{##1}\endcsname + \expandafter\ekv@set\csname\ekv@undefined@set{##1}\endcsname \ekv@mark##2#1\ekv@stop#1{}% } \long\def\ekv@set##1##2#1% {% - \ekv@ifstop##2\ekv@endset\ekv@mark\ekv@stop + \ekv@gobbleto@markstop##2\ekv@endset\ekv@mark\ekv@stop \ekv@set@other##1##2,\ekv@stop,% \ekv@set##1\ekv@mark } @@ -203,7 +204,7 @@ {##3} \long\def\ekv@set@other##1##2,% {% - \ekv@ifstop##2\ekv@endset@other\ekv@mark\ekv@stop + \ekv@gobbleto@markstop##2\ekv@endset@other\ekv@mark\ekv@stop \ekv@ifhas@eq@other##2=\ekv@ifempty@B\ekv@ifempty@false \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo {\ekv@set@eq@other##1##2\ekv@stop}% @@ -256,7 +257,7 @@ } \long\def\ekv@parse##1##2##3#1% {% - \ekv@ifstop##3\ekv@endparse\ekv@mark\ekv@stop + \ekv@gobbleto@markstop##3\ekv@endparse\ekv@mark\ekv@stop \ekv@parse@other##1##2##3,\ekv@stop,% \ekv@parse##1##2\ekv@mark } @@ -265,7 +266,7 @@ {} \long\def\ekv@parse@other##1##2##3,% {% - \ekv@ifstop##3\ekv@endparse@other\ekv@mark\ekv@stop + \ekv@gobbleto@markstop##3\ekv@endparse@other\ekv@mark\ekv@stop \ekv@ifhas@eq@other##3=\ekv@ifempty@B\ekv@ifempty@false \ekv@ifempty@A\ekv@ifempty@B\@firstoftwo {\ekv@parse@eq@other##3\ekv@stop##2}% @@ -316,7 +317,15 @@ \catcode`\,=13 \catcode`\==13 \ekvset,= -\long\def\ekv@ifstop#1\ekv@mark\ekv@stop{} +\def\ekvchangeset#1% + {% + \expandafter\ekv@changeset\csname\ekv@undefined@set{#1}\endcsname\ekv@mark + } +\long\def\ekv@changeset#1#2\ekv@set@other#3#4\ekv@set#5% + {% + \ekv@gobble@mark#2\ekv@set@other#1#4\ekv@set#1% + } +\long\def\ekv@gobbleto@markstop#1\ekv@mark\ekv@stop{} \long\def\ekv@set@pair#1#2% {% \ekv@ifdefined@pair#2{#1}% @@ -325,7 +334,7 @@ \ekv@err@noarg \ekv@err@unknown #2{#1}% - \ekv@gobbletostop + \ekv@gobbleto@stop }% } \long\def\ekv@set@pair@#1#2\ekv@stop @@ -354,9 +363,9 @@ }% } \ekv@err -\def\ekv@err@{\expandafter\ekv@gobbletostop} +\def\ekv@err@{\expandafter\ekv@gobbleto@stop} \long\def\ekv@err@common #1#2{\expandafter\ekv@err@common@\string#2{#1}} -\long\def\ekv@err@common@#1#2#3#4#5(#6#7{\ekv@err{#6 (`#7', set `#5')}} +\long\def\ekv@err@common@#1`#2' #3.#4#5{\ekv@err{#4 (`#5', set `#2')}} \long\def\ekv@err@unknown#1#2{\ekv@err@common{unknown key}#1{#2}} \long\def\ekv@err@noarg #1#2{\ekv@err@common{value forbidden}#1{#2}} \long\def\ekv@err@reqval #1#2{\ekv@err@common{value required}#1{#2}} -- cgit v1.2.3