[latex3-commits] [git/LaTeX3-latex3-latex3] cmd: Re-rework loading logic (1b98c3d6f)

PhelypeOleinik phelype.oleinik at latex-project.org
Sat Jan 23 20:56:29 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : cmd
Link       : https://github.com/latex3/latex3/commit/1b98c3d6f4d73520e2ffbd6da8ab5875755e659e

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

commit 1b98c3d6f4d73520e2ffbd6da8ab5875755e659e
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sat Jan 23 16:56:29 2021 -0300

    Re-rework loading logic


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

1b98c3d6f4d73520e2ffbd6da8ab5875755e659e
 l3packages/xparse/xparse.dtx | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/l3packages/xparse/xparse.dtx b/l3packages/xparse/xparse.dtx
index 506146365..9d88ef552 100644
--- a/l3packages/xparse/xparse.dtx
+++ b/l3packages/xparse/xparse.dtx
@@ -973,6 +973,10 @@
 %<*2ekernel|package>
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+%<@@=cmd>
+%    \end{macrocode}
+%
 % This package file, along with the frozen versions in
 % \pkg{xparse-2018-04-12}, \pkg{xparse-2020-10-01}, and
 % |xparse-generic.tex|, is intended to work across different \LaTeX{}
@@ -996,14 +1000,15 @@
 % |xparse-generic.tex|.
 %    \begin{macrocode}
 \providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
-\@ifundefined{NewDocumentCommand}
-  {%
+\ExplSyntaxOn
+\cs_if_free:NTF \NewDocumentCommand
+  {
     \IfFormatAtLeastTF{2020/10/01}
 %<2ekernel>      {\@@input xparse-generic.tex }
 %<package>      {\RequirePackage{xparse-2020-10-01}}
       {\RequirePackage{xparse-2018-04-12}}
-    \endinput
-  }%
+    \file_input_stop:
+  }
 %    \begin{macrocode}
 %
 % In case \cs{NewDocumentCommand} is already defined, we're either in
@@ -1011,18 +1016,17 @@
 % the kernel has the |__xparse| prefix, so we'll load
 % \pkg{xparse-2020-10-01}, otherwise we'll continue in |xparse.sty|,
 % which contains the final remains of \pkg{xparse} with the |__cmd|
-% prefix.
+% prefix.  To check that we simply look at an internal command with the
+% |__cmd| prefix.
 %    \end{macrocode}
-  {%
-    \ifnum
-        \ifdefined\sourceLaTeXdate \sourceLaTeXdate
-        \else \expandafter\@parse at version\fmtversion//00\@nil \fi
-        = \@parse at version 2021-05-01//00\@nil
-      \expandafter\@gobblethree
-    \fi
-    \RequirePackage{xparse-2020-10-01}
-    \endinput
-  }%
+  {
+    \cs_if_exist:NF \@@_start:nNNnnn
+      {
+        \RequirePackage{xparse-2020-10-01}
+        \file_input_stop:
+      }
+  }
+\ExplSyntaxOff
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -1034,9 +1038,6 @@
 % file only holds the deprecated argument specifiers |G|, |l|, and |u|.
 % To match the prefix in the \LaTeXe{} kernel, so that the deprecated
 % types work if |xparse.sty| is loaded, the prefix has changed to |cmd|.
-%    \begin{macrocode}
-%<@@=cmd>
-%    \end{macrocode}
 %
 %    \begin{macrocode}
 %<*package>





More information about the latex3-commits mailing list.