diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3expan.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3expan.dtx | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index c5c7a073aaa..0dda580c27d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/07/15} +% \date{Released 2017/07/19} % % \maketitle % @@ -102,9 +102,22 @@ % \section{Methods for defining variants} % \label{sec:l3expan:variants-method} % -% ^^A Bruno: Should we put a table of variant types (N, c, n, V, v, o, f, x) for reference here? -% -% ^^A Bruno: Should \cs_generate_variant:Nn \foo:n { c } and \foo:N { o } really be ok? +% We recall the set of available argument specifiers. +% \begin{itemize} +% \item |N|~is used for single-token arguments while |c|~constructs a +% control sequence from its name and passes it to a parent function as +% an |N|-type argument. +% \item Many argument types extract or expand some tokens and provide it +% as an |n|-type argument, namely a braced multiple-token argument: +% |V|~extracts the value of a variable, |v|~extracts the value from +% the name of a variable, |n|~uses the argument as it is, |o|~expands +% once, |f|~expands fully the first token, |x|~expands fully all +% tokens at the price of being non-expandable. +% \item A few odd argument types remain: |T|~and |F|~for conditional +% processing, otherwise identical to~|n|, |p|~for the parameter text +% in definitions, |w|~for arguments with a specific syntax, and |D|~to +% denote primitives that should not be used directly. +% \end{itemize} % % \begin{function}[updated = 2015-08-06]{\cs_generate_variant:Nn} % \begin{syntax} @@ -139,6 +152,11 @@ % protected. The \meta{variant} is created globally, as is any % \cs[no-index]{exp_args:N\meta{variant}} function needed to carry out the % expansion. +% +% While \cs{cs_generate_variant:Nn} |\foo:N { o }| is currently +% allowed, one must know that it will break if the result of the +% expansion is more than one token or if |\foo:N| requires its +% argument not to be braced. % \end{function} % % \section{Introducing the variants} @@ -1476,9 +1494,9 @@ % iterate through the comma list of variant argument specifiers, which % we first convert to a string: the reason is explained later. % \begin{macrocode} +\__debug_patch:nnNNpn { \__debug_chk_cs_exist:N #1 } { } \cs_new_protected:Npn \cs_generate_variant:Nn #1#2 { - \__chk_if_exist_cs:N #1 \@@_generate_variant:N #1 \exp_after:wN \@@_split_function:NN \exp_after:wN #1 @@ -1788,7 +1806,7 @@ % \cs{cs_new_protected:Npx}. Then define the variant by % combining the |\exp_args:N #3| variant and the base function. % \begin{macrocode} -\__debug_patch:nnNw +\__debug_patch:nnNNpn { \cs_if_free:NF #4 { |