diff options
author | Karl Berry <karl@freefriends.org> | 2020-12-28 22:32:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-12-28 22:32:26 +0000 |
commit | 3f516ebc134388ce112da396f5fa48763112c68a (patch) | |
tree | 072fbb1c911b8ec9123a97e39c55771e4253767f /Master | |
parent | ae7b85d3ff2a814b8c735c12031dd075b58bedac (diff) |
expkv-def (28dec20)
git-svn-id: svn://tug.org/texlive/trunk@57246 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/expkv-def/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf | bin | 356349 -> 379054 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx | 90 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex | 60 |
4 files changed, 84 insertions, 68 deletions
diff --git a/Master/texmf-dist/doc/latex/expkv-def/README.md b/Master/texmf-dist/doc/latex/expkv-def/README.md index b2172d3ab15..ffea8dd5ca4 100644 --- a/Master/texmf-dist/doc/latex/expkv-def/README.md +++ b/Master/texmf-dist/doc/latex/expkv-def/README.md @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------- # expkv-def -- a key-defining frontend for expkv -Version 2020-10-12 v0.6 +Version 2020-12-28 v0.7 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-def/expkv-def.pdf b/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf Binary files differindex 73ddc853c6f..727d6c43d4a 100644 --- a/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf +++ b/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf diff --git a/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx b/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx index 2dc41641530..5edf48780c5 100644 --- a/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx +++ b/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx @@ -171,6 +171,7 @@ and the derived files expkv-def.pdf \DoNotIndex{\@,\unexpanded,\string,\expanded,\dimexpr,\global,\glueexpr,\hbox} \DoNotIndex{\numexpr,\RequirePackage,\setbox,\the,\unless,\xdef,\@firstofone} \DoNotIndex{\@firstoftwo,\@gobble,\@secondoftwo,\meaning,\detokenize} +\DoNotIndex{\romannumeral,\^} \DoNotIndex{\ifcsname} \DoNotIndex{\ifx} \DoNotIndex{\ifdefined} @@ -362,7 +363,7 @@ and the derived files expkv-def.pdf % |\edef|. % \end{function} % -% \begin{function}{default,qdefault,edefault} +% \begin{function}{default,qdefault,odefault,fdefault,edefault} % \begin{syntax} % default \key\ = \marg{definition} \prefixes3223 % \end{syntax} @@ -370,11 +371,18 @@ and the derived files expkv-def.pdf % \key\ can be of any argument-grabbing kind, and when used without a \val\ % it will be passed \meta{definition} instead. The |qdefault| variant will % expand the \key's code once, so will be slightly quicker, but not change if -% you redefine \key. The |edefault| on the other hand fully expands the -% \key-code with \meta{definition} as its argument inside of an |\edef|. +% you redefine \key. |odefault| is just another name for |qdefault|. The +% |fdefault| version will expand the key code until a non-expandable token or +% a space is found, a space would be gobbled.\footnotemark{} The |edefault| on the other hand fully expands +% the \key-code with \meta{definition} as its argument inside of an |\edef|. % \end{function} +% \footnotetext +% {^^A +% For those familiar with \TeX-coding: This uses a +% \cs[no-index]{romannumeral}-expansion. +% } % -% \begin{function}{initial,oinitial,einitial} +% \begin{function}{initial,oinitial,finitial,einitial} % \begin{syntax} % initial \key\ = \{\val\} \prefixes3333 % \end{syntax} @@ -382,8 +390,11 @@ and the derived files expkv-def.pdf % taking \key. It'll just call the key-macro of \key\ and pass it \val. The % |einitial| variant will expand \val\ using an |\edef| expansion prior to % passing it to the key-macro and the |oinitial| variant will expand the first -% token in \val\ once. +% token in \val\ once. |finitial| will expand \val\ until a non-expandable +% token or a space is found, a space would be +% gobbled.\footnotemark % \end{function} +% \footnotetext{Again using \cs[no-index]{romannumeral}.} % % \begin{function}{bool,gbool,boolTF,gboolTF} % \begin{syntax} @@ -755,8 +766,8 @@ and the derived files expkv-def.pdf % \begin{macro}{\ekvdVersion,\ekvdDate} % We're on our first input, so lets store the version and date in a macro. % \begin{macrocode} -\def\ekvdVersion{0.6} -\def\ekvdDate{2020-10-12} +\def\ekvdVersion{0.7} +\def\ekvdDate{2020-12-28} % \end{macrocode} % \end{macro} % @@ -904,15 +915,11 @@ and the derived files expkv-def.pdf {% \ekvd@ifalso {% - \ekv@expB@unbraceA{\ekv@expB@unbraceA{\ekvd@add@noval{#1}}}% + \ekv@expargtwice{\ekvd@add@noval{#1}}% {\ekvchangeset{#2}}% \ekvd@assert@not@protected@also }% - {% - \ekv@expB@unbraceA - {\ekv@expB@unbraceA{\ekvdefNoVal\ekvd@set{#1}}}% - {\ekvchangeset{#2}}% - }% + {\ekv@expargtwice{\ekvdefNoVal\ekvd@set{#1}}{\ekvchangeset{#2}}}% }% }% } @@ -942,7 +949,7 @@ and the derived files expkv-def.pdf \ekvd@assert@not@long \ekvd@prot#1\ekvd@tmp{#3}% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@noval{#2}}\ekvd@tmp{}}% + {\ekv@exparg{\ekvd@add@noval{#2}}\ekvd@tmp{}}% {\ekvletNoVal\ekvd@set{#2}\ekvd@tmp}% }% }% @@ -964,7 +971,7 @@ and the derived files expkv-def.pdf {% \ekvd@prot\ekvd@long#1\ekvd@tmp##1{#3}% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@val{#2}}{\ekvd@tmp{##1}}{}}% + {\ekv@exparg{\ekvd@add@val{#2}}{\ekvd@tmp{##1}}{}}% {\ekvlet\ekvd@set{#2}\ekvd@tmp}% }% }% @@ -974,35 +981,41 @@ and the derived files expkv-def.pdf % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ekvd@type@default,\ekvd@t@default,\ekvd@t@qdefault} +% \begin{macro}[internal] +% { +% \ekvd@type@default,\ekvd@t@default,\ekvd@t@qdefault,\ekvd@t@odefault, +% \ekvd@t@fdefault +% } % |\ekvd@type@default| asserts there was an argument, also the key for which one % wants to set a default has to be already defined (this is not so important for % |default|, but |qdefault| requires is). If everything is good, |\edef| a % temporary macro that expands |\ekvd@set| and the |\csname| for the key, and in % the case of |qdefault| does the first expansion step of the key-macro. % \begin{macrocode} -\protected\long\def\ekvd@type@default#1#2#3% +\protected\long\def\ekvd@type@default#1#2#3#4% {% \ekvd@assert@arg {% - \ekvifdefined\ekvd@set{#2}% + \ekvifdefined\ekvd@set{#3}% {% \ekvd@assert@not@new \ekvd@assert@not@long \ekvd@prot\edef\ekvd@tmp {% \unexpanded\expandafter#1% - {\csname\ekv@name\ekvd@set{#2}\endcsname{#3}}% + {#2\csname\ekv@name\ekvd@set{#3}\endcsname{#4}}% }% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@noval{#2}}\ekvd@tmp{}}% - {\ekvletNoVal\ekvd@set{#2}\ekvd@tmp}% + {\ekv@exparg{\ekvd@add@noval{#3}}\ekvd@tmp{}}% + {\ekvletNoVal\ekvd@set{#3}\ekvd@tmp}% }% - {\ekvd@err@undefined@key{#2}}% + {\ekvd@err@undefined@key{#3}}% }% } -\protected\def\ekvd@t@default{\ekvd@type@default{}} -\protected\def\ekvd@t@qdefault{\ekvd@type@default{\expandafter\expandafter}} +\protected\def\ekvd@t@default{\ekvd@type@default{}{}} +\protected\def\ekvd@t@qdefault{\ekvd@type@default{\expandafter\expandafter}{}} +\let\ekvd@t@odefault\ekvd@t@qdefault +\protected\def\ekvd@t@fdefault{\ekvd@type@default{}{\romannumeral`\^^@}} % \end{macrocode} % \end{macro} % @@ -1021,7 +1034,7 @@ and the derived files expkv-def.pdf \ekvd@prot\edef\ekvd@tmp {\csname\ekv@name\ekvd@set{#1}\endcsname{#2}}% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@noval{#1}}\ekvd@tmp{}}% + {\ekv@exparg{\ekvd@add@noval{#1}}\ekvd@tmp{}}% {\ekvletNoVal\ekvd@set{#1}\ekvd@tmp}% }% {\ekvd@err@undefined@key{#1}}% @@ -1030,28 +1043,31 @@ and the derived files expkv-def.pdf % \end{macrocode} % \end{macro} % -% \begin{macro}[internal]{\ekvd@t@initial,\ekvd@t@oinitial,\ekvd@t@einitial} +% \begin{macro}[internal] +% {\ekvd@t@initial,\ekvd@t@oinitial,\ekvd@t@finitial,\ekvd@t@einitial} % \begin{macrocode} -\long\def\ekvd@type@initial#1#2#3% +\long\def\ekvd@type@initial#1#2#3#4% {% \ekvd@assert@arg {% - \ekvifdefined\ekvd@set{#2}% + \ekvifdefined\ekvd@set{#3}% {% \ekvd@assert@not@new \ekvd@assert@not@also \ekvd@assert@not@long \ekvd@assert@not@protected - #1{#3}% - \csname\ekv@name\ekvd@set{#2}\expandafter\endcsname\expandafter + #1{#2#4}% + \csname\ekv@name\ekvd@set{#3}\expandafter\endcsname\expandafter {\ekvd@tmp}% }% - {\ekvd@err@undefined@key{#2}}% + {\ekvd@err@undefined@key{#3}}% }% } -\def\ekvd@t@initial{\ekvd@type@initial{\def\ekvd@tmp}} -\def\ekvd@t@oinitial{\ekvd@type@initial{\ekv@expB@unbraceA{\def\ekvd@tmp}}} -\def\ekvd@t@einitial{\ekvd@type@initial{\edef\ekvd@tmp}} +\def\ekvd@t@initial{\ekvd@type@initial{\def\ekvd@tmp}{}} +\def\ekvd@t@oinitial{\ekvd@type@initial{\ekv@exparg{\def\ekvd@tmp}}{}} +\def\ekvd@t@einitial{\ekvd@type@initial{\edef\ekvd@tmp}{}} +\def\ekvd@t@finitial + {\ekvd@type@initial{\ekv@exparg{\def\ekvd@tmp}}{\romannumeral`\^^@}} % \end{macrocode} % \end{macro} % @@ -1346,7 +1362,7 @@ and the derived files expkv-def.pdf \edef\ekvd@tmp{\ekvd@set}% \expandafter\ekvd@type@meta@a\expandafter{\ekvd@tmp}{#7}{#2}% \ekvd@ifalso - {\ekv@expB@unbraceA{#3{#6}}{\ekvd@tmp#4}{#5}}% + {\ekv@exparg{#3{#6}}{\ekvd@tmp#4}{#5}}% {\csname ekvlet#1\endcsname\ekvd@set{#6}\ekvd@tmp}% }% }% @@ -1386,7 +1402,7 @@ and the derived files expkv-def.pdf {% \ekvd@type@meta@a#7{#2}% \ekvd@ifalso - {\ekv@expB@unbraceA{#3{#6}}{\ekvd@tmp#4}{#5}}% + {\ekv@exparg{#3{#6}}{\ekvd@tmp#4}{#5}}% {\csname ekvlet#1\endcsname\ekvd@set{#6}\ekvd@tmp}% }% }% @@ -1424,7 +1440,7 @@ and the derived files expkv-def.pdf {% \ekvd@if@not@already@choice{#1}% {% - \ekv@expB@unbraceA + \ekv@exparg {% \expandafter\ekvd@add@aux \csname\ekv@name\ekvd@set{#1}\endcsname{{##1}}{#1}% 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 a4259fe376f..83df70fc0ea 100644 --- a/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex +++ b/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex @@ -35,8 +35,8 @@ \else \expandafter\endinput \fi -\def\ekvdVersion{0.6} -\def\ekvdDate{2020-10-12} +\def\ekvdVersion{0.7} +\def\ekvdDate{2020-12-28} \csname ekvd@tmp\endcsname \expandafter\chardef\csname ekvd@tmp\endcsname=\catcode`\@ \catcode`\@=11 @@ -105,15 +105,11 @@ {% \ekvd@ifalso {% - \ekv@expB@unbraceA{\ekv@expB@unbraceA{\ekvd@add@noval{#1}}}% + \ekv@expargtwice{\ekvd@add@noval{#1}}% {\ekvchangeset{#2}}% \ekvd@assert@not@protected@also }% - {% - \ekv@expB@unbraceA - {\ekv@expB@unbraceA{\ekvdefNoVal\ekvd@set{#1}}}% - {\ekvchangeset{#2}}% - }% + {\ekv@expargtwice{\ekvdefNoVal\ekvd@set{#1}}{\ekvchangeset{#2}}}% }% }% } @@ -132,7 +128,7 @@ \ekvd@assert@not@long \ekvd@prot#1\ekvd@tmp{#3}% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@noval{#2}}\ekvd@tmp{}}% + {\ekv@exparg{\ekvd@add@noval{#2}}\ekvd@tmp{}}% {\ekvletNoVal\ekvd@set{#2}\ekvd@tmp}% }% }% @@ -147,35 +143,37 @@ {% \ekvd@prot\ekvd@long#1\ekvd@tmp##1{#3}% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@val{#2}}{\ekvd@tmp{##1}}{}}% + {\ekv@exparg{\ekvd@add@val{#2}}{\ekvd@tmp{##1}}{}}% {\ekvlet\ekvd@set{#2}\ekvd@tmp}% }% }% } \protected\def\ekvd@t@code{\ekvd@type@code\def} \protected\def\ekvd@t@ecode{\ekvd@type@code\edef} -\protected\long\def\ekvd@type@default#1#2#3% +\protected\long\def\ekvd@type@default#1#2#3#4% {% \ekvd@assert@arg {% - \ekvifdefined\ekvd@set{#2}% + \ekvifdefined\ekvd@set{#3}% {% \ekvd@assert@not@new \ekvd@assert@not@long \ekvd@prot\edef\ekvd@tmp {% \unexpanded\expandafter#1% - {\csname\ekv@name\ekvd@set{#2}\endcsname{#3}}% + {#2\csname\ekv@name\ekvd@set{#3}\endcsname{#4}}% }% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@noval{#2}}\ekvd@tmp{}}% - {\ekvletNoVal\ekvd@set{#2}\ekvd@tmp}% + {\ekv@exparg{\ekvd@add@noval{#3}}\ekvd@tmp{}}% + {\ekvletNoVal\ekvd@set{#3}\ekvd@tmp}% }% - {\ekvd@err@undefined@key{#2}}% + {\ekvd@err@undefined@key{#3}}% }% } -\protected\def\ekvd@t@default{\ekvd@type@default{}} -\protected\def\ekvd@t@qdefault{\ekvd@type@default{\expandafter\expandafter}} +\protected\def\ekvd@t@default{\ekvd@type@default{}{}} +\protected\def\ekvd@t@qdefault{\ekvd@type@default{\expandafter\expandafter}{}} +\let\ekvd@t@odefault\ekvd@t@qdefault +\protected\def\ekvd@t@fdefault{\ekvd@type@default{}{\romannumeral`\^^@}} \protected\long\def\ekvd@t@edefault#1#2% {% \ekvd@assert@arg @@ -187,32 +185,34 @@ \ekvd@prot\edef\ekvd@tmp {\csname\ekv@name\ekvd@set{#1}\endcsname{#2}}% \ekvd@ifalso - {\ekv@expB@unbraceA{\ekvd@add@noval{#1}}\ekvd@tmp{}}% + {\ekv@exparg{\ekvd@add@noval{#1}}\ekvd@tmp{}}% {\ekvletNoVal\ekvd@set{#1}\ekvd@tmp}% }% {\ekvd@err@undefined@key{#1}}% }% } -\long\def\ekvd@type@initial#1#2#3% +\long\def\ekvd@type@initial#1#2#3#4% {% \ekvd@assert@arg {% - \ekvifdefined\ekvd@set{#2}% + \ekvifdefined\ekvd@set{#3}% {% \ekvd@assert@not@new \ekvd@assert@not@also \ekvd@assert@not@long \ekvd@assert@not@protected - #1{#3}% - \csname\ekv@name\ekvd@set{#2}\expandafter\endcsname\expandafter + #1{#2#4}% + \csname\ekv@name\ekvd@set{#3}\expandafter\endcsname\expandafter {\ekvd@tmp}% }% - {\ekvd@err@undefined@key{#2}}% + {\ekvd@err@undefined@key{#3}}% }% } -\def\ekvd@t@initial{\ekvd@type@initial{\def\ekvd@tmp}} -\def\ekvd@t@oinitial{\ekvd@type@initial{\ekv@expB@unbraceA{\def\ekvd@tmp}}} -\def\ekvd@t@einitial{\ekvd@type@initial{\edef\ekvd@tmp}} +\def\ekvd@t@initial{\ekvd@type@initial{\def\ekvd@tmp}{}} +\def\ekvd@t@oinitial{\ekvd@type@initial{\ekv@exparg{\def\ekvd@tmp}}{}} +\def\ekvd@t@einitial{\ekvd@type@initial{\edef\ekvd@tmp}{}} +\def\ekvd@t@finitial + {\ekvd@type@initial{\ekv@exparg{\def\ekvd@tmp}}{\romannumeral`\^^@}} \protected\def\ekvd@type@bool#1#2#3#4#5% {% \ekvd@ifnew{}{#4}% @@ -422,7 +422,7 @@ \edef\ekvd@tmp{\ekvd@set}% \expandafter\ekvd@type@meta@a\expandafter{\ekvd@tmp}{#7}{#2}% \ekvd@ifalso - {\ekv@expB@unbraceA{#3{#6}}{\ekvd@tmp#4}{#5}}% + {\ekv@exparg{#3{#6}}{\ekvd@tmp#4}{#5}}% {\csname ekvlet#1\endcsname\ekvd@set{#6}\ekvd@tmp}% }% }% @@ -453,7 +453,7 @@ {% \ekvd@type@meta@a#7{#2}% \ekvd@ifalso - {\ekv@expB@unbraceA{#3{#6}}{\ekvd@tmp#4}{#5}}% + {\ekv@exparg{#3{#6}}{\ekvd@tmp#4}{#5}}% {\csname ekvlet#1\endcsname\ekvd@set{#6}\ekvd@tmp}% }% }% @@ -475,7 +475,7 @@ {% \ekvd@if@not@already@choice{#1}% {% - \ekv@expB@unbraceA + \ekv@exparg {% \expandafter\ekvd@add@aux \csname\ekv@name\ekvd@set{#1}\endcsname{{##1}}{#1}% |