[latex3-commits] [git/LaTeX3-latex3-latex3] master: Make tl-build public (ff868d3)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Mar 28 09:06:31 CEST 2018


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

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

commit ff868d39393d524f1dde5143e4f50b285b440f96
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Mar 28 07:55:31 2018 +0100

    Make tl-build public
    
    I've renamed the 'one' functions as 'add':
    hope this makes sense. Could perhaps be 'store'?


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

ff868d39393d524f1dde5143e4f50b285b440f96
 l3kernel/l3basics.dtx                   |    2 +-
 l3kernel/l3regex.dtx                    |  118 +++++++++++++++----------------
 l3kernel/l3tl-build.dtx                 |   79 ++++++++++++---------
 l3kernel/testfiles/m3expl001.luatex.tlg |   20 +++---
 l3kernel/testfiles/m3expl001.ptex.tlg   |   20 +++---
 l3kernel/testfiles/m3expl001.tlg        |   20 +++---
 l3kernel/testfiles/m3expl001.uptex.tlg  |   20 +++---
 l3kernel/testfiles/m3expl001.xetex.tlg  |   20 +++---
 l3kernel/testfiles/m3expl003.luatex.tlg |   20 +++---
 l3kernel/testfiles/m3expl003.ptex.tlg   |   20 +++---
 l3kernel/testfiles/m3expl003.tlg        |   20 +++---
 l3kernel/testfiles/m3expl003.uptex.tlg  |   20 +++---
 l3kernel/testfiles/m3expl003.xetex.tlg  |   20 +++---
 13 files changed, 225 insertions(+), 174 deletions(-)

diff --git a/l3kernel/l3basics.dtx b/l3kernel/l3basics.dtx
index 60bcad6..58d99c9 100644
--- a/l3kernel/l3basics.dtx
+++ b/l3kernel/l3basics.dtx
@@ -3561,7 +3561,7 @@
 % \begin{macro}{\prg_break_point:}
 % \begin{macro}{\prg_break:, \prg_break:n}
 %   Very simple analogues of \cs{prg_break_point:Nn} and
-%   \cs{@@_map_break:Nn}, for use in fast short-term recursions which
+%   \cs{prg_map_break:Nn}, for use in fast short-term recursions which
 %   are not mappings, do not need to support nesting, and in which
 %   nothing has to be done at the end of the loop.
 %    \begin{macrocode}
diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index fb25070..97f9327 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -1469,14 +1469,14 @@
 \__kernel_patch:nnNNpn
   {
     \@@_trace_push:nnN { regex } { 1 } \@@_escape_use:nnnn
-    \__tl_build:Nw \l_@@_internal_a_tl
-      \__tl_build_one:n { \@@_trace_pop:nnN { regex } { 1 } \@@_escape_use:nnnn }
+    \tl_build:Nw \l_@@_internal_a_tl
+      \tl_build_add:n { \@@_trace_pop:nnN { regex } { 1 } \@@_escape_use:nnnn }
       \use_none:nn
   }
   { }
 \cs_new_protected:Npn \@@_escape_use:nnnn #1#2#3#4
   {
-    \__tl_build:Nw \l_@@_internal_a_tl
+    \tl_build:Nw \l_@@_internal_a_tl
       \cs_set:Npn \@@_escape_unescaped:N ##1 { #1 }
       \cs_set:Npn \@@_escape_escaped:N ##1 { #2 }
       \cs_set:Npn \@@_escape_raw:N ##1 { #3 }
@@ -1487,8 +1487,8 @@
           \exp_after:wN \@@_escape_loop:N \g_@@_internal_tl
           { break } \prg_break_point:
         }
-      \__tl_build_one:o \l_@@_internal_b_tl
-    \__tl_build_end:
+      \tl_build_add:o \l_@@_internal_b_tl
+    \tl_build_end:
     \l_@@_internal_a_tl
   }
 %    \end{macrocode}
