[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Replace quarks by scan marks in l3fp-{aux, parse, logic} (590593038)

PhelypeOleinik tex.phelype at gmail.com
Fri Mar 20 14:41:09 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : scan-quark
Link       : https://github.com/latex3/latex3/commit/590593038e1e31c20bbb30d80a87e218c5f8753d

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

commit 590593038e1e31c20bbb30d80a87e218c5f8753d
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Fri Mar 20 10:41:09 2020 -0300

    Replace quarks by scan marks in l3fp-{aux,parse,logic}
    
    These three share \@@_if_type_fp:NTwFw, so they must be changed on one go


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

590593038e1e31c20bbb30d80a87e218c5f8753d
 l3kernel/l3fp-aux.dtx             | 35 +++++++++++++++++++++++++----------
 l3kernel/l3fp-logic.dtx           | 18 +++++++++---------
 l3kernel/l3fp-parse.dtx           | 12 ++++++------
 l3kernel/testfiles/m3quark001.tlg |  5 +++--
 4 files changed, 43 insertions(+), 27 deletions(-)

diff --git a/l3kernel/l3fp-aux.dtx b/l3kernel/l3fp-aux.dtx
index 20a7325d6..cc1ab7e85 100644
--- a/l3kernel/l3fp-aux.dtx
+++ b/l3kernel/l3fp-aux.dtx
@@ -245,12 +245,27 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\s_@@_expr_mark, \s_@@_expr_stop}
+% \begin{variable}{\s_@@_expr_mark, \s_@@_expr_stop}
 %   Aliases of \cs{tex_relax:D}, used to terminate expressions.
 %    \begin{macrocode}
 \scan_new:N \s_@@_expr_mark
 \scan_new:N \s_@@_expr_stop
 %    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\s_@@_mark, \s_@@_stop}
+%   Generic scan marks used throughout the module.
+%    \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_s_stop:nw}
+%   Functions to gobble up to a scan mark.
+%    \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}
@@ -378,7 +393,7 @@
     \@@_if_type_fp:NTwFw
       #1 \@@_use_ii_until_s:nnw
       \s_@@ { \@@_use_i_until_s:nw 4 }
-      \q_stop
+      \s_@@_stop
   }
 %    \end{macrocode}
 % \end{macro}
@@ -545,7 +560,7 @@
 %   \meta{code}.  The very unusual syntax is for optimization purposes
 %   as that function is used for all floating point operations.
 %    \begin{macrocode}
-\cs_new:Npn \@@_if_type_fp:NTwFw #1 \s_@@ #2 #3 \q_stop {#2}
+\cs_new:Npn \@@_if_type_fp:NTwFw #1 \s_@@ #2 #3 \s_@@_stop {#2}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -562,7 +577,7 @@
     \@@_if_type_fp:NTwFw
       #1 \@@_array_if_all_fp_loop:w
       \s_@@ { \prg_break:n \use_iii:nnn }
-      \q_stop
+      \s_@@_stop
   }
 %    \end{macrocode}
 % \end{macro}
@@ -579,17 +594,17 @@
     \@@_if_type_fp:NTwFw
       #1 { }
       \s_@@ { \@@_type_from_scan_other:N #1 }
-      \q_stop
+      \s_@@_stop
   }
 \cs_new:Npx \@@_type_from_scan_other:N #1
   {
     \exp_not:N \exp_after:wN \exp_not:N \@@_type_from_scan:w
-    \exp_not:N \token_to_str:N #1 \exp_not:N \q_mark
-      \tl_to_str:n { s_@@ _? } \exp_not:N \q_mark \exp_not:N \q_stop
+    \exp_not:N \token_to_str:N #1 \exp_not:N \s_@@_mark
+      \tl_to_str:n { s_@@ _? } \exp_not:N \s_@@_mark \exp_not:N \s_@@_stop
   }
 \exp_last_unbraced:NNNNo
   \cs_new:Npn \@@_type_from_scan:w #1
