summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-07-21 22:02:53 +0000
committerKarl Berry <karl@freefriends.org>2017-07-21 22:02:53 +0000
commit51d74983b14a9c2832b6bfbdcac4e99243aabbb6 (patch)
tree05fdccae9fc0c2c4cbd2371ae2b9cc1b73ea615c /Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
parent71fb1b25309a75d246b0896063f0940332c85919 (diff)
l3 (21jul17)
git-svn-id: svn://tug.org/texlive/trunk@44864 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3expan.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3expan.dtx30
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
{