[latex3-commits] [git/LaTeX3-latex3-latex2e] mathcolor: make the peek commands private for now (fc014a0f)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Jan 7 18:42:47 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : mathcolor
Link       : https://github.com/latex3/latex2e/commit/fc014a0fb7661d99402f529313492954a08091d6

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

commit fc014a0fb7661d99402f529313492954a08091d6
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Jan 7 18:42:47 2022 +0100

    make the peek commands private for now


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

fc014a0fb7661d99402f529313492954a08091d6
 required/graphics/mathcolor.dtx | 69 ++++++++++++++++++-----------------------
 1 file changed, 31 insertions(+), 38 deletions(-)

diff --git a/required/graphics/mathcolor.dtx b/required/graphics/mathcolor.dtx
index 1029c78b..dd72262a 100644
--- a/required/graphics/mathcolor.dtx
+++ b/required/graphics/mathcolor.dtx
@@ -199,14 +199,14 @@
 %    separate command (which in fact needs to be called several times,
 %    so inlining the code wouldn't be possible.
 %    \begin{macrocode}
-  \_@@_scan_for_scripts:w 
+  \@@_scan_for_scripts:w 
 }
 %    \end{macrocode}
 %  \end{macro}
 %
-  
-
-%  \begin{macro}{\_@@_scan_for_scripts:w}
+%
+%
+%  \begin{macro}{\@@_scan_for_scripts:w}
 %    The complication when changing the color back is due to the fact
 %    that the \cs{mathcolor} may be followed by \verb=^= or \verb=_=
 %    or the hidden superscript \texttt{'} and its argument may end in a
@@ -214,19 +214,19 @@
 %    attached as \cs{limits} instead of after the material. All cases
 %    need separate treatment.
 %    \begin{macrocode}
-\cs_new_protected:Npn \_@@_scan_for_scripts:w {
+\cs_new_protected:Npn \@@_scan_for_scripts:w {
 %    \end{macrocode}
 %    We therefore first parse for a \cs{c_math_subscript_token}
 %    ignoring (dropping) any spaces and \cs{relax} as \TeX{} would
 %    do. We do this with expansion so that hidden sub or superscripts
 %    in macros are still found as long as the macros are expandable.
 %    \begin{macrocode}
-  \peek_catcode_ignore_filler_expand:NTF \c_math_subscript_token
+  \@@_peek_catcode_ignore_filler_expand:NTF \c_math_subscript_token
 %    \end{macrocode}
 %    If we found that character we call a function that handles sub or
 %    superscripts.
 %    \begin{macrocode}
-    { \_@@_handle_scripts:Nw }
+    { \@@_handle_scripts:Nw }
 %    \end{macrocode}
 %    Otherwise check if this token we peeked at (which is now stored
 %    in \cs{l_peek_token} is a superscript token.
@@ -235,7 +235,7 @@
 %    \end{macrocode}
 %    If found we call the sub/superscript handler.
 %    \begin{macrocode}
-      { \_@@_handle_scripts:Nw }
+      { \@@_handle_scripts:Nw }
 %    \end{macrocode}
 %    Otherwise we check if it was any of the limit operation
 %    primitives. If that is the case, e.g., if we have a situation
@@ -258,7 +258,7 @@
 %    \cs{_@@_scan_for_scripts:w} expands while scanning the simplest
 %    solution is to add \cs{use_none:n} in front of the peeked at token.
 %    \begin{macrocode}
-          { \_@@_scan_for_scripts:w \use_none:n }
+          { \@@_scan_for_scripts:w \use_none:n }
 %    \end{macrocode}
 %    If it was one of these we look for a \texttt{'} and if found remove it and
 %    replace it by its expansion. The reason we have to do this (and
@@ -267,7 +267,7 @@
 %    under \cs{expand} or \cs{expandafter}.
 %    \begin{macrocode}
           { \peek_meaning_remove:NTF '
-            { \_@@_handle_scripts:Nw ^\c_group_begin_token \prim at s }
+            { \@@_handle_scripts:Nw ^\c_group_begin_token \prim at s }
 %    \end{macrocode}
 %    If it is anything else we finish off which means we reset the
 %    color (because we prevented that before to happen automatically
@@ -285,7 +285,7 @@
 
 
 
-%  \begin{macro}{\_@@_handle_scripts:Nw}
+%  \begin{macro}{\@@_handle_scripts:Nw}
 %    The tricky part of handling sub and superscripts is that we have
 %    to reset color to the one that is on the stack but reset it back
 %    to what it was before to allow for cases like
@@ -296,7 +296,7 @@
 %    sign, and superscript. So technically the superscript comes first
 %    and the \cs{sum} that should get colored red is the middle.
 %    \begin{macrocode}
-\cs_new_protected:Npn \_@@_handle_scripts:Nw #1 {
+\cs_new_protected:Npn \@@_handle_scripts:Nw #1 {
 %    \end{macrocode}
 %    The argument is either \verb=^= or \verb=_=, so we execute it and
 %    explicitly open two \verb={= groups. We need two because color
@@ -317,13 +317,13 @@
 %    bit more so that the code executed after the current (inner) group
 %    looks like this:
 %\begin{verbatim}
-%      \reset at color } \_@@_scan_for_scripts:w 
+%      \reset at color } \@@_scan_for_scripts:w 
 %\end{verbatim}
 %    The \cs{_@@_scan_for_scripts:w} then retakes control and initiates
 %    parsing for another sub or superscript.
 %    \begin{macrocode}
     \aftergroup \c_group_end_token
-    \aftergroup \_@@_scan_for_scripts:w
+    \aftergroup \@@_scan_for_scripts:w
 %    \end{macrocode}
 %    Before we give control to \TeX{} to process the sub or
 %    superscript some final adjustment is necessary: if the input was
@@ -333,27 +333,23 @@
 %    which means we are missing a closing \verb=}= at the end and need
 %    to account for that: this is done in \cs{_@@_handle_unbraced_script:N}.
 %    \begin{macrocode}
-    \peek_catcode_ignore_filler_expand:NTF \c_group_begin_token
+    \@@_peek_catcode_ignore_filler_expand:NTF \c_group_begin_token
          {
            \peek_catcode_remove:NT \c_group_begin_token { }
          }
-         { \_@@_handle_unbraced_script:N }
+         { \@@_handle_unbraced_script:N }
   }%    \end{macrocode}
 %  \end{macro}
 
 
-%  \begin{macro}{\_@@_handle_unbraced_script:N}
+%  \begin{macro}{\@@_handle_unbraced_script:N}
 %    All we have to do here is to add the final closing brace.
 %    \begin{macrocode}
-\cs_new_protected:Npn \_@@_handle_unbraced_script:N #1 {
+\cs_new_protected:Npn \@@_handle_unbraced_script:N #1 {
   #1 \c_group_end_token }
 %    \end{macrocode}
 %  \end{macro}
 %
-%    \begin{macrocode}
-%<@@=>
-%    \end{macrocode}
-%
 %
 %
 % \subsection{Utility function for the peek module}
@@ -365,49 +361,46 @@
 %    should move to expl3 peek functions (or otherwise the naming
 %    should perhaps be adjusted).
 %
-%    \begin{macrocode}
-%<@@=peek>
-%    \end{macrocode}
 %
 %    \begin{macrocode}
-\tl_new:N \l__peek_tmp_tl
+\tl_new:N \l_@@_peek_tmp_tl
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \peek_catcode_ignore_filler_expand:NTF #1#2#3
+\cs_new_protected:Npn \@@_peek_catcode_ignore_filler_expand:NTF #1#2#3
   {
-    \tl_set:Nn \l__peek_tmp_tl
+    \tl_set:Nn \l_@@_peek_tmp_tl
       { \token_if_eq_catcode:NNTF \l_peek_token #1 {#2} {#3} }
-    \__peek_expand:w
+    \@@_peek_expand:w
   }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \__peek_expand:w
+\cs_new_protected:Npn \@@_peek_expand:w
   {
     \exp_after:wN \peek_catcode_remove:NTF
     \exp_after:wN \c_space_token
-    \exp_after:wN \__peek_test_expand:w
-    \exp_after:wN \__peek_test_relax:w
+    \exp_after:wN \@@_peek_test_expand:w
+    \exp_after:wN \@@_peek_test_relax:w
     \exp:w \exp_end_continue_f:w
   }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \__peek_test_expand:w
+\cs_new_protected:Npn \@@_peek_test_expand:w
   {
     \token_if_expandable:NTF \l_peek_token
-      { \__peek_expand:w }
-      { \l__peek_tmp_tl      }
+      { \@@_peek_expand:w }
+      { \l_@@_peek_tmp_tl      }
   }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\cs_new_protected:Npn \__peek_test_relax:w
+\cs_new_protected:Npn \@@_peek_test_relax:w
    {
     \peek_meaning_remove:NTF \scan_stop:
-      { \__peek_expand:w }
-      { \__peek_test_expand:w   }
+      { \@@_peek_expand:w }
+      { \@@_peek_test_expand:w   }
    }
 %    \end{macrocode}
 %





More information about the latex3-commits mailing list.