[latex3-commits] [git/LaTeX3-latex3-latex3] master: Move \tl_count_tokens:n to stable (13a3b54)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Feb 26 09:05:33 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/13a3b54969bbd5b78ec0e3b9a82c919d0485a680

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

commit 13a3b54969bbd5b78ec0e3b9a82c919d0485a680
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Feb 26 08:05:33 2019 +0000

    Move \tl_count_tokens:n to stable


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

13a3b54969bbd5b78ec0e3b9a82c919d0485a680
 l3kernel/CHANGELOG.md                   |    2 ++
 l3kernel/l3candidates.dtx               |   41 -------------------------------
 l3kernel/l3tl.dtx                       |   40 ++++++++++++++++++++++++++++++
 l3kernel/testfiles/m3expl001.luatex.tlg |    8 +++---
 l3kernel/testfiles/m3expl001.ptex.tlg   |    8 +++---
 l3kernel/testfiles/m3expl001.tlg        |    8 +++---
 l3kernel/testfiles/m3expl001.uptex.tlg  |    8 +++---
 l3kernel/testfiles/m3expl001.xetex.tlg  |    8 +++---
 l3kernel/testfiles/m3expl003.luatex.tlg |    8 +++---
 l3kernel/testfiles/m3expl003.ptex.tlg   |    8 +++---
 l3kernel/testfiles/m3expl003.tlg        |    8 +++---
 l3kernel/testfiles/m3expl003.uptex.tlg  |    8 +++---
 l3kernel/testfiles/m3expl003.xetex.tlg  |    8 +++---
 13 files changed, 82 insertions(+), 81 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index b59412c..72370dd 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -17,6 +17,8 @@ this project uses date-based 'snapshot' version identifiers.
 - Return values from `\file_get:nnN`, `\file_get_...:nN`, \ior_get:NN\,
   `\sys_shell_get:nnN`
 - Moved coffin affine transformations to stable
+- Moved `\tl_count_tokens:n` to stable
+
 ### Removed
 
 - Experimental `\tl_reverse_tokens:n`
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index cbc9b07..c21da00 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -996,18 +996,6 @@
 %   Token groups (|{|\ldots|}|) are not single tokens.
 % \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,
@@ -2644,35 +2632,6 @@
 %    \end{macrocode}
 % \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/l3tl.dtx b/l3kernel/l3tl.dtx
index 9fcbab0..c88a8de 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -700,6 +700,16 @@
 %   giving an \meta{integer denotation}.
 % \end{function}
 %
+% \begin{function}[EXP, addd = 2019-02-25]{\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$.
+% \end{function}
+%
 % \begin{function}[updated = 2012-01-08, EXP]
 %   {\tl_reverse:n, \tl_reverse:V, \tl_reverse:o}
 %   \begin{syntax}
@@ -2427,6 +2437,36 @@
 % \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}
+%
 % \begin{macro}{\tl_reverse_items:n}
 % \begin{macro}{\@@_reverse_items:nwNwn}
 % \begin{macro}{\@@_reverse_items:wn}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 8eefd64..2c29c58 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -540,6 +540,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6081,10 +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_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 33ef963..5db63c2 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6115,10 +6119,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_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 7d57e85..4b43c45 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6115,10 +6119,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_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 a58fd50..dde2dc0 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6112,10 +6116,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_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 e34cb5b..ebab8d8 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6085,10 +6089,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_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 8eefd64..2c29c58 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -540,6 +540,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6081,10 +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_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 33ef963..5db63c2 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6115,10 +6119,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_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 7d57e85..4b43c45 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6115,10 +6119,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_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 a58fd50..dde2dc0 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6112,10 +6116,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_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 e34cb5b..ebab8d8 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -577,6 +577,10 @@ Defining \__tl_count:n on line ...
 Defining \tl_count:V on line ...
 Defining \tl_count:o on line ...
 Defining \tl_count:c 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_reverse_items:n on line ...
 Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
@@ -6085,10 +6089,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_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