[latex3-commits] [git/latex3] master: Simplify some expansions (bd9ea0f)

Bruno Le Floch bruno at le-floch.fr
Fri Dec 1 06:24:31 CET 2017


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

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

commit bd9ea0f11fad0c347419f88f37d91cdd73da6e70
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Fri Dec 1 00:24:31 2017 -0500

    Simplify some expansions


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

bd9ea0f11fad0c347419f88f37d91cdd73da6e70
 l3kernel/l3expan.dtx    |   21 ++++++++-------------
 l3kernel/l3fp-parse.dtx |   17 ++++++++---------
 l3kernel/l3skip.dtx     |    4 +---
 3 files changed, 17 insertions(+), 25 deletions(-)

diff --git a/l3kernel/l3expan.dtx b/l3kernel/l3expan.dtx
index 5328608..14eb838 100644
--- a/l3kernel/l3expan.dtx
+++ b/l3kernel/l3expan.dtx
@@ -1612,19 +1612,14 @@
         \exp_not:N \q_stop
     \exp_not:N \fi:
   }
-\use:x
-  {
-    \cs_new_protected:Npn \exp_not:N \@@_generate_variant:ww
-      ##1 \tl_to_str:n { ma } ##2 \exp_not:N \q_mark
-  }
-  { \@@_generate_variant:wwNw #1 }
-\use:x
-  {
-    \cs_new_protected:Npn \exp_not:N \@@_generate_variant:wwNw
-      ##1 \tl_to_str:n { pr } ##2 \exp_not:N \q_mark
-      ##3 ##4 \exp_not:N \q_stop
-  }
-  { \cs_set_eq:NN \@@_tmp:w #3 }
+\exp_last_unbraced:NNNNo
+  \cs_new_protected:Npn \@@_generate_variant:ww
+    #1 { \tl_to_str:n { ma } } #2 \q_mark
+    { \@@_generate_variant:wwNw #1 }
+\exp_last_unbraced:NNNNo
+  \cs_new_protected:Npn \@@_generate_variant:wwNw
+    #1 { \tl_to_str:n { pr } } #2 \q_mark #3 #4 \q_stop
+    { \cs_set_eq:NN \@@_tmp:w #3 }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
diff --git a/l3kernel/l3fp-parse.dtx b/l3kernel/l3fp-parse.dtx
index beb52d2..9f01af7 100644
--- a/l3kernel/l3fp-parse.dtx
+++ b/l3kernel/l3fp-parse.dtx
@@ -881,15 +881,14 @@
       . \tl_to_str:n { pt } ; \exp_not:N \@@_parse_one_register_int:www
       \exp_not:N \q_stop
   }
-\use:x
-  {
-    \cs_new:Npn \exp_not:N \@@_parse_one_register_auxii:wwwNw
-        ##1 . ##2 \tl_to_str:n { pt } ##3 ; ##4##5 \exp_not:N \q_stop
-        { ##4 ##1.##2; }
-    \cs_new:Npn \exp_not:N \@@_parse_one_register_mu:www
-      ##1 \tl_to_str:n { mu } ; ##2 ;
-      { \exp_not:N \@@_parse_one_register_dim:ww ##1 ; }
-  }
+\exp_args:Nno \use:nn
+  { \cs_new:Npn \@@_parse_one_register_auxii:wwwNw #1 . #2 }
+    { \tl_to_str:n { pt } #3 ; #4#5 \q_stop }
+    { #4 #1.#2; }
+\exp_args:Nno \use:nn
+  { \cs_new:Npn \@@_parse_one_register_mu:www #1 }
+    { \tl_to_str:n { mu } ; #2 ; }
+    { \@@_parse_one_register_dim:ww #1 ; }
 \cs_new:Npn \@@_parse_one_register_int:www #1; #2.; #3;
   { \@@_parse:n { #1 e #3 } }
 \cs_new:Npn \@@_parse_one_register_dim:ww #1; #2;
diff --git a/l3kernel/l3skip.dtx b/l3kernel/l3skip.dtx
index f007d88..492fbc3 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -1343,9 +1343,7 @@
       \@@_compare:wNN #1 ? { = \@@_compare_end:w \else: } \q_stop
   }
 \exp_args:Nno \use:nn
-  { \cs_new:Npn \@@_compare:wNN #1 }
-  { \tl_to_str:n {pt} }
-  #2#3
+  { \cs_new:Npn \@@_compare:wNN #1 } { \tl_to_str:n {pt} #2#3 }
   {
       \if_meaning:w = #3
         \use:c { @@_compare_#2:w }





More information about the latex3-commits mailing list