[latex3-commits] [git/LaTeX3-latex3-latex3] peek-regex: Reduce constraints on some integers since toks have fewer uses in l3regex (aa6fbc30f)

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/aa6fbc30f19bf5efa5b180b12ccdef2a9aa83e96

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

commit aa6fbc30f19bf5efa5b180b12ccdef2a9aa83e96
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Mon Jul 13 00:43:05 2020 +0200

    Reduce constraints on some integers since toks have fewer uses in l3regex


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

aa6fbc30f19bf5efa5b180b12ccdef2a9aa83e96
 l3kernel/l3regex.dtx | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 3046b0a93..8ca021612 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -4661,7 +4661,7 @@
 \cs_new_protected:Npn \@@_match:n #1
   {
     \int_zero:N \l_@@_balance_int
-    \int_set:Nn \l_@@_curr_pos_int { 2 * \l_@@_max_state_int }
+    \int_set:Nn \l_@@_curr_pos_int { 1 + \l_@@_max_state_int }
     \@@_query_set:nnn { } { -1 } { -2 }
     \int_set_eq:NN \l_@@_min_pos_int \l_@@_curr_pos_int
     \tl_analysis_map_inline:nn {#1}
@@ -4674,12 +4674,8 @@
 \cs_new_protected:Npn \@@_match_cs:n #1
   {
     \int_zero:N \l_@@_balance_int
-    \int_set:Nn \l_@@_curr_pos_int % ^^A TODO: change
-      {
-        \int_max:nn { 2 * \l_@@_max_state_int - \l_@@_min_state_int }
-        { \l_@@_max_pos_int }
-        + 1
-      }
+    \int_set:Nn \l_@@_curr_pos_int
+      { 1 + \int_max:nn \l_@@_max_state_int \l_@@_max_pos_int }
     \@@_query_set:nnn { } { -1 } { -2 }
     \int_set_eq:NN \l_@@_min_pos_int \l_@@_curr_pos_int
     \str_map_inline:nn {#1}





More information about the latex3-commits mailing list.