[latex3-commits] [git/LaTeX3-latex3-latex3] master: Define \@@_act_loop:w in one go rather than separate pieces of code (2a9272c5b)

Bruno Le Floch blflatex at gmail.com
Tue Oct 27 09:29:32 CET 2020


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

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

commit 2a9272c5bc2d5274592ea8215d808a7f4171fe03
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Tue Oct 27 09:29:32 2020 +0100

    Define \@@_act_loop:w in one go rather than separate pieces of code


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

2a9272c5bc2d5274592ea8215d808a7f4171fe03
 l3kernel/l3tl.dtx | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 34e53547e..57daeed07 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -3197,6 +3197,8 @@
   }
 \@@_tmp:w { ~ }
 %    \end{macrocode}
+%   (We expand the definition \cs{@@_act_if_head_is_space:nTF} when
+%   setting up \cs{@@_act_loop:w}, so we can then undefine the auxiliary.)
 %   In the loop, we check how the token list begins and act
 %   accordingly. In the \enquote{group} case, we may have
 %   reached \cs{s_@@_act_stop}, the end of the list. Then
@@ -3209,23 +3211,18 @@
 %   or with a space. Some extra work is needed to
 %   make \cs{@@_act_space:wwnNNN} gobble the space.
 %    \begin{macrocode}
-\group_begin:
-  \cs_set_nopar:Npx \@@_tmp:
-    {
-      \__kernel_exp_not:w \exp_after:wN { \@@_act_if_head_is_space:nTF {#1} }
-        { \exp_not:N \@@_act_space:wwnNNN }
-        {
-          \__kernel_exp_not:w \exp_after:wN { \tl_if_head_is_group:nTF {#1} }
-            { \exp_not:N \@@_act_group:nwnNNN }
-            { \exp_not:N \@@_act_normal:NwnNNN }
-        }
-    }
-  \exp_args:Nno \use:n { \cs_new:Npn \@@_act_loop:w #1 \s_@@_act_stop }
-    {
-      \@@_tmp:
-      #1 \s_@@_act_stop
-    }
-\group_end:
+\exp_args:Nnx \use:n { \cs_new:Npn \@@_act_loop:w #1 \s_@@_act_stop }
+  {
+    \exp_not:o { \@@_act_if_head_is_space:nTF {#1} }
+      \exp_not:N \@@_act_space:wwnNNN
+      {
+        \exp_not:o { \tl_if_head_is_group:nTF {#1} }
+          \exp_not:N \@@_act_group:nwnNNN
+          \exp_not:N \@@_act_normal:NwnNNN
+      }
+    \exp_not:n {#1} \s_@@_act_stop
+  }
+\cs_undefine:N \@@_act_if_head_is_space:nTF
 \cs_new:Npn \@@_act_normal:NwnNNN #1 #2 \s_@@_act_stop #3#4
   {
     #4 {#3} #1





More information about the latex3-commits mailing list.