[latex3-commits] [git/LaTeX3-latex3-latex2e] gh569: Correctly detect \end<env> (0f652f1a)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Aug 30 05:20:05 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh569
Link       : https://github.com/latex3/latex2e/commit/0f652f1a08df8a12e1d92fcb49f0d845483f0f6a

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

commit 0f652f1a08df8a12e1d92fcb49f0d845483f0f6a
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Mon Aug 30 00:20:05 2021 -0300

    Correctly detect \end<env>


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

0f652f1a08df8a12e1d92fcb49f0d845483f0f6a
 base/ltcmd.dtx | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 64a52b28..055b631f 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -4020,12 +4020,17 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_cmd_type_cases:NnnnnF #1 #2 #3 #4 #5 #6
   {
-    \str_case_e:nnF
+    \exp_args:Ne \str_case_e:nnF
       {
         \exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 }
           {
-            \exp_last_unbraced:Nf \@@_cmd_if_xparse_aux:w
-              { \cs_replacement_spec:N #1 } ~ \q_stop
+            \token_if_macro:NT #1
+              {
+                \exp_after:wN \exp_after:wN
+                \exp_after:wN \token_to_str:N
+                \exp_after:wN \use_i_delimit_by_q_stop:nw
+                  #1 \q_stop
+              }
           }
       }
       {
@@ -4034,12 +4039,13 @@
         { \token_to_str:N \@@_start_env:nnnnn } {#4}
         {
           \exp_after:wN \token_to_str:N
-            \cs:w environment~ \cs_to_str:N #1 ~end~aux \cs_end:
+            \cs:w environment~
+              \exp_last_unbraced:Ne \use_none:nnn
+                { \cs_to_str:N #1 } ~end~aux \cs_end:
         } {#5}
       }
       {#6}
   }
-\cs_new:Npn \@@_cmd_if_xparse_aux:w #1 ~ #2 \q_stop {#1}
 \cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1
   {
     \@@_cmd_type_cases:NnnnnF #1





More information about the latex3-commits mailing list.