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

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Dec 3 16:03:05 CET 2020


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

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

commit 7b9aea81c800d1bf9b008ffa8b436a9f4ce764f7
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


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

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

diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index f81206439..cd233ca6c 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.