[latex3-commits] [git/LaTeX3-latex3-latex3] master: Minor code simplifications in l3file (e33a9bee5)

Bruno Le Floch bruno at le-floch.fr
Mon Jun 29 16:10:21 CEST 2020


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

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

commit e33a9bee56b88966c9b47cb1b789f9b9ade93352
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Mon Jun 29 16:10:21 2020 +0200

    Minor code simplifications in l3file


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

e33a9bee56b88966c9b47cb1b789f9b9ade93352
 l3kernel/l3file.dtx | 37 ++++++++++++-------------------------
 1 file changed, 12 insertions(+), 25 deletions(-)

diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 15a9d3066..d607f9630 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -714,7 +714,7 @@
 %
 % \begin{function}[EXP, added = 2020-06-24]{\file_parse_full_name_apply:nN}
 %   \begin{syntax}
-%     \cs{file_parse_full_name:n} \Arg{full name} \meta{function}
+%     \cs{file_parse_full_name_apply:nN} \Arg{full name} \meta{function}
 %   \end{syntax}
 %   Parses the \meta{full name} as described for \cs{file_parse_full_name:nNNN},
 %   and passes \meta{dir}, \meta{name}, and \meta{ext} as arguments to \meta{function},
@@ -3378,20 +3378,18 @@
 % \end{macro}
 %
 % \begin{macro}{\file_parse_full_name:n, \file_parse_full_name_apply:nN}
-% \begin{macro}{\@@_parse_full_name_end:nnn}
 %   The main parsing macro \cs{file_parse_full_name_apply:nN} passes the
-%   file name |#1| thorugh \cs{__kernel_file_name_sanitize:n} so that we
+%   file name |#1| through \cs{__kernel_file_name_sanitize:n} so that we
 %   have a single normalised way to treat files internally.
-%   \cs{file_parse_full_name:n} uses the former, with a dummy macro to
+%   \cs{file_parse_full_name:n} uses the former, with
+%   \cs{prg_do_nothing:} to
 %   leave each part of the name within a pair of braces.
 %    \begin{macrocode}
 \cs_new:Npn \file_parse_full_name:n #1
   {
     \file_parse_full_name_apply:nN {#1}
-      \@@_parse_full_name_end:nnn
+      \prg_do_nothing:
   }
-\cs_new:Npn \@@_parse_full_name_end:nnn #1 #2 #3
-  { {#1} {#2} {#3} }
 \cs_new:Npn \file_parse_full_name_apply:nN #1
   {
     \exp_args:Ne \@@_parse_full_name_auxi:nN
@@ -3411,15 +3409,12 @@
 \cs_new:Npn \@@_parse_full_name_auxi:nN #1
   {
     \@@_parse_full_name_area:nw { } #1
-      / \q_@@_nil \s_@@_stop
+      / \s_@@_stop
   }
 \cs_new:Npn \@@_parse_full_name_area:nw #1 #2 / #3 \s_@@_stop
   {
-    \@@_quark_if_nil:nTF {#3}
-      {
-        \@@_parse_full_name_base:nw { } #2 . \q_@@_nil
-          \s_@@_stop {#1}
-      }
+    \tl_if_empty:nTF {#3}
+      { \@@_parse_full_name_base:nw { } #2 . \s_@@_stop {#1} }
       { \@@_parse_full_name_area:nw { #1 / #2 } #3 \s_@@_stop }
   }
 %    \end{macrocode}
@@ -3435,7 +3430,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_parse_full_name_base:nw #1 #2 . #3 \s_@@_stop
   {
-    \@@_quark_if_nil:nTF {#3}
+    \tl_if_empty:nTF {#3}
       {
         \tl_if_empty:nTF {#1}
           {
@@ -3460,18 +3455,10 @@
   {
     \exp_args:Nee #4
       {
-        \tl_if_empty:nF {#3}
-          {
-            \str_if_eq:nnF {#3} { / }
-              { \use_none:n }
-          }
-            #3
-      }
-      {
-        \tl_if_empty:nF {#1}
-          { \use_none:n }
-            #1
+        \str_if_eq:nnF {#3} { / } { \use_none:n }
+        #3 \prg_do_nothing:
       }
+      { \use_none:n #1 \prg_do_nothing: }
       {#2}
   }
 %    \end{macrocode}





More information about the latex3-commits mailing list.