[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Simplify conditional-generate after 2f212319 (1bb9ac552)
PhelypeOleinik
tex.phelype at gmail.com
Wed Apr 29 02:35:23 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : scan-quark
Link : https://github.com/latex3/latex3/commit/1bb9ac552abf124060473ab5dd4b8d815f02ce8e
>---------------------------------------------------------------
commit 1bb9ac552abf124060473ab5dd4b8d815f02ce8e
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Tue Apr 28 21:35:23 2020 -0300
Simplify conditional-generate after 2f212319
>---------------------------------------------------------------
1bb9ac552abf124060473ab5dd4b8d815f02ce8e
l3kernel/l3quark.dtx | 53 +++++++++++++++++++++++++---------------------------
1 file changed, 25 insertions(+), 28 deletions(-)
diff --git a/l3kernel/l3quark.dtx b/l3kernel/l3quark.dtx
index d61158dcf..c05c53809 100644
--- a/l3kernel/l3quark.dtx
+++ b/l3kernel/l3quark.dtx
@@ -645,20 +645,17 @@
\cs_generate_variant:Nn \@@_test_generate:NNNn { Ncc }
\cs_new_protected:Npn \__kernel_quark_conditional_generate:Nn #1
{
- \@@_conditional_generate_aux:Nxxn #1
- { __ \@@_get_module_name:N #1 }
+ \@@_conditional_generate:Nxxn #1
{ \@@_get_quark_name:N #1 }
+ { __ \@@_get_module_name:N #1 }
}
-\cs_new_protected:Npn \@@_conditional_generate_aux:Nnnn #1 #2 #3
- { \@@_conditional_generate:Ncnn #1 { q #2 _ #3 } {#2} }
-\cs_generate_variant:Nn \@@_conditional_generate_aux:Nnnn { Nxx }
-\cs_new_protected:Npn \@@_conditional_generate:NNnn #1
+\cs_new_protected:Npn \@@_conditional_generate:Nnnn #1
{
\exp_last_unbraced:Nf \@@_test_generate_aux:nnNNnNnn
{ \cs_split_function:N #1 }
#1 { conditional }
}
-\cs_generate_variant:Nn \@@_conditional_generate:NNnn { Nc }
+\cs_generate_variant:Nn \@@_conditional_generate:Nnnn { Nxx }
\cs_new_protected:Npn \@@_test_generate_aux:nnNNnNnn #1 #2 #3 #4
{
\reverse_if:N \if_bool:N #3
@@ -670,7 +667,7 @@
}
\cs_new_protected:Npn \@@_test_generate_choose:nNnNnn #1 #2 #3
{
- \cs_if_exist_use:cTF { @@_#3_generate_#1:NNNn } {#2}
+ \cs_if_exist_use:cTF { @@_#3_generate_#1:Nnnn } { #2 }
{
\__kernel_msg_error:nnxx { kernel } { invalid-quark-function }
{ \token_to_str:N #2 } {#1}
@@ -683,9 +680,9 @@
% \end{macro}
%
% \begin{macro}{
-% \@@_test_generate_n:NNNn, \@@_test_generate_nn:NNNn,
-% \@@_test_generate_N:NNNn, \@@_test_generate_Nn:NNNn,
-% \@@_test_generate_NN:NNNn, \@@_test_generate_NN:NNNn,
+% \@@_test_generate_n:Nnnn, \@@_test_generate_nn:Nnnn,
+% \@@_test_generate_N:Nnnn, \@@_test_generate_Nn:Nnnn,
+% \@@_test_generate_NN:Nnnn, \@@_test_generate_NN:Nnnn,
% }
% These macros implement the six possibilities mentioned above, passing
% the right arguments to \cs{@@_test_generate_aux_do:nNNnnnnN},
@@ -694,32 +691,32 @@
% \cs{@@_test_generate_define_ifx:nNNNNn} (|:N(n)|) which define the
% main conditionals.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_generate_n:NNNn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_generate_n:Nnnn #1 #2 #3 #4
{
\@@_test_generate_aux_do:nNNnnnnN {#4} #2 #3 { none } { } { } { }
\@@_test_generate_define_tl:nNNNNn #1 { }
}
-\cs_new_protected:Npn \@@_test_generate_nn:NNNn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_generate_nn:Nnnn #1 #2 #3 #4
{
\@@_test_generate_aux_do:nNNnnnnN {#4} #2 #3 { i } { n } {##1} {##2}
\@@_test_generate_define_tl:nNNNNn #1 { \use_none:n }
}
-\cs_new_protected:Npn \@@_test_generate_nN:NNNn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_generate_nN:Nnnn #1 #2 #3 #4
{
\@@_test_generate_aux_do:nNNnnnnN {#4} #2 #3 { i } { n } {##1} {##2}
\@@_test_generate_define_break_tl:nNNNNn #1 { }
}
-\cs_new_protected:Npn \@@_test_generate_N:NNNn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_generate_N:Nnnn #1 #2 #3 #4
{
\@@_test_generate_aux_do:nNNnnnnN {#4} #2 #3 { none } { } { } { }
\@@_test_generate_define_ifx:nNNNNn #1 { }
}
-\cs_new_protected:Npn \@@_test_generate_Nn:NNNn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_generate_Nn:Nnnn #1 #2 #3 #4
{
\@@_test_generate_aux_do:nNNnnnnN {#4} #2 #3 { i } { n } {##1} {##2}
\@@_test_generate_define_ifx:nNNNNn #1 { \use_none:n }
}
-\cs_new_protected:Npn \@@_test_generate_NN:NNNn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_generate_NN:Nnnn #1 #2 #3 #4
{
\@@_test_generate_aux_do:nNNnnnnN {#4} #2 #3 { i } { n } {##1} {##2}
\@@_test_generate_define_break_ifx:nNNNNn #1 { }
@@ -806,41 +803,41 @@
% \end{macro}
%
% \begin{macro}{
-% \@@_conditional_generate_n:NNNn,
-% \@@_conditional_generate_N:NNNn,
+% \@@_conditional_generate_n:Nnnn,
+% \@@_conditional_generate_N:Nnnn,
% }
% These macros implement the two possibilities for branching quark
% conditionals, passing
-% the right arguments to \cs{@@_conditional_generate_aux_do:nN},
+% the right arguments to \cs{@@_conditional_generate_aux_do:nn},
% which defines some auxiliaries, and then to
% \cs{@@_conditional_generate_define:nNNNNn} which defines the
% main conditionals.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_conditional_generate_n:NNNn #1 #2 #3
+\cs_new_protected:Npn \@@_conditional_generate_n:Nnnn #1 #2 #3
{
- \@@_conditional_generate_aux_do:nN {#3} #2
+ \@@_conditional_generate_aux_do:nn {#3} {#2}
\@@_conditional_generate_define:nNNNNn #1 \use_i:nn
}
-\cs_new_protected:Npn \@@_conditional_generate_N:NNNn #1 #2 #3
+\cs_new_protected:Npn \@@_conditional_generate_N:Nnnn #1 #2 #3
{
- \@@_conditional_generate_aux_do:nN {#3} #2
+ \@@_conditional_generate_aux_do:nn {#3} {#2}
\@@_conditional_generate_define:nNNNNn #1 \use_ii:nn
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{
-% \@@_conditional_generate_aux_do:nN,
+% \@@_conditional_generate_aux_do:nn,
% \@@_conditional_define_aux:NN,
% \@@_conditional_generate_define:nNNNNn
% }
% Similar to the previous macros, but branching conditionals only require
% one auxiliary, so we take a shortcut.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_conditional_generate_aux_do:nN #1 #2
+\cs_new_protected:Npn \@@_conditional_generate_aux_do:nn #1 #2
{
- \exp_args:Nc \@@_conditional_define_aux:NN
- { #1 _if_ \@@_get_name:N #2 :w } #2
+ \exp_args:Ncc \@@_conditional_define_aux:NN
+ { #1 _if_quark_ #2 :w } { q #1 _ #2 }
}
\cs_new_protected:Npn \@@_conditional_define_aux:NN #1 #2 #3
{
More information about the latex3-commits
mailing list.