[latex3-commits] [git/LaTeX3-latex3-latex3] tl-token: Remove \tl_count_tokens:n and \tl_reverse_tokens:n (ed538e8)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Feb 14 14:45:21 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : tl-token
Link       : https://github.com/latex3/latex3/commit/ed538e86923b87a6d9d2ec196f1478adbf9de7b1

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

commit ed538e86923b87a6d9d2ec196f1478adbf9de7b1
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Feb 14 13:45:21 2019 +0000

    Remove \tl_count_tokens:n and \tl_reverse_tokens:n


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

ed538e86923b87a6d9d2ec196f1478adbf9de7b1
 l3kernel/l3candidates.dtx               |  101 -------------------------------
 l3kernel/testfiles/m3expl001.luatex.tlg |    7 ---
 l3kernel/testfiles/m3expl001.ptex.tlg   |    7 ---
 l3kernel/testfiles/m3expl001.tlg        |    7 ---
 l3kernel/testfiles/m3expl001.uptex.tlg  |    7 ---
 l3kernel/testfiles/m3expl001.xetex.tlg  |    7 ---
 l3kernel/testfiles/m3expl003.luatex.tlg |    7 ---
 l3kernel/testfiles/m3expl003.ptex.tlg   |    7 ---
 l3kernel/testfiles/m3expl003.tlg        |    7 ---
 l3kernel/testfiles/m3expl003.uptex.tlg  |    7 ---
 l3kernel/testfiles/m3expl003.xetex.tlg  |    7 ---
 11 files changed, 171 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index ae4190f..38f5951 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -1034,38 +1034,6 @@
 %   Token groups (|{|\ldots|}|) are not single tokens.
 % \end{function}
 %
-% \begin{function}[EXP]{\tl_reverse_tokens:n}
-%   \begin{syntax}
-%     \cs{tl_reverse_tokens:n} \Arg{tokens}
-%   \end{syntax}
-%   This function, which works directly on \TeX{} tokens, reverses
-%   the order of the \meta{tokens}: the first becomes the last and
-%   the last becomes first. Spaces are preserved. The reversal
-%   also operates within brace groups, but the braces themselves
-%   are not exchanged, as this would lead to an unbalanced token
-%   list. For instance, \cs{tl_reverse_tokens:n} |{a~{b()}}|
-%   leaves |{)(b}~a| in the input stream. This function requires
-%   two steps of expansion.
-%   \begin{texnote}
-%     The result is returned within the \tn{unexpanded}
-%     primitive (\cs{exp_not:n}), which means that the token
-%     list does not expand further when appearing in an \texttt{x}-type
-%     argument expansion.
-%   \end{texnote}
-% \end{function}
-%
-% \begin{function}[EXP]{\tl_count_tokens:n}
-%   \begin{syntax}
-%     \cs{tl_count_tokens:n} \Arg{tokens}
-%   \end{syntax}
-%   Counts the number of \TeX{} tokens in the \meta{tokens} and leaves
-%   this information in the input stream. Every token, including spaces and
-%   braces, contributes one to the total; thus for instance, the token count of
-%   |a~{bc}| is $6$.
-%   This function requires three expansions,
-%   giving an \meta{integer denotation}.
-% \end{function}
-%
 % \begin{function}[EXP, added = 2014-06-30, updated = 2016-01-12]
 %   {
 %     \tl_lower_case:n,  \tl_upper_case:n,  \tl_mixed_case:n,
@@ -3222,75 +3190,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[EXP]{\tl_reverse_tokens:n}
-% \begin{macro}[EXP]{\@@_reverse_group:nn}
-%   The same as \cs{tl_reverse:n} but with recursion within brace groups.
-%    \begin{macrocode}
-\cs_new:Npn \tl_reverse_tokens:n #1
-  {
-    \__kernel_exp_not:w \exp_after:wN
-      {
-        \exp:w
-        \@@_act:NNNnn
-          \@@_reverse_normal:nN
-          \@@_reverse_group:nn
-          \@@_reverse_space:n
-          { }
-          {#1}
-      }
-  }
-\cs_new:Npn \@@_reverse_group:nn #1
-  {
-    \@@_act_group_recurse:Nnn
-      \@@_act_reverse_output:n
-      { \tl_reverse_tokens:n }
-  }
-%    \end{macrocode}
-% \end{macro}
-% \begin{macro}[EXP]{\@@_act_group_recurse:Nnn}
-%   In many applications of \cs{@@_act:NNNnn}, we need to recursively
-%   apply some transformation within brace groups, then output. In this
-%   code, |#1| is the output function, |#2| is the transformation,
-%   which should expand in two steps, and |#3| is the group.
-%    \begin{macrocode}
-\cs_new:Npn \@@_act_group_recurse:Nnn #1#2#3
-  {
-    \exp_args:Nf #1
-      { \exp_after:wN \exp_after:wN \exp_after:wN { #2 {#3} } }
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[EXP]{\tl_count_tokens:n}
-% \begin{macro}[EXP]{\@@_act_count_normal:nN,
-%     \@@_act_count_group:nn, \@@_act_count_space:n}
-%   The token count is computed through an \cs{int_eval:n} construction.
-%   Each \texttt{1+} is output to the \emph{left}, into the integer
-%   expression, and the sum is ended by the \cs{exp_end:} inserted by
-%   \cs{@@_act_end:wn} (which is technically implemented as  \cs{c_zero_int}).
-%   Somewhat a hack!
-%    \begin{macrocode}
-\cs_new:Npn \tl_count_tokens:n #1
-  {
-    \int_eval:n
-      {
-        \@@_act:NNNnn
-          \@@_act_count_normal:nN
-          \@@_act_count_group:nn
-          \@@_act_count_space:n
-          { }
-          {#1}
-      }
-  }
-\cs_new:Npn \@@_act_count_normal:nN #1 #2 { 1 + }
-\cs_new:Npn \@@_act_count_space:n #1 { 1 + }
-\cs_new:Npn \@@_act_count_group:nn #1 #2
-  { 2 + \tl_count_tokens:n {#2} + }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
 % \subsubsection{Deprecated functions}
 %
 % \begin{macro}[deprecated = 2020-12-31]
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index f7850a0..be4323d 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -6054,13 +6054,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 04f5df2..48bd505 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -6088,13 +6088,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 09f5d96..a394006 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -6088,13 +6088,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 6724ff3..c00e03b 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -6085,13 +6085,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 2c275a6..3fa0f3f 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -6058,13 +6058,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index f7850a0..be4323d 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -6054,13 +6054,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 04f5df2..48bd505 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -6088,13 +6088,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 09f5d96..a394006 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -6088,13 +6088,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 6724ff3..c00e03b 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -6085,13 +6085,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 2c275a6..3fa0f3f 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -6058,13 +6058,6 @@ Defining \tl_if_single_token_p:n on line ...
 Defining \tl_if_single_token:nT on line ...
 Defining \tl_if_single_token:nF on line ...
 Defining \tl_if_single_token:nTF on line ...
-Defining \tl_reverse_tokens:n on line ...
-Defining \__tl_reverse_group:nn on line ...
-Defining \__tl_act_group_recurse:Nnn on line ...
-Defining \tl_count_tokens:n on line ...
-Defining \__tl_act_count_normal:nN on line ...
-Defining \__tl_act_count_space:n on line ...
-Defining \__tl_act_count_group:nn on line ...
 Defining \tl_set_from_file:Nnn on line ...
 Defining \tl_set_from_file:cnn on line ...
 Defining \tl_gset_from_file:Nnn on line ...





More information about the latex3-commits mailing list