[latex3-commits] [git/LaTeX3-latex3-latex3] color-export: Move \color_parse:nN to internal (71578cd12)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jun 15 11:29:24 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : color-export
Link       : https://github.com/latex3/latex3/commit/71578cd12299496b212df3e21a8dec99216409c1

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

commit 71578cd12299496b212df3e21a8dec99216409c1
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jun 15 10:29:24 2020 +0100

    Move \color_parse:nN to internal
    
    The new export function covers this *idea* better.
    
    The entire parse function will need re-thinking for
    #739, which will therefore depend on this change.


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

71578cd12299496b212df3e21a8dec99216409c1
 l3experimental/l3color/l3color.dtx | 35 ++++++++---------------------------
 1 file changed, 8 insertions(+), 27 deletions(-)

diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index 2af27e0a4..be9a22a42 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -237,25 +237,6 @@
 %   and similar are not influenced by this setting.
 % \end{variable}
 %
-% \section{Internal color representation}
-%
-% To allow data to be handled internally, \pkg{l3color} uses a simple
-% representation of color, comprising two \meta{balanced text} entries, the first
-% the \meta{model} and the second the \meta{values} given
-% \emph{separated by spaces}.
-%
-% This internal representation is produced when parsing color expressions.
-% 
-% \begin{function}{\color_parse:nN}
-%   \begin{syntax}
-%     \cs{color_parse:nN} \Arg{color expression} \Arg{tl}
-%   \end{syntax}
-%   Parses the \meta{color expression} as described above, and sets the
-%   \meta{tl} to the equivalent \meta{core color representation}
-%   (used at the backend level and based on \texttt{dvips} color
-%   representation).
-% \end{function}
-%
 % \section{Exporting color specifications}
 %
 % The major use of color expressions is in setting typesetting output, but there
@@ -282,7 +263,7 @@
 %   \begin{syntax}
 %     \cs{color_export:nnN} \Arg{color expression} \Arg{format} \Arg{tl}
 %   \end{syntax}
-%   Parses the \meta{color expression} as described for \cs{color_parse:nN},
+%   Parses the \meta{color expression} as described earlier,
 %   then converts to the \meta{format} specified and assigns the data to the
 %   \meta{tl}.
 % \end{function}
@@ -482,8 +463,8 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}{\color_parse:nN}
 % \begin{macro}{\@@_parse:nN}
+% \begin{macro}{\@@_parse_aux:nN}
 % \begin{macro}{\@@_parse:Nw}
 % \begin{macro}{\@@_parse_loop_init:Nnn}
 % \begin{macro}{\@@_parse_loop:w}
@@ -502,20 +483,20 @@
 %   otherwise expands, then starts working through the expression itself.
 %   At the end, we apply the payload.
 %    \begin{macrocode}
-\cs_new_protected:Npn \color_parse:nN #1#2
+\cs_new_protected:Npn \@@_parse:nN #1#2
   {
 %<*package>
     \@@_backend_pickup:N \l_@@_current_tl
     \tl_set_eq:cN { l_@@_named_ . _tl } \l_@@_current_tl
 %</package>
-    \exp_args:Ne \@@_parse:nN { \tl_to_str:n {#1} } #2
+    \exp_args:Ne \@@_parse_aux:nN { \tl_to_str:n {#1} } #2
   }
 %    \end{macrocode}
 %   Before going to all of the effort of parsing an expression, these two
 %   precursor functions look for a pre-defined name, either on its own or
 %   with a trailing |!| (which is the same thing).
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_parse:nN #1#2
+\cs_new_protected:Npn \@@_parse_aux:nN #1#2
   {
     \tl_if_exist:cTF { l_@@_named_ #1 _tl }
       { \tl_set_eq:Nc #2 { l_@@_named_ #1 _tl } }
@@ -869,7 +850,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \color_select:n #1
   {
-    \color_parse:nN {#1} \l_@@_current_tl
+    \@@_parse:nN {#1} \l_@@_current_tl
     \@@_select:
   }
 \cs_new_protected:Npn \color_select:nn #1#2
@@ -932,7 +913,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \color_set:nn #1#2
   {
-    \color_parse:nN {#2} \l_@@_named_tl
+    \@@_parse:nN {#2} \l_@@_named_tl
     \@@_store:Nn \l_@@_named_tl {#1}
   }
 \cs_new_protected:Npn \color_set:nnn #1#2#3
@@ -991,7 +972,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \color_export:nnN #1#2#3
   {
-    \color_parse:nN {#1} #3
+    \@@_parse:nN {#1} #3
     \@@_export:nN {#2} #3
   }
 \cs_new_protected:Npn \color_export:nnnN #1#2#3#4





More information about the latex3-commits mailing list.