[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Simplify names of auxiliaries to avoid duplication (20dad8df7)

Bruno Le Floch bruno at le-floch.fr
Mon Apr 6 01:37:34 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : scan-quark
Link       : https://github.com/latex3/latex3/commit/20dad8df78f8055b9febce804bb8626f0c1ef55b

>---------------------------------------------------------------

commit 20dad8df78f8055b9febce804bb8626f0c1ef55b
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Mon Apr 6 01:37:34 2020 +0200

    Simplify names of auxiliaries to avoid duplication
    
    The function that jumps to the next \q_@@_recursion_stop had two names,
    \@@_use_none_delimit_by_q_recursion_stop and
    \@@_use_none_delimit_by_q_@@_recursion_stop (well, with one less
    underscore than that, actually).  Now I've kept only the first.
    This relies on the earlier commit that reduces how flexible
    \__kernel_quark_test_generate is.


>---------------------------------------------------------------

20dad8df78f8055b9febce804bb8626f0c1ef55b
 l3kernel/l3debug.dtx              |  2 +-
 l3kernel/l3prg.dtx                | 14 +++++++-------
 l3kernel/l3quark.dtx              |  8 ++++----
 l3kernel/testfiles/m3quark002.lvt |  6 +++---
 l3kernel/testfiles/m3quark002.tlg | 22 +++++++++++-----------
 5 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/l3kernel/l3debug.dtx b/l3kernel/l3debug.dtx
index 01649fe2c..9d9b839ef 100644
--- a/l3kernel/l3debug.dtx
+++ b/l3kernel/l3debug.dtx
@@ -156,9 +156,9 @@
 % \begin{macro}[EXP]{\@@_if_recursion_tail_stop:N}
 %   Functions to query recursion quarks.
 %    \begin{macrocode}
-\__kernel_quark_test_generate:Nn \@@_if_recursion_tail_stop:N { @@ }
 \cs_new:Npn \@@_use_none_delimit_by_q_recursion_stop:w
   #1 \q_@@_recursion_stop { }
+\__kernel_quark_test_generate:Nn \@@_if_recursion_tail_stop:N { @@ }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/l3prg.dtx b/l3kernel/l3prg.dtx
index 082a83055..63b8c28f8 100644
--- a/l3kernel/l3prg.dtx
+++ b/l3kernel/l3prg.dtx
@@ -927,13 +927,6 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}[EXP]{\@@_if_recursion_tail_stop_do:nn}
-%   Functions to query recursion quarks.
-%    \begin{macrocode}
-\__kernel_quark_test_generate:Nn \@@_if_recursion_tail_stop_do:nn { @@ }
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{macro}[EXP]{\@@_use_i_delimit_by_q_recursion_stop:nw}
 %   Functions to gobble up to a quark.
 %    \begin{macrocode}
@@ -942,6 +935,13 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop_do:nn}
+%   Functions to query recursion quarks.
+%    \begin{macrocode}
+\__kernel_quark_test_generate:Nn \@@_if_recursion_tail_stop_do:nn { @@ }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}[pTF]{\bool_if:N, \bool_if:c}
 % \UnitTested
 %  Straight forward here. We could optimize here if we wanted to as
diff --git a/l3kernel/l3quark.dtx b/l3kernel/l3quark.dtx
index dffecdd15..af1c6d9f4 100644
--- a/l3kernel/l3quark.dtx
+++ b/l3kernel/l3quark.dtx
@@ -714,9 +714,9 @@
 %   \begin{verbatim}
 %     \__kernel_quark_test_generate:NNNn \__test_quark_tail:n { __test }
 %   \end{verbatim}
-%   then the first auxiliary will be \cs[no-index]{__test_if_test_recursion_tail:w},
+%   then the first auxiliary will be \cs[no-index]{__test_quark_recursion_tail:w},
 %   and the second one will be
-%   \cs[no-index]{__test_use_none_delimit_by_q_test_recursion_stop:w}.
+%   \cs[no-index]{__test_use_none_delimit_by_q_recursion_stop:w}.
 %
 %   Note that the actual quarks are \emph{not} defined here. They should
 %   be defined separately using \cs{quark_new:N}.
