[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Replace quarks by scan marks in l3tl (2cabc0e64)

PhelypeOleinik tex.phelype at gmail.com
Thu Mar 19 21:09:43 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : scan-quark
Link       : https://github.com/latex3/latex3/commit/2cabc0e64177abb2c691c9adfd70abcf28d91fc3

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

commit 2cabc0e64177abb2c691c9adfd70abcf28d91fc3
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Thu Mar 19 17:09:43 2020 -0300

    Replace quarks by scan marks in l3tl


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

2cabc0e64177abb2c691c9adfd70abcf28d91fc3
 l3kernel/l3tl.dtx                 | 200 +++++++++++++++++++++++---------------
 l3kernel/testfiles/m3quark001.tlg |  10 +-
 2 files changed, 125 insertions(+), 85 deletions(-)

diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 3fba28f01..619ca6f8d 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -1505,6 +1505,35 @@
 % \end{macro}
 % \end{macro}
 %
+% \subsection{Internal quarks and quark-query functions}
+%
+% \begin{variable}{\q_@@_nil,\q_@@_mark,\q_@@_stop}
+%   Internal quarks.
+%    \begin{macrocode}
+\quark_new:N \q_@@_nil
+\quark_new:N \q_@@_mark
+\quark_new:N \q_@@_stop
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+%   Internal recursion quarks.
+%    \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_break:nN,\@@_if_recursion_tail_stop:n}
+%   Functions to query recursion quarks.
+%    \begin{macrocode}
+\__kernel_quark_test_generate:NNNn \@@_if_recursion_tail_break:nN
+  \q_@@_recursion_tail \q_@@_recursion_stop { @@ }
+\__kernel_quark_conditional_generate:NNnn \@@_if_nil:n
+  \q_@@_nil { @@ } { TF }
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsection{Reassigning token list category codes}
 %
 % \begin{variable}{\c_@@_rescan_marker_tl}
@@ -1670,7 +1699,7 @@
 %   token list may contain a comment character, in which case the |'| we
 %   expected is not there.  We fix this as follows: rather than just
 %   |::| we set \tn{everyeof} to |::|\Arg{code1} |'::|\Arg{code2}
-%   \cs{q_stop}.  The auxiliary \cs{@@_set_rescan_single:NNww} runs the
+%   \cs{s_@@_stop}.  The auxiliary \cs{@@_set_rescan_single:NNww} runs the
 %   \texttt{o}-expanding assignment, expanding either \meta{code1} or
 %   \meta{code2} before its the main argument~|#3|.  In the typical case
 %   without comment character, \meta{code1} is expanded, removing the
@@ -1717,9 +1746,9 @@
       {
         #1 \use_none:n
         #2 #1 { \exp:w \@@_set_rescan_single_aux:w }
-        \q_stop
+        \s_@@_stop
       }