@@ -1583,7 +1583,7 @@
     \int_compare:nNnTF {#1} > \c_max_char_int
       {
         \if_false: { \fi: }
-        \__tl_build_one:o \l_@@_internal_b_tl
+        \tl_build_add:o \l_@@_internal_b_tl
         \__kernel_msg_error:nnx { kernel } { x-overflow } {#1}
         \tl_set:Nx \l_@@_internal_b_tl
           { \if_false: } \fi:
@@ -1672,7 +1672,7 @@
 \cs_new:Npn \@@_escape_x_loop_error:n #1
   {
     \if_false: { \fi: }
-    \__tl_build_one:o \l_@@_internal_b_tl
+    \tl_build_add:o \l_@@_internal_b_tl
     \__kernel_msg_error:nnx { kernel } { x-missing-rbrace } {#1}
     \tl_set:Nx \l_@@_internal_b_tl
       { \if_false: } \fi: \@@_escape_loop:N #1
@@ -2126,13 +2126,13 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_compile:w
   {
-    \__tl_build_x:Nw \l_@@_internal_regex
+    \tl_build_x:Nw \l_@@_internal_regex
       \int_zero:N \l_@@_group_level_int
       \int_set_eq:NN \l_@@_default_catcodes_int \c_@@_all_catcodes_int
       \int_set_eq:NN \l_@@_catcodes_int \l_@@_default_catcodes_int
       \cs_set:Npn \@@_item_equal:n  { \@@_item_caseful_equal:n }
       \cs_set:Npn \@@_item_range:nn { \@@_item_caseful_range:nn }
-      \__tl_build_one:n { \@@_branch:n { \if_false: } \fi: }
+      \tl_build_add:n { \@@_branch:n { \if_false: } \fi: }
   }
 \cs_new_protected:Npn \@@_compile_end:
   {
@@ -2149,17 +2149,17 @@
         \prg_replicate:nn
           { \l_@@_group_level_int }
           {
-              \__tl_build_one:n
+              \tl_build_add:n
                 {
                   \if_false: { \fi: }
                   \if_false: { \fi: } { 1 } { 0 } \c_true_bool
                 }
-            \__tl_build_end:
-            \__tl_build_one:o \l_@@_internal_regex
+            \tl_build_end:
+            \tl_build_add:o \l_@@_internal_regex
           }
       \fi:
-      \__tl_build_one:n { \if_false: { \fi: } }
-    \__tl_build_end:
+      \tl_build_add:n { \if_false: { \fi: } }
+    \tl_build_end:
   }
 %    \end{macrocode}
 % \end{macro}
@@ -2241,10 +2241,10 @@
     \@@_mode_quit_c:
     \@@_if_in_class:TF { }
       {
-        \__tl_build_one:n
+        \tl_build_add:n
           { \@@_class:NnnnN \c_true_bool { \if_false: } \fi: }
       }
-    \__tl_build_one:x
+    \tl_build_add:x
       {
         \if_int_compare:w \l_@@_catcodes_int < \c_@@_all_catcodes_int
           \@@_item_catcode:nT { \int_use:N \l_@@_catcodes_int }
@@ -2301,7 +2301,7 @@
 %   whatever characters were grabbed are left raw).
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_compile_quantifier_none:
-  { \__tl_build_one:n { \if_false: { \fi: } { 1 } { 0 } \c_false_bool } }
+  { \tl_build_add:n { \if_false: { \fi: } { 1 } { 0 } \c_false_bool } }
 \cs_new_protected:Npn \@@_compile_quantifier_abort:xNN #1#2#3
   {
     \@@_compile_quantifier_none:
@@ -2324,9 +2324,9 @@
 \cs_new_protected:Npn \@@_compile_quantifier_lazyness:nnNN #1#2#3#4
   {
     \str_if_eq:nnTF { #3 #4 } { \@@_compile_special:N ? }
-      { \__tl_build_one:n { \if_false: { \fi: } { #1 } { #2 } \c_true_bool } }
+      { \tl_build_add:n { \if_false: { \fi: } { #1 } { #2 } \c_true_bool } }
       {
-        \__tl_build_one:n { \if_false: { \fi: } { #1 } { #2 } \c_false_bool }
+        \tl_build_add:n { \if_false: { \fi: } { #1 } { #2 } \c_false_bool }
         #3 #4
       }
   }
@@ -2513,7 +2513,7 @@
         \if_int_compare:w `#1 > `#3 \exp_stop_f:
           \__kernel_msg_error:nnxx { kernel } { range-backwards } {#1} {#3}
         \else:
-          \__tl_build_one:x
+          \tl_build_add:x
             {
               \if_int_compare:w `#1 = `#3 \exp_stop_f:
                 \@@_item_equal:n
@@ -2527,7 +2527,7 @@
       {
         \__kernel_msg_warning:nnxx { kernel } { range-missing-end }
           {#1} { \c_backslash_str #3 }
-        \__tl_build_one:x
+        \tl_build_add:x
           {
             \@@_item_equal:n { \int_value:w `#1 \exp_stop_f: }
             \@@_item_equal:n { \int_value:w `- \exp_stop_f: }
@@ -2611,7 +2611,7 @@
   {
     \@@_if_in_class_or_catcode:TF {#2}
       {
-        \__tl_build_one:n
+        \tl_build_add:n
           { \@@_assertion:Nn \c_true_bool { \@@_anchor:N #1 } }
       }
   }
@@ -2648,7 +2648,7 @@
     \@@_if_in_class_or_catcode:TF
       { \@@_compile_raw_error:N b }
       {
-        \__tl_build_one:n
+        \tl_build_add:n
           { \@@_assertion:Nn \c_true_bool { \@@_b_test: } }
       }
   }
@@ -2657,7 +2657,7 @@
     \@@_if_in_class_or_catcode:TF
       { \@@_compile_raw_error:N B }
       {
-        \__tl_build_one:n
+        \tl_build_add:n
           { \@@_assertion:Nn \c_false_bool { \@@_b_test: } }
       }
   }
@@ -2678,7 +2678,7 @@
     \@@_if_in_class:TF
       {
         \if_int_compare:w \l_@@_mode_int > \c_@@_catcode_in_class_mode_int
-          \__tl_build_one:n { \if_false: { \fi: } }
+          \tl_build_add:n { \if_false: { \fi: } }
         \fi:
         \tex_advance:D \l_@@_mode_int - 15 \exp_stop_f:
         \tex_divide:D \l_@@_mode_int 13 \exp_stop_f:
@@ -2742,7 +2742,7 @@
 \cs_new_protected:Npn \@@_compile_class_catcode:w #1;
   {
     \if_int_compare:w \l_@@_mode_int = \c_@@_catcode_mode_int
-      \__tl_build_one:n
+      \tl_build_add:n
         { \@@_class:NnnnN \c_true_bool { \if_false: } \fi: }
     \fi:
     \int_set_eq:NN \l_@@_catcodes_int \l_@@_default_catcodes_int
@@ -2764,11 +2764,11 @@
     \l_@@_mode_int = \int_value:w \l_@@_mode_int 3 \exp_stop_f:
     \str_if_eq:nnTF { #3 #4 } { \@@_compile_special:N ^ }
       {
-        \__tl_build_one:n { #2 { \if_false: } \fi: }
+        \tl_build_add:n { #2 { \if_false: } \fi: }
         \@@_compile_class:NN
       }
       {
-        \__tl_build_one:n { #1 { \if_false: } \fi: }
+        \tl_build_add:n { #1 { \if_false: } \fi: }
         \@@_compile_class:NN #3 #4
       }
   }
@@ -2879,20 +2879,20 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_compile_group_begin:N #1
   {
-    \__tl_build_one:n { #1 { \if_false: } \fi: }
+    \tl_build_add:n { #1 { \if_false: } \fi: }
     \@@_mode_quit_c:
-    \__tl_build:Nw \l_@@_internal_regex
+    \tl_build:Nw \l_@@_internal_regex
       \int_set_eq:NN \l_@@_default_catcodes_int \l_@@_catcodes_int
       \int_incr:N \l_@@_group_level_int
-      \__tl_build_one:n { \@@_branch:n { \if_false: } \fi: }
+      \tl_build_add:n { \@@_branch:n { \if_false: } \fi: }
   }
 \cs_new_protected:Npn \@@_compile_group_end:
   {
     \if_int_compare:w \l_@@_group_level_int > 0 \exp_stop_f:
-        \__tl_build_one:n { \if_false: { \fi: } }
-      \__tl_build_end:
+        \tl_build_add:n { \if_false: { \fi: } }
+      \tl_build_end:
       \int_set_eq:NN \l_@@_catcodes_int \l_@@_default_catcodes_int
-      \__tl_build_one:o \l_@@_internal_regex
+      \tl_build_add:o \l_@@_internal_regex
       \exp_after:wN \@@_compile_quantifier:w
     \else:
       \__kernel_msg_warning:nn { kernel } { extra-rparen }
@@ -2941,7 +2941,7 @@
   {
     \@@_if_in_class:TF { \@@_compile_raw:N | }
       {
-        \__tl_build_one:n
+        \tl_build_add:n
           { \if_false: { \fi: } \@@_branch:n { \if_false: } \fi: }
       }
   }
@@ -3315,7 +3315,7 @@
   {
     \tl_gset:Nx \g_@@_internal_tl
       { \exp_args:No \__str_to_other_fast:n { \l_@@_internal_a_tl } }
-    \__tl_build_one:x
+    \tl_build_add:x
       {
         \tl_map_function:NN \g_@@_internal_tl
           \@@_compile_u_in_cs_aux:n
@@ -3340,7 +3340,7 @@
   {
     \exp_args:No \__tl_analysis_map_inline:nn { \l_@@_internal_a_tl }
       {
-        \__tl_build_one:n
+        \tl_build_add:n
           {
             \@@_class:NnnnN \c_true_bool
               {
@@ -3368,7 +3368,7 @@
 \cs_new_protected:cpn { @@_compile_/K: }
   {
     \int_compare:nNnTF \l_@@_mode_int = \c_@@_outer_mode_int
-      { \__tl_build_one:n { \@@_command_K: } }
+      { \tl_build_add:n { \@@_command_K: } }
       { \@@_compile_raw_error:N K }
   }
 %    \end{macrocode}
@@ -3384,7 +3384,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_show:N #1
   {
-    \__tl_build:Nw \l_@@_internal_a_tl
+    \tl_build:Nw \l_@@_internal_a_tl
       \cs_set_protected:Npn \@@_branch:n
         {
           \seq_pop_right:NN \l_@@_show_prefix_seq \l_@@_internal_a_tl
@@ -3431,7 +3431,7 @@
       \seq_clear:N \l_@@_show_prefix_seq
       \@@_show_push:n { ~ }
       \cs_if_exist_use:N #1
-    \__tl_build_end:
+    \tl_build_end:
   }
 %    \end{macrocode}
 % \end{macro}
@@ -3443,7 +3443,7 @@
 \cs_new_protected:Npn \@@_show_one:n #1
   {
     \int_incr:N \l_@@_show_lines_int
-    \__tl_build_one:x
+    \tl_build_add:x
       {
         \exp_not:N \iow_newline:
         \seq_map_function:NN \l_@@_show_prefix_seq \use:n
@@ -3504,7 +3504,7 @@
 %    \begin{macrocode}
 \cs_set:Npn \@@_show_class:NnnnN #1#2#3#4#5
   {
-    \__tl_build:Nw \l_@@_internal_a_tl
+    \tl_build:Nw \l_@@_internal_a_tl
       \int_zero:N \l_@@_show_lines_int
       \@@_show_push:n {~}
       #2
@@ -3513,32 +3513,32 @@
       {
         {0}
           {
-            \__tl_build_end:
+            \tl_build_end:
             \@@_show_one:n { \bool_if:NTF #1 { Fail } { Pass } }
           }
         {1}
           {
-            \__tl_build_end:
+            \tl_build_end:
             \bool_if:NTF #1
               {
                 #2
-                \__tl_build_one:n { \@@_msg_repeated:nnN {#3} {#4} #5 }
+                \tl_build_add:n { \@@_msg_repeated:nnN {#3} {#4} #5 }
               }
               {
                 \@@_show_one:n
                   { Don't~match~\@@_msg_repeated:nnN {#3} {#4} #5 }
-                \__tl_build_one:o \l_@@_internal_a_tl
+                \tl_build_add:o \l_@@_internal_a_tl
               }
           }
       }
       {
-        \__tl_build_end:
+        \tl_build_end:
         \@@_show_one:n
           {
             \bool_if:NTF #1 { M } { Don't~m } atch
             \@@_msg_repeated:nnN {#3} {#4} #5
           }
-        \__tl_build_one:o \l_@@_internal_a_tl
+        \tl_build_add:o \l_@@_internal_a_tl
       }
   }
 %    \end{macrocode}
@@ -5112,7 +5112,7 @@
   { \@@_trace_pop:nnN { regex } { 1 } \@@_replacement:n }
 \cs_new_protected:Npn \@@_replacement:n #1
   {
-    \__tl_build:Nw \l_@@_internal_a_tl
+    \tl_build:Nw \l_@@_internal_a_tl
       \int_zero:N \l_@@_balance_int
       \tl_clear:N \l_@@_balance_tl
       \@@_escape_use:nnnn
@@ -5131,7 +5131,7 @@
       \if_int_compare:w \l_@@_replacement_csnames_int > 0 \exp_stop_f:
         \__kernel_msg_error:nnx { kernel } { replacement-missing-rbrace }
           { \int_use:N \l_@@_replacement_csnames_int }
-        \__tl_build_one:x
+        \tl_build_add:x
           { \prg_replicate:nn \l_@@_replacement_csnames_int \cs_end: }
       \fi:
       \seq_if_empty:NF \l_@@_replacement_category_seq
@@ -5146,7 +5146,7 @@
           \l_@@_balance_tl
           - \@@_submatch_balance:n {##1}
         }
-    \__tl_build_end:
+    \tl_build_end:
     \exp_args:No \@@_replacement_aux:n \l_@@_internal_a_tl
   }
 \cs_new_protected:Npn \@@_replacement_aux:n #1
@@ -5176,7 +5176,7 @@
 \cs_new_protected:Npn \@@_replacement_normal:n #1
   {
     \tl_if_empty:NTF \l_@@_replacement_category_tl
-      { \__tl_build_one:n {#1} }
+      { \tl_build_add:n {#1} }
       { % (
         \token_if_eq_charcode:NNTF #1 )
           {
@@ -5228,7 +5228,7 @@
 \cs_new_protected:Npn \@@_replacement_put_submatch:n #1
   {
     \if_int_compare:w #1 < \l_@@_capturing_group_int
-      \__tl_build_one:n { \@@_query_submatch:n { #1 + ##1 } }
+      \tl_build_add:n { \@@_query_submatch:n { #1 + ##1 } }
       \if_int_compare:w \l_@@_replacement_csnames_int = 0 \exp_stop_f:
         \tl_put_right:Nn \l_@@_balance_tl
           {
@@ -5320,9 +5320,9 @@
 \cs_new_protected:Npn \@@_replacement_cu_aux:Nw #1
   {
     \if_case:w \l_@@_replacement_csnames_int
-      \__tl_build_one:n { \exp_not:n { \exp_after:wN #1 \cs:w } }
+      \tl_build_add:n { \exp_not:n { \exp_after:wN #1 \cs:w } }
     \else:
-      \__tl_build_one:n { \exp_not:n { \exp_after:wN \tl_to_str:V \cs:w } }
+      \tl_build_add:n { \exp_not:n { \exp_after:wN \tl_to_str:V \cs:w } }
     \fi:
     \int_incr:N \l_@@_replacement_csnames_int
   }
@@ -5351,7 +5351,7 @@
 \cs_new_protected:Npn \@@_replacement_rbrace:N #1
   {
     \if_int_compare:w \l_@@_replacement_csnames_int > 0 \exp_stop_f:
-      \__tl_build_one:n \cs_end:
+      \tl_build_add:n \cs_end:
       \int_decr:N \l_@@_replacement_csnames_int
     \else:
       \@@_replacement_normal:n {#1}
@@ -5428,7 +5428,7 @@
   \cs_new_protected:Npn \@@_replacement_char:nNN #1#2#3
     {
       \tex_lccode:D 0 = `#3 \scan_stop:
-      \tex_lowercase:D { \__tl_build_one:n {#1} }
+      \tex_lowercase:D { \tl_build_add:n {#1} }
     }
 %    \end{macrocode}
 % \end{macro}
@@ -5472,7 +5472,7 @@
 %   character, we prepare for two \texttt{x}-expansions.
 %    \begin{macrocode}
   \cs_new_protected:Npn \@@_replacement_c_C:w #1#2
-    { \__tl_build_one:n { \exp_not:N \exp_not:N \exp_not:c {#2} } }
+    { \tl_build_add:n { \exp_not:N \exp_not:N \exp_not:c {#2} } }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -5558,7 +5558,7 @@
         \__kernel_msg_error:nn { kernel } { replacement-null-space }
       \fi:
       \tex_lccode:D `\ = `#2 \scan_stop:
-      \tex_lowercase:D { \__tl_build_one:n {~} }
+      \tex_lowercase:D { \tl_build_add:n {~} }
     }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/l3tl-build.dtx b/l3kernel/l3tl-build.dtx
index 5c34c6c..16d2a2b 100644
--- a/l3kernel/l3tl-build.dtx
+++ b/l3kernel/l3tl-build.dtx
@@ -50,9 +50,6 @@
 %
 % \section{\pkg{l3tl-build} documentation}
 %
-% This module provides no user function: it is meant for kernel use
-% only.
-%
 % There are two main ways of building token lists from individual
 % tokens. Either in one go within an \texttt{x}-expanding assignment, or
 % by repeatedly using \cs{tl_put_right:Nn}. The first method takes a
@@ -62,7 +59,8 @@
 %
 % The goal of this module is to provide functions to build a token list
 % piece by piece in linear time, while allowing non-expandable
-% operations. This is achieved by abusing \tn{toks}: adding some tokens
+% operations. This is achieved by (ab)using \TeX{} \tn{toks} registers:
+% adding some tokens
 % to the token list is done by storing them in a free token register
 % (time $O(1)$ for each such operation). Those token registers are only
 % put together at the end, within an \texttt{x}-expanding assignment,
@@ -74,46 +72,53 @@
 % all this must be done in a group: we can't go and clobber the values
 % of legitimate \tn{toks} used by \LaTeXe{}.
 %
-% Since none of the current applications need the ability to insert
-% material on the left of the token list, I have not implemented
-% that. This could be done for instance by using odd-numbered \tn{toks}
-% for the left part, and even-numbered \tn{toks} for the right part.
+% This module only provides for adding material to the right of token
+% list variables: adding to the left could be achieved but is unlikely
+% to be generally useful.
+%
+% Note that this approach to building token lists requires careful handling:
+% the exact usage is important. In general, it should be reserved for cases where
+% a large number of non-expandable operations are required to construct
+% content.
 %
-% \subsection{Internal functions}
+% \subsection{Efficient token list construction}
 %
-% \begin{function}
+% \begin{function}[added = 2018-03-28]
 %   {
-%     \__tl_build:Nw, \__tl_gbuild:Nw,
-%     \__tl_build_x:Nw, \__tl_gbuild_x:Nw
+%     \tl_build:Nw, \tl_gbuild:Nw,
+%     \tl_build:Nw, \tl_gbuild:Nw,
+%     \tl_build_x:Nw, \tl_gbuild_x:Nw,
+%     \tl_build_x:Nw, \tl_gbuild_x:Nw
 %   }
 %   \begin{syntax}
-%     \cs{__tl_build:Nw} \meta{tl~var} \texttt{\ldots{}}
-%     \cs{__tl_build_one:n} \Arg{tokens_1} \texttt{\ldots{}}
-%     \cs{__tl_build_one:n} \Arg{tokens_2} \texttt{\ldots{}}
+%     \cs{tl_build:Nw} \meta{tl~var} \texttt{\ldots{}}
+%     \cs{tl_build_one:n} \Arg{tokens_1} \texttt{\ldots{}}
+%     \cs{tl_build_one:n} \Arg{tokens_2} \texttt{\ldots{}}
 %     \ldots{}
-%     \cs{__tl_build_end:}
+%     \cs{tl_build_end:}
 %   \end{syntax}
 %   Defines the \meta{tl~var} to contain the contents of \meta{tokens1}
 %   followed by \meta{tokens2}, \emph{etc.} This is built in such a way
 %   to be more efficient than repeatedly using \cs{tl_put_right:Nn}. The
 %   code in \enquote{\texttt{\ldots{}}} does not need to be
-%   expandable. The commands \cs{__tl_build:Nw} and \cs{__tl_build_end:}
+%   expandable. The commands \cs{tl_build:Nw} and \cs{tl_build_end:}
 %   start and end a group. The assignment to the \meta{tl~var} occurs
 %   just after the end of that group, using \cs{tl_set:Nn},
 %   \cs{tl_gset:Nn}, \cs{tl_set:Nx}, or \cs{tl_gset:Nx}.
 % \end{function}
 %
-% \begin{function}{\__tl_build_one:n, \__tl_build_one:o, \__tl_build_one:x}
+% \begin{function}[added = 2018-03-28]
+%   {\tl_build_add:n, \tl_build_add:o, \tl_build_add:x}
 %   \begin{syntax}
 %     \cs{__tl_build_one:n} \Arg{tokens}
 %   \end{syntax}
 %   This function may only be used within the scope of a
-%   \cs{__tl_build:Nw} function. It adds the \meta{tokens} on the
+%   \cs_tl_build:Nw} function. It adds the \meta{tokens} on the
 %   right of the current token list.
 % \end{function}
 %
-% \begin{function}{\__tl_build_end:}
-%   Ends the scope started by \cs{__tl_build:Nw}, and performs the
+% \begin{function}[added = 2018-03-28]{\tl_build_end:}
+%   Ends the scope started by \cs{tl_build:Nw}, and performs the
 %   relevant assignment.
 % \end{function}
 %
@@ -195,8 +200,10 @@
 %
 % \begin{macro}
 %   {
-%     \@@:Nw  , \@@_x:Nw  ,
-%     \__tl_gbuild:Nw , \__tl_gbuild_x:Nw
+%     \tl_build:Nw  , \tl_build_x:Nw  ,
+%     \tl_build:cw  , \tl_build_x:cw  ,
+%     \tl_gbuild:Nw , \tl_gbuild_x:Nw ,
+%     \tl_gbuild:cw , \tl_gbuild_x:cw
 %   }
 % \begin{macro}{\@@_aux:NNw}
 %   Similar to what is done for coffins: redefine some command, here
@@ -204,13 +211,13 @@
 %   \cs{@@_end:} for details). Then initialize the start index and
 %   the current index at zero, and empty the \texttt{result} token list.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@:Nw
+\cs_new_protected:Npn \tl_build:Nw
   { \@@_aux:NNw \tl_set:Nn }
-\cs_new_protected:Npn \@@_x:Nw
+\cs_new_protected:Npn \tl_build_x:Nw
   { \@@_aux:NNw \tl_set:Nx }
-\cs_new_protected:Npn \__tl_gbuild:Nw
+\cs_new_protected:Npn \tl_gbuild:Nw
   { \@@_aux:NNw \tl_gset:Nn }
-\cs_new_protected:Npn \__tl_gbuild_x:Nw
+\cs_new_protected:Npn \tl_gbuild_x:Nw
   { \@@_aux:NNw \tl_gset:Nx }
 \cs_new_protected:Npn \@@_aux:NNw #1#2
   {
@@ -221,11 +228,15 @@
       \int_zero:N \l_@@_index_int
       \tl_clear:N \l_@@_result_tl
   }
+\cs_generate_variant:Nn \tl_build:Nw { c }
+\cs_generate_variant:Nn \tl_build_x:Nw { c }
+\cs_generate_variant:Nn \tl_gbuild:Nw { c }
+\cs_generate_variant:Nn \tl_gbuild_x:Nw { c }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\@@_end:}
+% \begin{macro}{\tl_build_end:}
 % \begin{macro}{\@@_end_assignment:n}
 %   When we are done building a token list, unpack all \tn{toks} into
 %   the \texttt{result} token list, and expand this list before closing
@@ -235,7 +246,7 @@
 %   set it to a function which would clean up the contents of
 %   \cs{l_@@_result_tl}.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_end:
+\cs_new_protected:Npn \tl_build_end:
   {
       \@@_unpack:
       \exp_args:No
@@ -246,13 +257,13 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\@@_one:n, \@@_one:o, \@@_one:x}
+% \begin{macro}{\tl_build_add:n, \tl_build_add:o, \tl_build_add:x}
 %   Store the tokens in a free \tn{toks}, then move the pointer to the
 %   next one. If we overflow, unpack the current \tn{toks}, and reset
 %   the current index, preparing to fill more \tn{toks}.  This could be
 %   optimized by avoiding to read |#1|, using \tn{afterassignment}.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_one:n #1
+\cs_new_protected:Npn \tl_build_add:n #1
   {
     \tex_toks:D \l_@@_index_int {#1}
     \int_incr:N \l_@@_index_int
@@ -261,7 +272,7 @@
       \l_@@_index_int \l_@@_start_index_int
     \fi:
   }
-\cs_new_protected:Npn \@@_one:o #1
+\cs_new_protected:Npn \tl_build_add:o #1
   {
     \tex_toks:D \l_@@_index_int \exp_after:wN {#1}
     \int_incr:N \l_@@_index_int
@@ -270,8 +281,8 @@
       \l_@@_index_int \l_@@_start_index_int
     \fi:
   }
-\cs_new_protected:Npn \@@_one:x #1
-  { \use:x { \@@_one:n {#1} } }
+\cs_new_protected:Npn \tl_build_add:x #1
+  { \use:x { \tl_build_add:n {#1} } }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index b584a96..60d122a 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -4698,16 +4698,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 60a9c7a..c904a04 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -4635,16 +4635,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 248cda4..a036334 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -4635,16 +4635,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 3671c8f..30c9d9b 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -4635,16 +4635,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index d30d920..de9ddd8 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -4675,16 +4675,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index b584a96..60d122a 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -4698,16 +4698,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 60a9c7a..c904a04 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -4635,16 +4635,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 248cda4..a036334 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -4635,16 +4635,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 3671c8f..30c9d9b 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -4635,16 +4635,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index d30d920..de9ddd8 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -4675,16 +4675,20 @@ Defining \__tl_build_unpack: on line ...
 Defining \__tl_build_unpack_loop:w on line ...
 Defining \__tl_build_unpack_loop:n on line ...
 Defining \__tl_build_unpack_loop:f on line ...
-Defining \__tl_build:Nw on line ...
-Defining \__tl_build_x:Nw on line ...
-Defining \__tl_gbuild:Nw on line ...
-Defining \__tl_gbuild_x:Nw on line ...
+Defining \tl_build:Nw on line ...
+Defining \tl_build_x:Nw on line ...
+Defining \tl_gbuild:Nw on line ...
+Defining \tl_gbuild_x:Nw on line ...
 Defining \__tl_build_aux:NNw on line ...
-Defining \__tl_build_end: on line ...
+Defining \tl_build:cw on line ...
+Defining \tl_build_x:cw on line ...
+Defining \tl_gbuild:cw on line ...
+Defining \tl_gbuild_x:cw on line ...
+Defining \tl_build_end: on line ...
 Defining \__tl_build_end_assignment:n on line ...
-Defining \__tl_build_one:n on line ...
-Defining \__tl_build_one:o on line ...
-Defining \__tl_build_one:x on line ...
+Defining \tl_build_add:n on line ...
+Defining \tl_build_add:o on line ...
+Defining \tl_build_add:x on line ...
 Defining \__tl_analysis_int_eval:w on line ...
 Defining \s__tl on line ...
 Defining \l__tl_analysis_internal_tl on line ...





More information about the latex3-commits mailing list