[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Include \quark_if_..._break:nN in kernel quark tests (e190f3be6)
PhelypeOleinik
tex.phelype at gmail.com
Thu Mar 12 21:47:06 CET 2020
Repository : https://github.com/latex3/latex3
On branch : scan-quark
Link : https://github.com/latex3/latex3/commit/e190f3be69a91fc36f940e4560148a299ccfd3c2
>---------------------------------------------------------------
commit e190f3be69a91fc36f940e4560148a299ccfd3c2
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Thu Mar 12 17:47:06 2020 -0300
Include \quark_if_..._break:nN in kernel quark tests
>---------------------------------------------------------------
e190f3be69a91fc36f940e4560148a299ccfd3c2
l3kernel/l3clist.dtx | 10 ++--------
l3kernel/l3quark.dtx | 47 ++++++++++++++++++++++++++++++++++-------------
2 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/l3kernel/l3clist.dtx b/l3kernel/l3clist.dtx
index dca7bd352..d8cbbd437 100644
--- a/l3kernel/l3clist.dtx
+++ b/l3kernel/l3clist.dtx
@@ -815,14 +815,8 @@
% \begin{variable}{\@@_if_recursion_tail_break:nN,\@@_if_recursion_tail_stop:n}
% Functions to query recursion quarks.
% \begin{macrocode}
-% \__kernel_quark_test_generate:NNNn \@@_if_recursion_tail_break:nN
-% \q_@@_recursion_tail \q_@@_recursion_stop { @@ }
-\cs_new:Npn \@@_if_recursion_tail_break:nN #1#2
- {
- \tl_if_empty:oT
- { \@@_if_clist_recursion_tail:w {} #1 {} ?! \q_@@_recursion_tail ??! }
- {#2}
- }
+\__kernel_quark_test_generate:NNNn \@@_if_recursion_tail_break:nN
+ \q_@@_recursion_tail \q_@@_recursion_stop { @@ }
\__kernel_quark_test_generate:NNNn \@@_if_recursion_tail_stop:n
\q_@@_recursion_tail \q_@@_recursion_stop { @@ }
% \end{macrocode}
diff --git a/l3kernel/l3quark.dtx b/l3kernel/l3quark.dtx
index 1c6214475..82c0d2c06 100644
--- a/l3kernel/l3quark.dtx
+++ b/l3kernel/l3quark.dtx
@@ -472,14 +472,16 @@
% (as \cs{q_recursion_stop}) as the delimiter quark. |#4| is the name-space
% to be used (for example |__quark|).
%
-% There are four possible function types which this funciton can define,
+% There are six possible function types which this funciton can define,
% and which is defined depends on the signature of the function being
% defined:
% \begin{description}
% \item[\texttt{:n}:~] defines \cs{quark_if_recursion_tail_stop:n}
% \item[\texttt{:nn}:~] defines \cs{quark_if_recursion_tail_stop_do:nn}
+% \item[\texttt{:nN}:~] defines \cs{quark_if_recursion_tail_break:nN}
% \item[\texttt{:N}:~] defines \cs{quark_if_recursion_tail_stop:N}
% \item[\texttt{:Nn}:~] defines \cs{quark_if_recursion_tail_stop_do:Nn}
+% \item[\texttt{:NN}:~] defines \cs{quark_if_recursion_tail_break:NN}
% \end{description}
% Any other signature causes an error, as does a function without signature.
% \begin{macrocode}
@@ -514,8 +516,9 @@
% \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,
% }
-% These macros implement the four possibilities mentioned above, passing
+% These macros implement the six possibilities mentioned above, passing
% the right arguments to \cs{@@_test_generate_aux_do:nNNnnnn},
% which defines some auxiliaries, and then to
% \cs{@@_test_generate_define_tl:NNNNn} (|:n(n)| variants) or to
@@ -532,6 +535,11 @@
\@@_test_generate_aux_do:nNNnnnn {#4} #2 #3 { i } { n } {##1} {##2}
\@@_test_generate_define_tl:NNNNn #1 { \use_none:n }
}
+\cs_new_protected:Npn \@@_test_generate_nN:NNNn #1 #2 #3 #4
+ {
+ \@@_test_generate_aux_do:nNNnnnn {#4} #2 #3 { i } { n } {##1} {##2}
+ \@@_test_generate_define_break_tl:NNNNn #1 { }
+ }
\cs_new_protected:Npn \@@_test_generate_N:NNNn #1 #2 #3 #4
{
\@@_test_generate_aux_do:nNNnnnn {#4} #2 #3 { none } { } { } { }
@@ -542,6 +550,11 @@
\@@_test_generate_aux_do:nNNnnnn {#4} #2 #3 { i } { n } {##1} {##2}
\@@_test_generate_define_ifx:NNNNn #1 { \use_none:n }
}
+\cs_new_protected:Npn \@@_test_generate_NN:NNNn #1 #2 #3 #4
+ {
+ \@@_test_generate_aux_do:nNNnnnn {#4} #2 #3 { i } { n } {##1} {##2}
+ \@@_test_generate_define_break_ifx:NNNNn #1 { }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -580,7 +593,7 @@
{
\cs_gset:Npn #1 ##1 #3 ##2 ? ##3 ?! { ##1 ##2 }
\cs_gset:Npn #2 ##1 #6 #4 {#5}
- #7 #1 #2 #3
+ #7 {##1} #1 #2 #3
}
% \end{macrocode}
% \end{macro}
@@ -589,29 +602,37 @@
% \@@_test_generate_define_tl:NNNNn,
% \@@_test_generate_define_ifx:NNNNn
% }
+% \begin{macro}{
+% \@@_test_generate_define_break_tl:NNNNn,
+% \@@_test_generate_define_break_ifx:NNNNn
+% }
% Finally, these two macros define the main conditional function using
% what's been set up before.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_test_generate_define_tl:NNNNn #1 #2 #3 #4 #5
+\cs_new_protected:Npn \@@_test_generate_define_tl:NNNNn #1 #2 #3 #4 #5 #6
{
- \cs_new:Npn #4 ##1
+ \cs_new:Npn #5 #1
{
\tl_if_empty:oTF
- { #1 {} ##1 {} ?! #3 ??! }
- {#2} {#5}
+ { #2 {} ##1 {} ?! #4 ??! }
+ {#3} {#6}
}
}
-\cs_new_protected:Npn \@@_test_generate_define_ifx:NNNNn #1 #2 #3 #4 #5
+\cs_new_protected:Npn \@@_test_generate_define_ifx:NNNNn #1 #2 #3 #4 #5 #6
{
- \cs_new:Npx #4 ##1
+ \cs_new:Npx #5 #1
{
- \exp_not:N \if_meaning:w \exp_not:N #3 ##1
- \exp_not:n { \exp_after:wN #2 }
- \tl_if_empty:nF {#5}
- { \exp_not:n { \else: \exp_after:wN #5 } }
+ \exp_not:N \if_meaning:w \exp_not:N #4 ##1
+ \exp_not:N \exp_after:wN \exp_not:N #3
+ \tl_if_empty:nF {#6}
+ { \exp_not:n { \else: \exp_after:wN #6 } }
\exp_not:N \fi:
}
}
+\cs_new:Npn \@@_test_generate_define_break_tl:NNNNn #1 #2 #3
+ { \@@_test_generate_define_tl:NNNNn {##1##2} #2 {##2} }
+\cs_new:Npn \@@_test_generate_define_break_ifx:NNNNn #1 #2 #3
+ { \@@_test_generate_define_ifx:NNNNn {##1##2} #2 {##2} }
% \end{macrocode}
% \end{macro}
%
More information about the latex3-commits
mailing list.