[latex3-commits] [git/LaTeX3-latex3-latex2e] gh569: Add \@@_cmd_type_cases:NnnnF to branch depending on the type of cs (efb080b0)
PhelypeOleinik
phelype.oleinik at latex-project.org
Sun Aug 1 04:11:25 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : gh569
Link : https://github.com/latex3/latex2e/commit/efb080b054d1fc719f8664aa0935986e40ccd2e1
>---------------------------------------------------------------
commit efb080b054d1fc719f8664aa0935986e40ccd2e1
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Sat Jul 31 23:11:25 2021 -0300
Add \@@_cmd_type_cases:NnnnF to branch depending on the type of cs
>---------------------------------------------------------------
efb080b054d1fc719f8664aa0935986e40ccd2e1
base/ltcmd.dtx | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 6f2153c6..6907c6d7 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -3375,8 +3375,11 @@
% \end{macro}
%
% \begin{macro}{\__kernel_cmd_if_xparse:NTF}
+% \begin{macro}{\@@_cmd_type_cases:Nnnn}
% \changes{v1.0d}{2021/04/19}{Renamed \cs{__cmd_cmd_if_xparse:NTF} to
% \cs{__kernel_cmd_if_xparse:NTF} for cross-module usage}
+% \changes{v1.0d}{2021/07/30}{Added \cs{@@_cmd_type_cases:Nnnn} for
+% \cs{NewCommandCopy} and \cs{ShowCommand} support}
% \begin{macro}{\@@_cmd_if_xparse_aux:N}
%
% To determine whether the command is an \pkg{xparse} command check
@@ -3389,9 +3392,9 @@
% This conditional is needed in several kernel modules and is
% therefore has a kernel-internal name.
% \begin{macrocode}
-\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1
+\cs_new_protected:Npn \@@_cmd_type_cases:NnnnF #1 #2 #3 #4 #5
{
- \exp_args:Nf \str_case_e:nnTF
+ \str_case_e:nnF
{
\exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 }
{
@@ -3400,15 +3403,23 @@
}
}
{
- { \token_to_str:N \@@_start:nNNnnn } { }
- { \token_to_str:N \@@_start_expandable:nNNNNn } { }
- { \token_to_str:N \@@_start_env:nnnnn } { }
+ { \token_to_str:N \@@_start:nNNnnn } {#2}
+ { \token_to_str:N \@@_start_expandable:nNNNNn } {#3}
+ { \token_to_str:N \@@_start_env:nnnnn } {#4}
}
+ {#5}
}
\cs_new:Npn \@@_cmd_if_xparse_aux:w #1 ~ #2 \q_stop {#1}
+\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1
+ {
+ \@@_cmd_type_cases:NnnnF #1
+ { } { } { } { \use_iii:nnn }
+ \use_i:nn
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_peek_nonspace:NTF, \@@_peek_nonspace_remove:NTF, \@@_peek_nonspace_aux:nNNTF}
% Collect spaces in a loop, and put the collected spaces back in the
More information about the latex3-commits
mailing list.