diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-11 20:48:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-11 20:48:59 +0000 |
commit | 3422d732c6ff0bf2df753c64bee1cb533ca71474 (patch) | |
tree | a94169bd4aa6fe8afb1e23f09817de7f513ce269 /Master/texmf-dist/tex/generic | |
parent | 2af878d8a2c86b79762fab0437863f8a25154355 (diff) |
expkv-cs (11oct20)
git-svn-id: svn://tug.org/texlive/trunk@56632 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/expkv-cs/expkv-cs.tex | 135 |
1 files changed, 114 insertions, 21 deletions
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 ec97f9845f6..d1f3ccc1df1 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.4} -\def\ekvcDate{2020-08-08} +\def\ekvcVersion{0.5} +\def\ekvcDate{2020-10-11} \csname ekvc@tmp\endcsname \expandafter\chardef\csname ekvc@tmp\endcsname=\catcode`\@ \catcode`\@=11 @@ -57,6 +57,7 @@ } \protected\long\def\ekvcSplitAndUse#1#2% {% + \let\ekvc@helpers@needed\@firstoftwo \ekv@ifdefined{\expandafter\@gobble\string#1}% {\ekvc@err@already@defined#1}% {\ekvcSplitAndUse@#1{}{#2}}% @@ -65,41 +66,70 @@ {% \edef\ekvc@set{\string#1}% \ekvc@SetupSplitKeys{#3}% - \ekvc@any@long\edef#1##1% + \ekvc@helpers@needed {% - \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}% - \unexpanded\expandafter - {\csname ekvc@split@\the\ekvc@keycount\endcsname}% - \unexpanded\expandafter{\ekvc@initials{}#2}% + \ekvc@any@long\edef#1##1% + {% + \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}% + \unexpanded\expandafter + {\csname ekvc@split@\the\ekvc@keycount\endcsname}% + \unexpanded\expandafter{\ekvc@initials{}#2}% + }% + }% + {% + \ekvc@any@long\edef#1##1% + {% + \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}% + \unexpanded{#2}% + \unexpanded\expandafter{\ekvc@initials}% + }% }% } \protected\long\def\ekvcSplitAndForward#1#2#3% {% + \let\ekvc@helpers@needed\@firstoftwo \ekv@ifdefined{\expandafter\@gobble\string#1}% {\ekvc@err@already@defined#1}% {\ekvcSplitAndUse@#1{{#2}}{#3}}% } \protected\long\def\ekvcSplit#1#2#3% {% + \let\ekvc@helpers@needed\@secondoftwo \ekv@ifdefined{\expandafter\@gobble\string#1}% {\ekvc@err@already@defined#1}% {% \expandafter \ekvcSplitAndUse@\expandafter#1\csname ekvc@\string#1\endcsname{#2}% - \ifnum\ekvc@keycount=0 - \def\ekvc@tmp##1##{}% + \ifnum\ekvc@keycount<1 + \ekvc@any@long\expandafter\def\csname ekvc@\string#1\endcsname{#3}% \else \ifnum\ekvc@keycount>9 \ekvc@err@toomany{#1}% - \ekvc@defarggobbler9% + \let#1\ekvc@undefined \else - \expandafter\ekvc@defarggobbler\the\ekvc@keycount + \ekvcSplit@build@argspec + \ekvc@any@long\expandafter + \def\csname ekvc@\string#1\expandafter\endcsname\ekvc@tmp{#3}% \fi \fi - \ekvc@any@long\expandafter - \def\csname ekvc@\string#1\expandafter\endcsname - \ekvc@tmp##1##2##3##4##5##6##7##8##9% - {#3}% + }% + } +\protected\def\ekvcSplit@build@argspec + {% + \begingroup + \edef\ekvc@tmp + {\endgroup\def\unexpanded{\ekvc@tmp}{\ekvcSplit@build@argspec@{1}}}% + \ekvc@tmp + } +\def\ekvcSplit@build@argspec@#1% + {% + \ifnum#1>\ekvc@keycount + \ekv@fi@gobble + \fi + \@firstofone + {% + \unexpanded\expandafter{\csname ekvc@splitmark@#1\endcsname####}#1% + \expandafter\ekvcSplit@build@argspec@\expandafter{\the\numexpr#1+1}% }% } \protected\long\def\ekvc@SetupSplitKeys @@ -155,7 +185,9 @@ }% \ekvc@tmp \ekvlet\ekvc@set{#1}\ekvc@tmp - \expandafter\ekvc@setup@splitmacro\expandafter{\the\ekvc@keycount}% + \ekvc@helpers@needed + {\expandafter\ekvc@setup@splitmacro\expandafter{\the\ekvc@keycount}}% + {}% } \protected\def\ekvc@split@p@long {% @@ -171,6 +203,51 @@ \unexpanded\expandafter{\csname ekvc@splitmark@1\endcsname}% ##1##2##3% {##3{##1}##2}% + \long\gdef\unexpanded\expandafter{\csname ekvc@split@2\endcsname}% + \unexpanded\expandafter{\csname ekvc@splitmark@1\endcsname}##1% + \unexpanded\expandafter{\csname ekvc@splitmark@2\endcsname}##2% + ##3##4% + {##4{##1}{##2}##3}% + \long\gdef\unexpanded\expandafter{\csname ekvc@split@3\endcsname}% + \unexpanded\expandafter{\csname ekvc@splitmark@1\endcsname}##1% + \unexpanded\expandafter{\csname ekvc@splitmark@2\endcsname}##2% + \unexpanded\expandafter{\csname ekvc@splitmark@3\endcsname}##3% + ##4##5% + {##5{##1}{##2}{##3}##4}% + \long\gdef\unexpanded\expandafter{\csname ekvc@split@4\endcsname}% + \unexpanded\expandafter{\csname ekvc@splitmark@1\endcsname}##1% + \unexpanded\expandafter{\csname ekvc@splitmark@2\endcsname}##2% + \unexpanded\expandafter{\csname ekvc@splitmark@3\endcsname}##3% + \unexpanded\expandafter{\csname ekvc@splitmark@4\endcsname}##4% + ##5##6% + {##6{##1}{##2}{##3}{##4}##5}% + \long\gdef\unexpanded\expandafter{\csname ekvc@split@5\endcsname}% + \unexpanded\expandafter{\csname ekvc@splitmark@1\endcsname}##1% + \unexpanded\expandafter{\csname ekvc@splitmark@2\endcsname}##2% + \unexpanded\expandafter{\csname ekvc@splitmark@3\endcsname}##3% + \unexpanded\expandafter{\csname ekvc@splitmark@4\endcsname}##4% + \unexpanded\expandafter{\csname ekvc@splitmark@5\endcsname}##5% + ##6##7% + {##7{##1}{##2}{##3}{##4}{##5}##6}% + \long\gdef\unexpanded\expandafter{\csname ekvc@split@6\endcsname}% + \unexpanded\expandafter{\csname ekvc@splitmark@1\endcsname}##1% + \unexpanded\expandafter{\csname ekvc@splitmark@2\endcsname}##2% + \unexpanded\expandafter{\csname ekvc@splitmark@3\endcsname}##3% + \unexpanded\expandafter{\csname ekvc@splitmark@4\endcsname}##4% + \unexpanded\expandafter{\csname ekvc@splitmark@5\endcsname}##5% + \unexpanded\expandafter{\csname ekvc@splitmark@6\endcsname}##6% + ##7##8% + {##8{##1}{##2}{##3}{##4}{##5}{##6}##7}% + \long\gdef\unexpanded\expandafter{\csname ekvc@split@7\endcsname}% + \unexpanded\expandafter{\csname ekvc@splitmark@1\endcsname}##1% + \unexpanded\expandafter{\csname ekvc@splitmark@2\endcsname}##2% + \unexpanded\expandafter{\csname ekvc@splitmark@3\endcsname}##3% + \unexpanded\expandafter{\csname ekvc@splitmark@4\endcsname}##4% + \unexpanded\expandafter{\csname ekvc@splitmark@5\endcsname}##5% + \unexpanded\expandafter{\csname ekvc@splitmark@6\endcsname}##6% + \unexpanded\expandafter{\csname ekvc@splitmark@7\endcsname}##7% + ##8##9% + {##9{##1}{##2}{##3}{##4}{##5}{##6}{##7}##8}% } \ekvc@tmp \endgroup @@ -198,6 +275,7 @@ } \protected\long\def\ekvcHashAndUse#1#2% {% + \let\ekvc@helpers@needed\@firstoftwo \ekv@ifdefined{\expandafter\@gobble\string#1}% {\ekvc@err@already@defined#1}% {\ekvcHashAndUse@#1{}{#2}}% @@ -206,27 +284,42 @@ {% \edef\ekvc@set{\string#1}% \ekvc@SetupHashKeys{#3}% - \ekvc@any@long\edef#1##1% + \ekvc@helpers@needed + {% + \ekvc@any@long\edef#1##1% + {% + \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}% + \unexpanded{\ekvc@hash@pack@argument}% + \unexpanded\expandafter{\ekvc@initials\ekvc@stop#2}% + }% + }% {% - \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}% - \unexpanded{\ekvc@hash@pack@argument}% - \unexpanded\expandafter{\ekvc@initials\ekvc@stop#2}% + \ekvc@any@long\edef#1##1% + {% + \expandafter\ekvc@ekvset@pre@expander\expandafter{\ekvc@set}% + \unexpanded{#2}% + \unexpanded\expandafter{\ekvc@initials\ekvc@stop}% + }% }% } \protected\long\def\ekvcHashAndForward#1#2#3% {% + \let\ekvc@helpers@needed\@firstoftwo \ekv@ifdefined{\expandafter\@gobble\string#1}% {\ekvc@err@already@defined#1}% {\ekvcHashAndUse@#1{{#2}}{#3}}% } \protected\long\def\ekvcHash#1#2#3% {% + \let\ekvc@helpers@needed\@secondoftwo \ekv@ifdefined{\expandafter\@gobble\string#1}% {\ekvc@err@already@defined#1}% {% \expandafter \ekvcHashAndUse@\expandafter#1\csname ekvc@\string#1\endcsname{#2}% - \ekvc@any@long\expandafter\def\csname ekvc@\string#1\endcsname##1{#3}% + \ekvc@any@long\expandafter\def\csname ekvc@\string#1\endcsname + ##1\ekvc@stop + {#3}% }% } \long\def\ekvc@hash@pack@argument#1\ekvc@stop#2{#2{#1}} |