[latex3-commits] [git/LaTeX3-latex3-latex3] master: Move use of \etex_unexpanded:D to \__kernel_exp_not:w (75596e3)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Apr 12 09:19:15 CEST 2018


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

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

commit 75596e3cea775474deacef9b30f160a18ee406f6
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Apr 12 08:13:20 2018 +0100

    Move use of \etex_unexpanded:D to \__kernel_exp_not:w
    
    First step in reducing use of :D functions more generally.


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

75596e3cea775474deacef9b30f160a18ee406f6
 l3kernel/l3candidates.dtx               |    4 ++--
 l3kernel/l3expan.dtx                    |   18 +++++++++++++-----
 l3kernel/l3int.dtx                      |    2 +-
 l3kernel/l3kernel-functions.dtx         |   10 ++++++++++
 l3kernel/l3tl.dtx                       |    6 +++---
 l3kernel/l3token.dtx                    |    2 +-
 l3kernel/testfiles/m3expl001.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl001.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl001.tlg        |    1 +
 l3kernel/testfiles/m3expl001.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl003.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl003.tlg        |    1 +
 l3kernel/testfiles/m3expl003.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |    1 +
 16 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 1bec2ae..ed78752 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -2618,7 +2618,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \tl_reverse_tokens:n #1
   {
-    \etex_unexpanded:D \exp_after:wN
+    \__kernel_exp_not:w \exp_after:wN
       {
         \exp:w
         \@@_act:NNNnn
@@ -2974,7 +2974,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_change_case:nnn #1#2#3
   {
-    \etex_unexpanded:D \exp_after:wN
+    \__kernel_exp_not:w \exp_after:wN
       {
         \exp:w
         \@@_change_case_aux:nnn {#1} {#2} {#3}
diff --git a/l3kernel/l3expan.dtx b/l3kernel/l3expan.dtx
index c2e8378..6895e17 100644
--- a/l3kernel/l3expan.dtx
+++ b/l3kernel/l3expan.dtx
@@ -1450,26 +1450,34 @@
 %
 % \subsection{Preventing expansion}
 %
+% \begin{macro}{\__kernel_exp_not:w}
+%   At the kernel level, we need the primitive behaviour to allow expansion
+%   \emph{before} the brace group.
+%    \begin{macrocode}
+\cs_new_eq:NN \__kernel_exp_not:w \etex_unexpanded:D
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}[EXP]{\exp_not:c}
 % \begin{macro}[EXP]{\exp_not:o}
 % \begin{macro}[EXP]{\exp_not:f}
 % \begin{macro}[EXP]{\exp_not:V}
 % \begin{macro}[EXP]{\exp_not:v}
-%   All these except \cs{exp_not:c} call the primitive
-%   \cs{etex_unexpanded:D} namely \cs{exp_not:n}.
+%   All these except \cs{exp_not:c} call the kernel-internal
+%   \cs{__kernel_exp_not:w} namely \tn{etex_unexpnaded:D}.
 %    \begin{macrocode}
 \cs_new:Npn \exp_not:c #1 { \exp_after:wN \exp_not:N \cs:w #1 \cs_end: }
-\cs_new:Npn \exp_not:o #1 { \etex_unexpanded:D \exp_after:wN {#1} }
+\cs_new:Npn \exp_not:o #1 { \__kernel_exp_not:w \exp_after:wN {#1} }
 \cs_new:Npn \exp_not:f #1
   { \etex_unexpanded:D \exp_after:wN { \exp:w \exp_end_continue_f:w #1 } }
 \cs_new:Npn \exp_not:V #1
   {
-    \etex_unexpanded:D \exp_after:wN
+    \__kernel_exp_not:w \exp_after:wN
       { \exp:w \@@_eval_register:N #1 }
   }
 \cs_new:Npn \exp_not:v #1
   {
-    \etex_unexpanded:D \exp_after:wN
+    \__kernel_exp_not:w \exp_after:wN
       { \exp:w \@@_eval_register:c {#1} }
   }
 %    \end{macrocode}
diff --git a/l3kernel/l3int.dtx b/l3kernel/l3int.dtx
index 481d297..90585da 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -1527,7 +1527,7 @@
   }
 \cs_new:Npn \@@_compare:NNw #1#2#3 \q_mark
   {
-    \etex_unexpanded:D
+    \__kernel_exp_not:w
     \use:c
       {
         @@_compare_ \token_to_str:N #1
diff --git a/l3kernel/l3kernel-functions.dtx b/l3kernel/l3kernel-functions.dtx
index 850e427..8850cba 100644
--- a/l3kernel/l3kernel-functions.dtx
+++ b/l3kernel/l3kernel-functions.dtx
@@ -169,6 +169,16 @@
 %   This function is only created if debugging is enabled.
 % \end{function}
 %
+% \begin{function}[EXP]{\__kernel_exp_not:w}
+%   \begin{syntax}
+%     \cs{__kernel_exp_not:w} \meta{expandable tokens} \Arg{content}
+%   \end{syntax}
+%   Carries out expansion on the \meta{expandable tokens} before preventing
+%   further expansion of the \meta{content} as for \cs{exp_not:n}. Typically,
+%   the \meta{expandable tokens} will alter the nature of the \meta{content},
+%   \emph{i.e.}~allow it to be generated in some way.
+% \end{function}
+%
 % \begin{function}{\__kernel_file_missing:n}
 %   \begin{syntax}
 %     \cs{__kernel_file_missing:n} \Arg{name}
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 160bca0..5c8c72c 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -2585,7 +2585,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \tl_reverse:n #1
   {
-    \etex_unexpanded:D \exp_after:wN
+    \__kernel_exp_not:w \exp_after:wN
       {
         \exp:w
         \@@_act:NNNnn
@@ -2642,7 +2642,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \tl_head:n #1
   {
-    \etex_unexpanded:D
+    \__kernel_exp_not:w
       \if_false: { \fi: \@@_head_auxi:nw #1 { } \q_stop }
   }
 \cs_new:Npn \@@_head_auxi:nw #1#2 \q_stop
@@ -2682,7 +2682,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \tl_tail:n #1
   {
-    \etex_unexpanded:D
+    \__kernel_exp_not:w
       \tl_if_blank:nTF {#1}
         { { } }
         { \exp_after:wN { \use_none:n #1 } }
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index c91363b..a134479 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -1486,7 +1486,7 @@
       \tl_put_right:Nn \l_@@_tmp_tl
         {
           \or:
-            \etex_unexpanded:D \exp_after:wN
+            \__kernel_exp_not:w \exp_after:wN
               { \exp_after:wN ^^@ \exp_after:wN }
         }
       \tl_put_right:Nn \l_@@_tmp_tl { \or: }
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index a9ae83b..30d557c 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -236,6 +236,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index b567585..966aedd 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index ea44392..4bcad71 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index e1c5a1a..3bc0d73 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 73ccade..ce74212 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index a9ae83b..30d557c 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -236,6 +236,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index b567585..966aedd 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index ea44392..4bcad71 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index e1c5a1a..3bc0d73 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 73ccade..ce74212 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -235,6 +235,7 @@ Defining \exp_last_unbraced:NNNNo on line ...
 Defining \exp_last_unbraced:Nx on line ...
 Defining \exp_last_two_unbraced:Noo on line ...
 Defining \__exp_last_two_unbraced:noN on line ...
+Defining \__kernel_exp_not:w on line ...
 Defining \exp_not:c on line ...
 Defining \exp_not:o on line ...
 Defining \exp_not:f on line ...





More information about the latex3-commits mailing list