[latex3-commits] [git/LaTeX3-latex3-latex3] peek-regex: Use l3tl-build machinery when storing already-seen tokens in l3regex (dd9b2ba35)

Bruno Le Floch blflatex at gmail.com
Mon Jul 20 02:19:19 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : peek-regex
Link       : https://github.com/latex3/latex3/commit/dd9b2ba3503461473ba4024ab1cf3c5811152ef4

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

commit dd9b2ba3503461473ba4024ab1cf3c5811152ef4
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Sat Jul 18 19:35:58 2020 +0200

    Use l3tl-build machinery when storing already-seen tokens in l3regex


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

dd9b2ba3503461473ba4024ab1cf3c5811152ef4
 l3kernel/l3regex.dtx | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index cac170975..cfb002475 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -4584,7 +4584,8 @@
 %   The list \cs{l_@@_curr_analysis_tl} consists of a brace group
 %   containing three brace groups corresponding to the current token,
 %   with the same syntax as \cs{tl_analysis_map_inline:nn}.  The list
-%   \cs{l_@@_matched_analysis_tl} has one item for each token that has
+%   \cs{l_@@_matched_analysis_tl} (constructed under the
+%   \texttt{tl\_build} machinery) has one item for each token that has
 %   already been treated so far in a given match attempt: each item
 %   consists of three brace groups with the same syntax as
 %   \cs{tl_analysis_map_inline:nn}.
@@ -4700,7 +4701,7 @@
       }
     \int_zero:N \l_@@_step_int
     \int_set_eq:NN \l_@@_success_pos_int \l_@@_min_pos_int
-    \tl_clear:N \l_@@_matched_analysis_tl
+    \tl_build_begin:N \l_@@_matched_analysis_tl
     \tl_clear:N \l_@@_curr_analysis_tl
     \int_set:Nn \l_@@_min_submatch_int { 1 }
     \int_set_eq:NN \l_@@_submatch_int \l_@@_min_submatch_int
@@ -4747,14 +4748,16 @@
     \int_set:Nn \l_@@_curr_pos_int
       { \l_@@_start_pos_int - 1 }
     \int_set_eq:NN \l_@@_curr_char_int \l_@@_last_char_success_int
+    \tl_build_get:NN \l_@@_matched_analysis_tl \l_@@_internal_a_tl
     \exp_args:NNf \@@_match_once_init_aux:
-    \tl_map_inline:nn { \exp_after:wN \l_@@_matched_analysis_tl \l_@@_curr_analysis_tl }
+    \tl_map_inline:nn
+      { \exp_after:wN \l_@@_internal_a_tl \l_@@_curr_analysis_tl }
       { \@@_match_one_token:nnN ##1 }
     \prg_break_point:Nn \@@_maplike_break: { }
   }
 \cs_new_protected:Npn \@@_match_once_init_aux:
   {
-    \tl_clear:N \l_@@_matched_analysis_tl
+    \tl_build_clear:N \l_@@_matched_analysis_tl
     \tl_clear:N \l_@@_curr_analysis_tl
   }
 %    \end{macrocode}
@@ -4814,7 +4817,8 @@
     \tl_set:Nn \l_@@_curr_token_tl {#1}
     \int_set:Nn \l_@@_curr_char_int {#2}
     \int_set:Nn \l_@@_curr_catcode_int { "#3 }
-    \tl_put_right:No \l_@@_matched_analysis_tl { \l_@@_curr_analysis_tl }
+    \tl_build_put_right:Nx \l_@@_matched_analysis_tl
+      { \exp_not:o \l_@@_curr_analysis_tl }
     \tl_set:Nn \l_@@_curr_analysis_tl { { {#1} {#2} #3 } }
     \use:x
       {
@@ -5053,7 +5057,7 @@
           \l_@@_fresh_thread_bool
         \int_set_eq:NN \l_@@_success_pos_int \l_@@_curr_pos_int
         \int_set_eq:NN \l_@@_last_char_success_int \l_@@_last_char_int
-        \tl_clear:N \l_@@_matched_analysis_tl
+        \tl_build_clear:N \l_@@_matched_analysis_tl
         \tl_set_eq:NN \l_@@_success_submatches_tl
           \l_@@_curr_submatches_tl
         \prg_break:





More information about the latex3-commits mailing list.