-    \cs_set:Npn \@@_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \q_stop
+    \cs_set:Npn \@@_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \s_@@_stop
       {
         \group_end:
         ##1 ##2 { ##4 ##3 }
@@ -1756,13 +1785,13 @@
 %   the \meta{tl~var} by \meta{token list}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \tl_replace_once:Nnn
-  { \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_set:Nx  }
+  { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_wrap:w \tl_set:Nx  }
 \cs_new_protected:Npn \tl_greplace_once:Nnn
-  { \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_gset:Nx }
+  { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_wrap:w \tl_gset:Nx }
 \cs_new_protected:Npn \tl_replace_all:Nnn
-  { \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_set:Nx  }
+  { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_next:w \tl_set:Nx  }
 \cs_new_protected:Npn \tl_greplace_all:Nnn
-  { \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_gset:Nx }
+  { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_next:w \tl_gset:Nx }
 \cs_generate_variant:Nn \tl_replace_once:Nnn  { c }
 \cs_generate_variant:Nn \tl_greplace_once:Nnn { c }
 \cs_generate_variant:Nn \tl_replace_all:Nnn   { c }
@@ -1816,9 +1845,9 @@
 %   at most $O(n^{3/2})$.  Bear in mind that these upper bounds are
 %   reached only in very contrived scenarios: we include the case
 %   \enquote{\meta{A}} in the list of delimiters to try, so that the
-%   \meta{delimiter} is simply \cs{q_mark} in the most common
+%   \meta{delimiter} is simply \cs{q_@@_mark} in the most common
 %   situation where neither the \meta{token list} nor the \meta{pattern}
-%   contains \cs{q_mark}.
+%   contains \cs{q_@@_mark}.
 %
 %   Let us now ahead, optimizing for this most common case.  First, two
 %   special cases: an empty \meta{pattern}~|#6| is an error, and if
@@ -1826,14 +1855,14 @@
 %   \meta{pattern}~|#6| then we can use it as the \meta{delimiter}
 %   through \cs{@@_replace_auxii:nNNNnn} |{#1}|.  Otherwise, we end up
 %   calling \cs{@@_replace:NnNNNnn} repeatedly with the first two
-%   arguments \cs{q_mark} |{?}|, |\?| |{??}|, |\??| |{???}|, and so on,
+%   arguments \cs{q_@@_mark} |{?}|, |\?| |{??}|, |\??| |{???}|, and so on,
 %   until |#6|~does not contain the control sequence~|#1|, which we take
 %   as our~\meta{A}.  The argument~|#2| only serves to collect~|?|
 %   characters for~|#1|.  Note that the order of the tests means that
 %   the first two are done every time, which is wasteful (for instance,
 %   we repeatedly test for the emptyness of~|#6|).  However, this is
 %   rare enough not to matter.  Finally, choose~\meta{B} to be
-%   \cs{q_nil} or~\cs{q_stop} such that it is not equal to~|#6|.
+%   \cs{q_@@_nil} or~\cs{q_@@_stop} such that it is not equal to~|#6|.
 %
 %   The \cs{@@_replace_auxi:NnnNNNnn} auxiliary receives \Arg{A} and
 %   |{|\meta{A}$^n$\meta{B}|}| as its arguments, initially with $n=1$.
@@ -1855,9 +1884,9 @@
             \tl_if_in:nnTF {#6} {#1}
               { \exp_args:Nc \@@_replace:NnNNNnn {#2} {#2?} }
               {
-                \quark_if_nil:nTF {#6}
-                  { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_stop } }
-                  { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_nil  } }
+                \@@_if_nil:nTF {#6}
+                  { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_@@_stop } }
+                  { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_@@_nil  } }
               }
           }
           { \@@_replace_auxii:nNNNnn {#1} }
@@ -1988,7 +2017,7 @@
 %   \meta{token list} |?| is empty after one expansion.  The auxiliary
 %   \cs{@@_if_empty_if:o} is a fast emptyness test, converting its
 %   argument to a string (after one expansion) and using the test
-%   \cs{if_meaning:w} \cs{q_nil} |...| \cs{q_nil}.
+%   \cs{if_meaning:w} \cs{q_@@_nil} |...| \cs{q_@@_nil}.
 %    \begin{macrocode}
 \prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF }
   {
@@ -2023,22 +2052,22 @@
 %
 % \begin{macro}[pTF]{\tl_if_empty:n, \tl_if_empty:V}
 %   Convert the argument to a string: this is empty if and only if
-%   the argument is.  Then |\if_meaning:w \q_nil ... \q_nil| is
+%   the argument is.  Then |\if_meaning:w \q_@@_nil ... \q_@@_nil| is
 %   \texttt{true} if and only if the string |...| is empty.
-%   It could be tempting to use |\if_meaning:w \q_nil #1 \q_nil| directly.
+%   It could be tempting to use |\if_meaning:w \q_@@_nil #1 \q_@@_nil| directly.
 %   This fails on a token
-%   list starting with \cs{q_nil} of course but more troubling is the
+%   list starting with \cs{q_@@_nil} of course but more troubling is the
 %   case where argument is a complete conditional such as \cs{if_true:}
 %   a \cs{else:} b \cs{fi:} because then \cs{if_true:} is used by
 %   \cs{if_meaning:w}, the test turns out \texttt{false}, the \cs{else:}
 %   executes the \texttt{false} branch, the \cs{fi:} ends it and the
-%   \cs{q_nil} at the end
+%   \cs{q_@@_nil} at the end
 %   starts executing\dots{}
 %    \begin{macrocode}
 \prg_new_conditional:Npnn \tl_if_empty:n #1 { p , TF , T , F }
   {
-    \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
-        \tl_to_str:n {#1} \q_nil
+    \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil
+        \tl_to_str:n {#1} \q_@@_nil
       \prg_return_true:
     \else:
       \prg_return_false:
@@ -2064,8 +2093,8 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_if_empty_if:o #1
   {
-    \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
-      \__kernel_tl_to_str:w \exp_after:wN {#1} \q_nil
+    \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil
+      \__kernel_tl_to_str:w \exp_after:wN {#1} \q_@@_nil
   }
 \prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F }
   {
@@ -2221,13 +2250,13 @@
   {
     \if_catcode:w ^ \exp_after:wN \@@_if_single:nnw
         \__kernel_tl_to_str:w
-          \exp_after:wN { \use_none:nn #1 ?? } ^ ? \q_stop
+          \exp_after:wN { \use_none:nn #1 ?? } ^ ? \s_@@_stop
       \prg_return_true:
     \else:
       \prg_return_false:
     \fi:
   }
-\cs_new:Npn \@@_if_single:nnw #1#2#3 \q_stop {#2}
+\cs_new:Npn \@@_if_single:nnw #1#2#3 \s_@@_stop {#2}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -2291,7 +2320,7 @@
     \@@_case:NnTF #1 {#2}
   }
 \cs_new:Npn \@@_case:NnTF #1#2#3#4
-  { \@@_case:Nw #1 #2 #1 { } \q_mark {#3} \q_mark {#4} \q_stop }
+  { \@@_case:Nw #1 #2 #1 { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop }
 \cs_new:Npn \@@_case:Nw #1#2#3
   {
     \tl_if_eq:NNTF #1 #2
@@ -2306,14 +2335,14 @@
 %   one of the cases searched for, then |#1| is the code to insert,
 %   |#2| is the \emph{next} case to check on and |#3| is all of
 %   the rest of the cases code. That means that |#4| is the \texttt{true}
-%   branch code, and |#5| tidies up the spare \cs{q_mark} and the
+%   branch code, and |#5| tidies up the spare \cs{s_@@_mark} and the
 %   \texttt{false} branch. On the other hand, if none of the cases matched
 %   then we arrive here using the \enquote{termination} case of comparing
 %   the search with itself. That means that |#1| is empty, |#2| is
-%   the first \cs{q_mark} and so |#4| is the \texttt{false} code (the
+%   the first \cs{s_@@_mark} and so |#4| is the \texttt{false} code (the
 %   \texttt{true} code is mopped up by |#3|).
 %    \begin{macrocode}
-\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
+\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop
   { \exp_end: #1 #4 }
 %    \end{macrocode}
 % \end{macro}
@@ -2333,14 +2362,14 @@
 \cs_new:Npn \tl_map_function:nN #1#2
   {
     \@@_map_function:Nn #2 #1
-      \q_recursion_tail
+      \q_@@_recursion_tail
     \prg_break_point:Nn \tl_map_break: { }
   }
 \cs_new:Npn \tl_map_function:NN
   { \exp_args:No \tl_map_function:nN }
 \cs_new:Npn \@@_map_function:Nn #1#2
   {
-    \quark_if_recursion_tail_break:nN {#2} \tl_map_break:
+    \@@_if_recursion_tail_break:nN {#2} \tl_map_break:
     #1 {#2} \@@_map_function:Nn #1
   }
 \cs_generate_variant:Nn \tl_map_function:NN { c }
@@ -2363,7 +2392,7 @@
       { @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1 {#2}
     \exp_args:Nc \@@_map_function:Nn
       { @@_map_ \int_use:N \g__kernel_prg_map_int :w }
-      #1 \q_recursion_tail
+      #1 \q_@@_recursion_tail
     \prg_break_point:Nn \tl_map_break:
       { \int_gdecr:N \g__kernel_prg_map_int }
   }
@@ -2382,7 +2411,7 @@
 \cs_new:Npn \tl_map_tokens:nn #1#2
   {
     \@@_map_tokens:nn {#2} #1
-      \q_recursion_tail
+      \q_@@_recursion_tail
     \prg_break_point:Nn \tl_map_break: { }
   }
 \cs_new:Npn \tl_map_tokens:Nn
@@ -2390,7 +2419,7 @@
 \cs_generate_variant:Nn \tl_map_tokens:Nn { c }
 \cs_new:Npn \@@_map_tokens:nn #1#2
   {
-    \quark_if_recursion_tail_break:nN {#2} \tl_map_break:
+    \@@_if_recursion_tail_break:nN {#2} \tl_map_break:
     \use:n {#1} {#2}
     \@@_map_tokens:nn {#1}
   }
@@ -2410,14 +2439,14 @@
 \cs_new_protected:Npn \tl_map_variable:nNn #1#2#3
   {
     \@@_map_variable:Nnn #2 {#3} #1
-      \q_recursion_tail
+      \q_@@_recursion_tail
     \prg_break_point:Nn \tl_map_break: { }
   }
 \cs_new_protected:Npn \tl_map_variable:NNn
   { \exp_args:No \tl_map_variable:nNn }
 \cs_new_protected:Npn \@@_map_variable:Nnn #1#2#3
   {
-    \quark_if_recursion_tail_break:nN {#3} \tl_map_break:
+    \@@_if_recursion_tail_break:nN {#3} \tl_map_break:
     \tl_set:Nn #1 {#3}
     \use:n {#2}
     \@@_map_variable:Nnn #1 {#2}
@@ -2538,23 +2567,23 @@
 % \begin{macro}{\@@_reverse_items:nwNwn}
 % \begin{macro}{\@@_reverse_items:wn}
 %    Reversal of a token list is done by taking one item at a time
-%    and putting it after \cs{q_stop}.
+%    and putting it after \cs{s_@@_stop}.
 %    \begin{macrocode}
 \cs_new:Npn \tl_reverse_items:n #1
   {
     \@@_reverse_items:nwNwn #1 ?
-      \q_mark \@@_reverse_items:nwNwn
-      \q_mark \@@_reverse_items:wn
-      \q_stop { }
+      \s_@@_mark \@@_reverse_items:nwNwn
+      \s_@@_mark \@@_reverse_items:wn
+      \s_@@_stop { }
   }
-\cs_new:Npn \@@_reverse_items:nwNwn #1 #2 \q_mark #3 #4 \q_stop #5
+\cs_new:Npn \@@_reverse_items:nwNwn #1 #2 \s_@@_mark #3 #4 \s_@@_stop #5
   {
     #3 #2
-      \q_mark \@@_reverse_items:nwNwn
-      \q_mark \@@_reverse_items:wn
-      \q_stop { {#1} #5 }
+      \s_@@_mark \@@_reverse_items:nwNwn
+      \s_@@_mark \@@_reverse_items:wn
+      \s_@@_stop { {#1} #5 }
   }
-\cs_new:Npn \@@_reverse_items:wn #1 \q_stop #2
+\cs_new:Npn \@@_reverse_items:wn #1 \s_@@_stop #2
   { \exp_not:o { \use_none:nn #2 } }
 %    \end{macrocode}
 % \end{macro}
@@ -2570,17 +2599,17 @@
 %   }
 %   Trimming spaces from around the input is deferred to an internal
 %   function whose first argument is the token list to trim, augmented
-%   by an initial \cs{q_mark}, and whose second argument is a
+%   by an initial \cs{s_@@_mark}, and whose second argument is a
 %   \meta{continuation}, which receives as a braced argument
-%   \cs{use_none:n} \cs{q_mark} \meta{trimmed token list}.  In the case
+%   \cs{use_none:n} \cs{s_@@_mark} \meta{trimmed token list}.  In the case
 %   at hand, we take \cs{exp_not:o} as our continuation, so that space
 %   trimming behaves correctly within an \texttt{x}-type expansion.
 %    \begin{macrocode}
 \cs_new:Npn \tl_trim_spaces:n #1
-  { \@@_trim_spaces:nn { \q_mark #1 } \exp_not:o }
+  { \@@_trim_spaces:nn { \s_@@_mark #1 } \exp_not:o }
 \cs_generate_variant:Nn \tl_trim_spaces:n { o }
 \cs_new:Npn \tl_trim_spaces_apply:nN #1#2
-  { \@@_trim_spaces:nn { \q_mark #1 } { \exp_args:No #2 } }
+  { \@@_trim_spaces:nn { \s_@@_mark #1 } { \exp_args:No #2 } }
 \cs_generate_variant:Nn \tl_trim_spaces_apply:nN { o }
 \cs_new_protected:Npn \tl_trim_spaces:N #1
   { \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
@@ -2603,14 +2632,14 @@
 %   definitions, we nest those in \cs{@@_tmp:w}, which then receives
 %   a single space as its argument: |#1| is \verb*+ +.
 %   Removing leading spaces is done with \cs{@@_trim_spaces_auxi:w},
-%   which loops until \cs{q_mark}\verb*+ + matches the end of the token
+%   which loops until \cs{s_@@_mark}\verb*+ + matches the end of the token
 %   list: then |##1| is the token list and |##3| is
 %   \cs{@@_trim_spaces_auxii:w}. This hands the relevant tokens to the
 %   loop \cs{@@_trim_spaces_auxiii:w}, responsible for trimming
-%   trailing spaces. The end is reached when \verb*+ + \cs{q_nil}
+%   trailing spaces. The end is reached when \verb*+ + \cs{s_@@_nil}
 %   matches the one present in the definition of \cs{tl_trim_spacs:n}.
 %   Then \cs{@@_trim_spaces_auxiv:w} puts the token list into a group,
-%   with \cs{use_none:n} placed there to gobble a lingering \cs{q_mark},
+%   with \cs{use_none:n} placed there to gobble a lingering \cs{s_@@_mark},
 %   and feeds this to the \meta{continuation}.
 %    \begin{macrocode}
 \cs_set:Npn \@@_tmp:w #1
@@ -2619,35 +2648,35 @@
       {
         \@@_trim_spaces_auxi:w
           ##1
-          \q_nil
-          \q_mark #1 { }
-          \q_mark \@@_trim_spaces_auxii:w
+          \s_@@_nil
+          \s_@@_mark #1 { }
+          \s_@@_mark \@@_trim_spaces_auxii:w
           \@@_trim_spaces_auxiii:w
-          #1 \q_nil
+          #1 \s_@@_nil
           \@@_trim_spaces_auxiv:w
-        \q_stop
+        \s_@@_stop
       }
-    \cs_new:Npn \@@_trim_spaces_auxi:w ##1 \q_mark #1 ##2 \q_mark ##3
+    \cs_new:Npn \@@_trim_spaces_auxi:w ##1 \s_@@_mark #1 ##2 \s_@@_mark ##3
       {
         ##3
         \@@_trim_spaces_auxi:w
-        \q_mark
+        \s_@@_mark
         ##2
-        \q_mark #1 {##1}
+        \s_@@_mark #1 {##1}
       }
     \cs_new:Npn \@@_trim_spaces_auxii:w
-        \@@_trim_spaces_auxi:w \q_mark \q_mark ##1
+        \@@_trim_spaces_auxi:w \s_@@_mark \s_@@_mark ##1
       {
         \@@_trim_spaces_auxiii:w
         ##1
       }
-    \cs_new:Npn \@@_trim_spaces_auxiii:w ##1 #1 \q_nil ##2
+    \cs_new:Npn \@@_trim_spaces_auxiii:w ##1 #1 \s_@@_nil ##2
       {
         ##2
-        ##1 \q_nil
+        ##1 \s_@@_nil
         \@@_trim_spaces_auxiii:w
       }
-    \cs_new:Npn \@@_trim_spaces_auxiv:w ##1 \q_nil ##2 \q_stop ##3
+    \cs_new:Npn \@@_trim_spaces_auxiv:w ##1 \s_@@_nil ##2 \s_@@_stop ##3
       { ##3 { \use_none:n ##1 } }
   }
 \@@_tmp:w { ~ }
@@ -2669,10 +2698,9 @@
 %   in the token list.
 %   Only \cs{q_@@_act_mark} and \cs{q_@@_act_stop} may not appear
 %   in the token lists manipulated by \cs{@@_act:NNNnn} functions.
-%   No quark module yet, so do things by hand.
 %    \begin{macrocode}
-\cs_new_nopar:Npn \q_@@_act_mark { \q_@@_act_mark }
-\cs_new_nopar:Npn \q_@@_act_stop { \q_@@_act_stop }
+\quark_new:N \q_@@_act_mark
+\quark_new:N \q_@@_act_stop
 %    \end{macrocode}
 % \end{variable}
 %
@@ -2819,7 +2847,7 @@
 %
 % \begin{macro}{\tl_head:N, \tl_head:n, \tl_head:V, \tl_head:v, \tl_head:f}
 % \begin{macro}{\@@_head_auxi:nw, \@@_head_auxii:n}
-% \begin{macro}{\tl_head:w}
+% \begin{macro}{\tl_head:w,\@@_tl_head:w}
 % \begin{macro}{\tl_tail:N, \tl_tail:n, \tl_tail:V, \tl_tail:v, \tl_tail:f}
 %   Finding the head of a token list expandably always strips braces, which
 %   is fine as this is consistent with for example mapping to a list. The
@@ -2836,17 +2864,17 @@
 \cs_new:Npn \tl_head:n #1
   {
     \__kernel_exp_not:w
-      \if_false: { \fi: \@@_head_auxi:nw #1 { } \q_stop }
+      \if_false: { \fi: \@@_head_auxi:nw #1 { } \s_@@_stop }
   }
-\cs_new:Npn \@@_head_auxi:nw #1#2 \q_stop
+\cs_new:Npn \@@_head_auxi:nw #1#2 \s_@@_stop
   {
     \exp_after:wN \@@_head_auxii:n \exp_after:wN {
       \if_false: } \fi: {#1}
   }
 \cs_new:Npn \@@_head_auxii:n #1
   {
-    \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
-      \__kernel_tl_to_str:w \exp_after:wN { \use_none:n #1 } \q_nil
+    \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil
+      \__kernel_tl_to_str:w \exp_after:wN { \use_none:n #1 } \q_@@_nil
       \exp_after:wN \use_i:nn
     \else:
       \exp_after:wN \use_ii:nn
@@ -2856,6 +2884,7 @@
   }
 \cs_generate_variant:Nn \tl_head:n { V , v , f }
 \cs_new:Npn \tl_head:w #1#2 \q_stop {#1}
+\cs_new:Npn \@@_tl_head:w #1#2 \s_@@_stop {#1}
 \cs_new:Npn \tl_head:N { \exp_args:No \tl_head:n }
 %    \end{macrocode}
 %   To correctly leave the tail of a token list, it's important \emph{not} to
@@ -2923,7 +2952,7 @@
         \tl_if_head_is_N_type:nTF { #1 ? }
           {
             \exp_after:wN \exp_not:N
-            \tl_head:w #1 { ? \use_none:nn } \q_stop
+            \@@_tl_head:w #1 { ? \use_none:nn } \s_@@_stop
           }
           { \str_head:n {#1} }
       \prg_return_true:
@@ -2950,7 +2979,7 @@
         \tl_if_head_is_N_type:nTF { #1 ? }
           {
             \exp_after:wN \exp_not:N
-            \tl_head:w #1 { ? \use_none:nn } \q_stop
+            \@@_tl_head:w #1 { ? \use_none:nn } \s_@@_stop
           }
           {
             \tl_if_head_is_group:nTF {#1}
@@ -2986,7 +3015,7 @@
 \cs_new:Npn \@@_if_head_eq_meaning_normal:nN #1 #2
   {
     \exp_after:wN \if_meaning:w
-        \tl_head:w #1 { ?? \use_none:nnn } \q_stop #2
+        \@@_tl_head:w #1 { ?? \use_none:nnn } \s_@@_stop #2
       \prg_return_true:
     \else:
       \prg_return_false:
@@ -3109,7 +3138,7 @@
 % \begin{macro}{\@@_item_aux:nn, \@@_item:nn}
 %   The idea here is to find the offset of the item from the left, then use
 %   a loop to grab the correct item. If the resulting offset is too large,
-%   then \cs{quark_if_recursion_tail_stop:n} terminates the loop, and returns
+%   then \cs{@@_if_recursion_tail_break:nN} terminates the loop, and returns
 %   nothing at all.
 %    \begin{macrocode}
 \cs_new:Npn \tl_item:nn #1#2
@@ -3117,7 +3146,7 @@
     \exp_args:Nf \@@_item:nn
       { \exp_args:Nf \@@_item_aux:nn { \int_eval:n {#2} } {#1} }
     #1
-    \q_recursion_tail
+    \q_@@_recursion_tail
     \prg_break_point:
   }
 \cs_new:Npn \@@_item_aux:nn #1#2
@@ -3128,7 +3157,7 @@
   }
 \cs_new:Npn \@@_item:nn #1#2
   {
-    \quark_if_recursion_tail_break:nN {#2} \prg_break:
+    \@@_if_recursion_tail_break:nN {#2} \prg_break:
     \int_compare:nNnTF {#1} = 1
       { \prg_break:n { \exp_not:n {#2} } }
       { \exp_args:Nf \@@_item:nn { \int_eval:n { #1 - 1 } } }
@@ -3331,7 +3360,7 @@
   { \iow_wrap:nnnN { >~ \tl_to_str:n {#1} . } { } { } \@@_show:n }
 \cs_new_protected:Npn \@@_show:n #1
   {
-    \tl_set:Nf \l_@@_internal_a_tl { \@@_show:w #1 \q_stop }
+    \tl_set:Nf \l_@@_internal_a_tl { \@@_show:w #1 \s_@@_stop }
     \__kernel_iow_with:Nnn \tex_newlinechar:D { 10 }
       {
         \__kernel_iow_with:Nnn \tex_errorcontextlines:D { -1 }
@@ -3341,7 +3370,7 @@
           }
       }
   }
-\cs_new:Npn \@@_show:w #1 > #2 . \q_stop {#2}
+\cs_new:Npn \@@_show:w #1 > #2 . \s_@@_stop {#2}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -3355,6 +3384,17 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsection{Internal scan marks}
+%
+% \begin{variable}{\s_@@_nil,\s_@@_mark,\s_@@_stop}
+%   Internal scan marks.
+%    \begin{macrocode}
+\scan_new:N \s_@@_nil
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+%    \end{macrocode}
+% \end{variable}
+%
 % \subsection{Scratch token lists}
 %
 % \begin{variable}{\g_tmpa_tl, \g_tmpb_tl}
diff --git a/l3kernel/testfiles/m3quark001.tlg b/l3kernel/testfiles/m3quark001.tlg
index c8130888f..7c2748d1a 100644
--- a/l3kernel/testfiles/m3quark001.tlg
+++ b/l3kernel/testfiles/m3quark001.tlg
@@ -80,11 +80,11 @@ l. ...}
 This is a coding error.
 LaTeX has been asked to create a new scan mark '\s__foo' but this name has
 already been used for a scan mark.
-> \g__scan_marks_tl=\s_stop \s__seq \s__seq_mark \s__seq_stop \s__int_mark
-\s__int_stop \s__clist_mark \s__clist_stop \s__prop \s__keyval_nil
-\s__keyval_mark \s__keyval_stop \s__keyval_tail \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 .
+> \g__scan_marks_tl=\s_stop \s__tl_nil \s__tl_mark \s__tl_stop \s__seq
+\s__seq_mark \s__seq_stop \s__int_mark \s__int_stop \s__clist_mark
+\s__clist_stop \s__prop \s__keyval_nil \s__keyval_mark \s__keyval_stop
+\s__keyval_tail \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 .
 ============================================================
 ============================================================
 TEST 14: Use none until s__stop (expect nothing)





More information about the latex3-commits mailing list.