-    { \tl_to_str:n { s_@@ } } #2 \q_mark #3 \q_stop {#2}
+    { \tl_to_str:n { s_@@ } } #2 \s_@@_mark #3 \s_@@_stop {#2}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -614,7 +629,7 @@
           \cs_end:
           #2 #3
         }
-      \q_stop
+      \s_@@_stop
   }
 \exp_last_unbraced:NNNNo
   \cs_new:Npn \@@_change_func_type_aux:w #1 { \tl_to_str:n { @@ } } { }
@@ -649,7 +664,7 @@
     \@@_if_type_fp:NTwFw
       #2 \@@_exp_after_f:nw
       \s_@@ { \@@_exp_after_any_f:Nnw #2 }
-      \q_stop
+      \s_@@_stop
     {#1} #2
   }
 \cs_new_eq:NN \@@_exp_after_expr_stop_f:nw \use_none:nn
diff --git a/l3kernel/l3fp-logic.dtx b/l3kernel/l3fp-logic.dtx
index 25a0461ae..c046b8f49 100644
--- a/l3kernel/l3fp-logic.dtx
+++ b/l3kernel/l3fp-logic.dtx
@@ -125,8 +125,8 @@
   {
     \if_charcode:w 0
           \@@_if_type_fp:NTwFw
-            #1 { \use_i_delimit_by_q_stop:nw #3 \q_stop }
-            \s_@@ 1 \q_stop
+            #1 { \@@_use_i_delimit_by_s_stop:nw #3 \s_@@_stop }
+            \s_@@ 1 \s_@@_stop
       \prg_return_false:
     \else:
       \prg_return_true:
@@ -181,8 +181,8 @@
 \cs_new:Npn \@@_compare_back_any:ww #1#2; #3
   {
     \@@_if_type_fp:NTwFw
-      #1 { \@@_if_type_fp:NTwFw #3 \use_i:nn \s_@@ \use_ii:nn \q_stop }
-      \s_@@ \use_ii:nn \q_stop
+      #1 { \@@_if_type_fp:NTwFw #3 \use_i:nn \s_@@ \use_ii:nn \s_@@_stop }
+      \s_@@ \use_ii:nn \s_@@_stop
     \@@_compare_back:ww
     {
       \cs:w
@@ -416,9 +416,9 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_step:wwwN #1#2; #3#4; #5#6; #7
   {
-    \@@_if_type_fp:NTwFw #1 { } \s_@@ \prg_break: \q_stop
-    \@@_if_type_fp:NTwFw #3 { } \s_@@ \prg_break: \q_stop
-    \@@_if_type_fp:NTwFw #5 { } \s_@@ \prg_break: \q_stop
+    \@@_if_type_fp:NTwFw #1 { } \s_@@ \prg_break: \s_@@_stop
+    \@@_if_type_fp:NTwFw #3 { } \s_@@ \prg_break: \s_@@_stop
+    \@@_if_type_fp:NTwFw #5 { } \s_@@ \prg_break: \s_@@_stop
     \use_i:nnnn { \@@_step_fp:wwwN #1#2; #3#4; #5#6; #7 }
     \prg_break_point:
     \use:n
@@ -683,8 +683,8 @@
     \if_meaning:w \@@_parse_infix_::N #5
       \if_charcode:w 0
             \@@_if_type_fp:NTwFw
-              #2 { \use_i:nn \use_i_delimit_by_q_stop:nw #3 \q_stop }
-              \s_@@ 1 \q_stop
+              #2 { \use_i:nn \@@_use_i_delimit_by_s_stop:nw #3 \s_@@_stop }
+              \s_@@ 1 \s_@@_stop
         \exp_after:wN \exp_after:wN \exp_after:wN \@@_ternary_auxii:NwwN
       \else:
         \exp_after:wN \exp_after:wN \exp_after:wN \@@_ternary_auxi:NwwN
diff --git a/l3kernel/l3fp-parse.dtx b/l3kernel/l3fp-parse.dtx
index 6d2ca4cd2..a52315600 100644
--- a/l3kernel/l3fp-parse.dtx
+++ b/l3kernel/l3fp-parse.dtx
@@ -877,11 +877,11 @@
       ; \exp_not:N \@@_parse_one_register_dim:ww
       \tl_to_str:n { pt } ; \exp_not:N \@@_parse_one_register_mu:www
       . \tl_to_str:n { pt } ; \exp_not:N \@@_parse_one_register_int:www
-      \exp_not:N \q_stop
+      \exp_not:N \s_@@_stop
   }
 \exp_args:Nno \use:nn
   { \cs_new:Npn \@@_parse_one_register_auxii:wwwNw #1 . #2 }
-    { \tl_to_str:n { pt } #3 ; #4#5 \q_stop }
+    { \tl_to_str:n { pt } #3 ; #4#5 \s_@@_stop }
     { #4 #1.#2; }
 \exp_args:Nno \use:nn
   { \cs_new:Npn \@@_parse_one_register_mu:www #1 }
@@ -1837,12 +1837,12 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_parse_apply_unary:NNNwN #1#2#3#4@#5
   {
-    \@@_parse_apply_unary_chk:NwNw #4 @ ; . \q_stop
+    \@@_parse_apply_unary_chk:NwNw #4 @ ; . \s_@@_stop
     \@@_parse_apply_unary_type:NNN
     #3 #2 #4 @
     \exp:w \exp_end_continue_f:w #5 #1
   }
-\cs_new:Npn \@@_parse_apply_unary_chk:NwNw #1#2 ; #3#4 \q_stop
+\cs_new:Npn \@@_parse_apply_unary_chk:NwNw #1#2 ; #3#4 \s_@@_stop
   {
     \if_meaning:w @ #3 \else:
       \token_if_eq_meaning:NNTF . #3
@@ -2764,7 +2764,7 @@
 \cs_new:Npn \@@_parse_function_one_two:nnw #1#2#3
   {
     \@@_if_type_fp:NTwFw
-      #3 { } \s_@@ \@@_parse_function_one_two_error_o:w \q_stop
+      #3 { } \s_@@ \@@_parse_function_one_two_error_o:w \s_@@_stop
     \@@_parse_function_one_two_aux:nnw {#1} {#2} #3
   }
 \cs_new:Npn \@@_parse_function_one_two_error_o:w #1#2#3#4 @
@@ -2786,7 +2786,7 @@
         \fi:
         \@@_parse_function_one_two_error_o:w
       }
-      \q_stop
+      \s_@@_stop
     \@@_parse_function_one_two_auxii:nnw {#1} {#2} #3; #4
   }
 \cs_new:Npn \@@_parse_function_one_two_auxii:nnw #1#2#3; #4; #5
diff --git a/l3kernel/testfiles/m3quark001.tlg b/l3kernel/testfiles/m3quark001.tlg
index 8e19f6e3f..019b81b9f 100644
--- a/l3kernel/testfiles/m3quark001.tlg
+++ b/l3kernel/testfiles/m3quark001.tlg
@@ -86,8 +86,9 @@ already been used for a scan mark.
 \s__peek_stop \s__prop \s__prop_mark \s__prop_stop \s__msg_mark \s__msg_stop
 \s__iow_mark \s__iow_stop \s__file_stop \s__dim_mark \s__dim_stop
 \s__skip_stop \s__keyval_nil \s__keyval_mark \s__keyval_stop \s__keyval_tail
-\s__keys_stop \s__fp \s__fp_mark \s__fp_stop \s__fp_invalid \s__fp_underflow
-\s__fp_overflow \s__fp_division \s__fp_exact \s__fp_tuple \s__tl \s__foo .
+\s__keys_stop \s__fp \s__fp_expr_mark \s__fp_expr_stop \s__fp_mark \s__fp_stop
+\s__fp_invalid \s__fp_underflow \s__fp_overflow \s__fp_division \s__fp_exact
+\s__fp_tuple \s__tl \s__foo .
 ============================================================
 ============================================================
 TEST 14: Use none until s__stop (expect nothing)





More information about the latex3-commits mailing list.