diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3expan.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3expan.dtx | 64 |
1 files changed, 61 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index 5479105b596..d932e646c2f 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/12/05} +% \date{Released 2017/12/16} % % \maketitle % @@ -120,7 +120,8 @@ % denote primitives that should not be used directly. % \end{itemize} % -% \begin{function}[updated = 2017-11-28]{\cs_generate_variant:Nn} +% \begin{function}[updated = 2017-11-28] +% {\cs_generate_variant:Nn, \cs_generate_variant:cn} % \begin{syntax} % \cs{cs_generate_variant:Nn} \meta{parent control sequence} \Arg{variant argument specifiers} % \end{syntax} @@ -1546,7 +1547,7 @@ %<@@=cs> % \end{macrocode} % -% \begin{macro}{\cs_generate_variant:Nn} +% \begin{macro}{\cs_generate_variant:Nn, \cs_generate_variant:cn} % \begin{arguments} % \item Base form of a function; \emph{e.g.},~\cs{tl_set:Nn} % \item One or more variant argument specifiers; e.g., |{Nx,c,cx}| @@ -1570,6 +1571,8 @@ \exp_after:wN #1 \tl_to_str:n {#2} , \scan_stop: , \q_recursion_stop } +\cs_new_protected:Npn \cs_generate_variant:cn + { \exp_args:Nc \cs_generate_variant:Nn } % \end{macrocode} % \end{macro} % @@ -1992,6 +1995,61 @@ % \end{macro} % \end{macro} % +% \begin{macro} +% { +% \prg_generate_conditional_variant:Nnn, +% \@@_generate_variant:nnNnn, +% \@@_generate_variant:w, +% \@@_generate_variant:n, +% \@@_generate_variant_p_form:nnn, +% \@@_generate_variant_T_form:nnn, +% \@@_generate_variant_F_form:nnn, +% \@@_generate_variant_TF_form:nnn, +% } +% \begin{macrocode} +\cs_new_protected:Npn \prg_generate_conditional_variant:Nnn #1 + { \__cs_split_function:NN #1 \@@_generate_variant:nnNnn } +\cs_new_protected:Npn \@@_generate_variant:nnNnn #1#2#3#4#5 + { + \if_meaning:w \c_false_bool #3 + \__msg_kernel_error:nnx { kernel } { missing-colon } + { \token_to_str:c {#1} } + \use_i_delimit_by_q_stop:nw + \fi: + \exp_after:wN \@@_generate_variant:w + \tl_to_str:n {#5} , \scan_stop: , \q_recursion_stop + \use_none_delimit_by_q_stop:w \q_mark {#1} {#2} {#4} \q_stop + } +\cs_new_protected:Npn \@@_generate_variant:w + #1 , #2 \q_mark #3#4#5 + { + \if_meaning:w \scan_stop: #1 \scan_stop: + \if_meaning:w \q_nil #1 \q_nil + \use_i:nnn + \fi: + \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \else: + \cs_if_exist_use:cTF { @@_generate_variant_#1_form:nnn } + { {#3} {#4} {#5} } + { + \__msg_kernel_error:nnxx + { kernel } { conditional-form-unknown } + {#1} { \token_to_str:c { #3 : #4 } } + } + \fi: + \@@_generate_variant:w #2 \q_mark {#3} {#4} {#5} + } +\cs_new_protected:Npn \@@_generate_variant_p_form:nnn #1#2 + { \cs_generate_variant:cn { #1 _p : #2 } } +\cs_new_protected:Npn \@@_generate_variant_T_form:nnn #1#2 + { \cs_generate_variant:cn { #1 : #2 T } } +\cs_new_protected:Npn \@@_generate_variant_F_form:nnn #1#2 + { \cs_generate_variant:cn { #1 : #2 F } } +\cs_new_protected:Npn \@@_generate_variant_TF_form:nnn #1#2 + { \cs_generate_variant:cn { #1 : #2 TF } } +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} %</initex|package> % \end{macrocode} |