[latex3-commits] [git/LaTeX3-latex3-latex3] master: Force color model during parsing (dcfc3ce)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Feb 21 15:38:02 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/dcfc3cefc726a8fe3e3ef15ba70ba49d13f0b473

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

commit dcfc3cefc726a8fe3e3ef15ba70ba49d13f0b473
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Feb 21 14:38:02 2018 +0000

    Force color model during parsing
    
    This way it always applies to anything processed by
    l3color.


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

dcfc3cefc726a8fe3e3ef15ba70ba49d13f0b473
 l3experimental/l3color/l3color.dtx |   38 +++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index f00c047..a9939b7 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -465,6 +465,7 @@
     \tl_if_exist:cTF { l_@@_named_ #1 _tl }
       { \tl_set_eq:Nc #2 { l_@@_named_ #1 _tl } }
       { \@@_parse:Nw #2#1 ! \q_stop }
+    \@@_check_model:N #2
   }
 \cs_new_protected:Npn \@@_parse:Nw #1#2 ! #3 \q_stop
   {
@@ -651,25 +652,15 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}{\@@_select:}
-% \begin{macro}{\@@_finalise:N}
-% \begin{macro}{\@@_finalise:w}
-%   A driver-neutral location for \enquote{last minute} manipulations before
-%   handing off to the driver code.  We set the special |.| syntax here: this
-%   will therefore always be available. The finalisation is separate from the
-%   main function so it can also be applied to \emph{e.g.}~page color.
+% \begin{macro}{\@@_check_model:N}
+% \begin{macro}{\@@_check_model:w}
+%   Check that the model in use is the one required.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_select:
-  {
-    \@@_finalise:N \l_@@_current_tl
-    \tl_set_eq:cN { l_@@_named_ . _tl } \l_@@_current_tl
-    \@@_select:V \l_@@_current_tl
-  }
-\cs_new_protected:Npn \@@_finalise:N #1
+\cs_new_protected:Npn \@@_check_model:N #1
   {
     \tl_if_empty:NF \l_color_fixed_model_tl
       {
-        \exp_after:wN \@@_finalise:w #1 \q_stop
+        \exp_after:wN \@@_check_model:w #1 \q_stop
         \tl_if_eq:NNF \l_@@_model_tl \l_color_fixed_model_tl
           {
             \@@_convert:VVN \l_@@_model_tl \l_color_fixed_model_tl
@@ -679,7 +670,7 @@
           { \l_color_fixed_model_tl \c_space_tl \l_@@_value_tl }
       }
   }
-\cs_new_protected:Npn \@@_finalise:w #1 ~ #2 \q_stop
+\cs_new_protected:Npn \@@_check_model:w #1 ~ #2 \q_stop
   {
     \tl_set:Nn \l_@@_model_tl {#1}
     \tl_set:Nn \l_@@_value_tl {#2}
@@ -688,6 +679,20 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\@@_select:}
+%   A driver-neutral location for \enquote{last minute} manipulations before
+%   handing off to the driver code.  We set the special |.| syntax here: this
+%   will therefore always be available. The finalisation is separate from the
+%   main function so it can also be applied to \emph{e.g.}~page color.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_select:
+  {
+    \tl_set_eq:cN { l_@@_named_ . _tl } \l_@@_current_tl
+    \@@_select:V \l_@@_current_tl
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\color_select:n}
 % \begin{macro}{\color_select:nn}
 %   Parse the input expressions then get the driver to actually activate
@@ -718,6 +723,7 @@
       {
         \tl_set:Nx #3
           { #1 ~ \use:c {  @@_parse_ #1 :w } #2 , 0 , 0 , 0 , 0 \q_stop }
+        \@@_check_model:N #3
       }
       {
         \__kernel_msg_error:nnn { color } { invalid-model } {#1}





More information about the latex3-commits mailing list