@@ -724,8 +724,8 @@
 \cs_new_protected:Npn \@@_test_generate_aux_do:nNNnnnnN #1 #2 #3 #4 #5
   {
     \exp_args:Ncc \@@_test_define_aux:NNNNnnN
-      { #1 _if_ \@@_get_name:N #2 :w }
-      { #1 _use_ #4 _delimit_by_q_ \@@_get_name:N #3 : #5 w }
+      { #1 _quark_recursion_tail:w }
+      { #1 _use_ #4 _delimit_by_q_recursion_stop: #5 w }
       #2 #3
   }
 \cs_new_protected:Npn \@@_test_define_aux:NNNNnnN #1 #2 #3 #4 #5 #6 #7
diff --git a/l3kernel/testfiles/m3quark002.lvt b/l3kernel/testfiles/m3quark002.lvt
index 372b2fda5..88f7bad26 100644
--- a/l3kernel/testfiles/m3quark002.lvt
+++ b/l3kernel/testfiles/m3quark002.lvt
@@ -55,9 +55,9 @@
 }
 
 \TEST{Auxiliaries~to~the~kernel~quark~functions}{
-  \cs_log:N \__test_if_test_recursion_tail:w
-  \cs_log:N \__test_use_none_delimit_by_q_test_recursion_stop:w
-  \cs_log:N \__test_use_i_delimit_by_q_test_recursion_stop:nw
+  \cs_log:N \__test_quark_recursion_tail:w
+  \cs_log:N \__test_use_none_delimit_by_q_recursion_stop:w
+  \cs_log:N \__test_use_i_delimit_by_q_recursion_stop:nw
 }
 
 \TESTEXP{Inside~recursions~(expect~nothing)}{
diff --git a/l3kernel/testfiles/m3quark002.tlg b/l3kernel/testfiles/m3quark002.tlg
index 407a94ea2..ddd8973e2 100644
--- a/l3kernel/testfiles/m3quark002.tlg
+++ b/l3kernel/testfiles/m3quark002.tlg
@@ -8,16 +8,16 @@ TEST 1: New private quark functions (:n)
 ============================================================
 Defining \__test_quark_if_recursion_tail_stop:n on line ...
 > \__test_quark_if_recursion_tail_stop:n=\long macro:#1->\tl_if_empty:oTF
-{\__test_if_test_recursion_tail:w {}#1{}?!\q__test_recursion_tail
-??!}{\__test_use_none_delimit_by_q_test_recursion_stop:w }{}.
+{\__test_quark_recursion_tail:w {}#1{}?!\q__test_recursion_tail
+??!}{\__test_use_none_delimit_by_q_recursion_stop:w }{}.
 ============================================================
 ============================================================
 TEST 2: New private quark functions (:nn)
 ============================================================
 Defining \__test_quark_if_recursion_tail_stop_do:nn on line ...
 > \__test_quark_if_recursion_tail_stop_do:nn=\long macro:#1->\tl_if_empty:oTF
-{\__test_if_test_recursion_tail:w {}#1{}?!\q__test_recursion_tail
-??!}{\__test_use_i_delimit_by_q_test_recursion_stop:nw }{\use_none:n }.
+{\__test_quark_recursion_tail:w {}#1{}?!\q__test_recursion_tail
+??!}{\__test_use_i_delimit_by_q_recursion_stop:nw }{\use_none:n }.
 ============================================================
 ============================================================
 TEST 3: New private quark functions (:N)
@@ -25,7 +25,7 @@ TEST 3: New private quark functions (:N)
 Defining \__test_quark_if_recursion_tail_stop:N on line ...
 > \__test_quark_if_recursion_tail_stop:N=\long macro:#1->\if_meaning:w
 \q__test_recursion_tail #1\exp_after:wN
-\__test_use_none_delimit_by_q_test_recursion_stop:w \fi: .
+\__test_use_none_delimit_by_q_recursion_stop:w \fi: .
 ============================================================
 ============================================================
 TEST 4: New private quark functions (:Nn)
@@ -33,15 +33,15 @@ TEST 4: New private quark functions (:Nn)
 Defining \__test_quark_if_recursion_tail_stop_do:Nn on line ...
 > \__test_quark_if_recursion_tail_stop_do:Nn=\long macro:#1->\if_meaning:w
 \q__test_recursion_tail #1\exp_after:wN
-\__test_use_i_delimit_by_q_test_recursion_stop:nw \else: \exp_after:wN
-\use_none:n \fi: .
+\__test_use_i_delimit_by_q_recursion_stop:nw \else: \exp_after:wN \use_none:n
+\fi: .
 ============================================================
 ============================================================
 TEST 5: New private quark functions (:nN)
 ============================================================
 Defining \__test_quark_if_recursion_tail_break:nN on line ...
 > \__test_quark_if_recursion_tail_break:nN=\long macro:#1#2->\tl_if_empty:oTF
-{\__test_if_test_recursion_tail:w {}#1{}?!\q__test_recursion_tail ??!}{#2}{}.
+{\__test_quark_recursion_tail:w {}#1{}?!\q__test_recursion_tail ??!}{#2}{}.
 ============================================================
 ============================================================
 TEST 6: New private quark functions (:NN)
@@ -53,11 +53,11 @@ Defining \__test_quark_if_recursion_tail_break:NN on line ...
 ============================================================
 TEST 7: Auxiliaries to the kernel quark functions
 ============================================================
-> \__test_if_test_recursion_tail:w=\long macro:#1\q__test_recursion_tail
+> \__test_quark_recursion_tail:w=\long macro:#1\q__test_recursion_tail
 #2?#3?!->#1#2.
-> \__test_use_none_delimit_by_q_test_recursion_stop:w=\long
+> \__test_use_none_delimit_by_q_recursion_stop:w=\long
 macro:#1\q__test_recursion_stop ->.
-> \__test_use_i_delimit_by_q_test_recursion_stop:nw=\long
+> \__test_use_i_delimit_by_q_recursion_stop:nw=\long
 macro:#1#2\q__test_recursion_stop ->#1.
 ============================================================
 ============================================================





More information about the latex3-commits mailing list.