[latex3-commits] [l3svn] r6873 - Fix expansion of arguments in environment end-code

noreply at latex-project.org noreply at latex-project.org
Fri Feb 10 00:08:07 CET 2017


Author: bruno
Date: 2017-02-10 00:08:07 +0100 (Fri, 10 Feb 2017)
New Revision: 6873

Modified:
   trunk/l3packages/xparse/testfiles/xparse001.ptex.tlg
   trunk/l3packages/xparse/testfiles/xparse001.tlg
   trunk/l3packages/xparse/testfiles/xparse001.uptex.tlg
   trunk/l3packages/xparse/testfiles/xparse004.luatex.tlg
   trunk/l3packages/xparse/testfiles/xparse004.lvt
   trunk/l3packages/xparse/testfiles/xparse004.tlg
   trunk/l3packages/xparse/xparse.dtx
Log:
Fix expansion of arguments in environment end-code

In a previous commit I had replaced \tl_tail:N \l_@@_args_tl
by \l_@@_args_tl instead of \exp_not:o \l_@@_args_tl when that
token list got one token removed from it.  This lead to wrong
expansion behaviour and broke l3doc for instance.


Modified: trunk/l3packages/xparse/testfiles/xparse001.ptex.tlg
===================================================================
--- trunk/l3packages/xparse/testfiles/xparse001.ptex.tlg	2017-02-09 22:51:27 UTC (rev 6872)
+++ trunk/l3packages/xparse/testfiles/xparse001.ptex.tlg	2017-02-09 23:08:07 UTC (rev 6873)
@@ -909,7 +909,8 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:->\cs_set_nopar:Npx \environment
-foo end aux {\exp_not:N \environment foo end aux  \l__xparse_args_tl }First.
+foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
+\l__xparse_args_tl }First.
 <recently read> }
 l. ...}
 ============================================================
@@ -926,7 +927,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -941,7 +942,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -956,7 +957,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -971,7 +972,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -986,7 +987,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}

Modified: trunk/l3packages/xparse/testfiles/xparse001.tlg
===================================================================
--- trunk/l3packages/xparse/testfiles/xparse001.tlg	2017-02-09 22:51:27 UTC (rev 6872)
+++ trunk/l3packages/xparse/testfiles/xparse001.tlg	2017-02-09 23:08:07 UTC (rev 6873)
@@ -909,7 +909,8 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:->\cs_set_nopar:Npx \environment
-foo end aux {\exp_not:N \environment foo end aux  \l__xparse_args_tl }First.
+foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
+\l__xparse_args_tl }First.
 <recently read> }
 l. ...}
 ============================================================
@@ -926,7 +927,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -941,7 +942,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -956,7 +957,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -971,7 +972,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -986,7 +987,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}

Modified: trunk/l3packages/xparse/testfiles/xparse001.uptex.tlg
===================================================================
--- trunk/l3packages/xparse/testfiles/xparse001.uptex.tlg	2017-02-09 22:51:27 UTC (rev 6872)
+++ trunk/l3packages/xparse/testfiles/xparse001.uptex.tlg	2017-02-09 23:08:07 UTC (rev 6873)
@@ -909,7 +909,8 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:->\cs_set_nopar:Npx \environment
-foo end aux {\exp_not:N \environment foo end aux  \l__xparse_args_tl }First.
+foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
+\l__xparse_args_tl }First.
 <recently read> }
 l. ...}
 ============================================================
@@ -926,7 +927,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -941,7 +942,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -956,7 +957,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -971,7 +972,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}
@@ -986,7 +987,7 @@
 <recently read> }
 l. ...}
 > \environment foo code=\protected\long macro:#1#2#3->\cs_set_nopar:Npx
-\environment foo end aux {\exp_not:N \environment foo end aux 
+\environment foo end aux {\exp_not:N \environment foo end aux  \exp_not:o
 \l__xparse_args_tl }(#1)(#2)(#3).
 <recently read> }
 l. ...}

Modified: trunk/l3packages/xparse/testfiles/xparse004.luatex.tlg
===================================================================
--- trunk/l3packages/xparse/testfiles/xparse004.luatex.tlg	2017-02-09 22:51:27 UTC (rev 6872)
+++ trunk/l3packages/xparse/testfiles/xparse004.luatex.tlg	2017-02-09 23:08:07 UTC (rev 6873)
@@ -1501,3 +1501,14 @@
 \par 
 \par 
 ============================================================
+============================================================
+TEST 19: Environments and expansion
+============================================================
+.................................................
+. LaTeX info: "xparse/redefine-environment"
+. 
+. Redefining environment 'foo' with sig. 'o' on line ....
+.................................................
+\A \B \C 
+\A \B \C 
+============================================================

Modified: trunk/l3packages/xparse/testfiles/xparse004.lvt
===================================================================
--- trunk/l3packages/xparse/testfiles/xparse004.lvt	2017-02-09 22:51:27 UTC (rev 6872)
+++ trunk/l3packages/xparse/testfiles/xparse004.lvt	2017-02-09 23:08:07 UTC (rev 6873)
@@ -340,4 +340,13 @@
     \foo\par \NEWLINE
   }
 
+\TEST { Environments~and~expansion }
+  {
+    \DeclareDocumentEnvironment { foo } { o }
+      { \TYPE { \exp_not:n {#1} } }
+      { \TYPE { \exp_not:n {#1} } }
+    \begin{foo}[\A\B\C]
+    \end{foo}
+  }
+
 \END

Modified: trunk/l3packages/xparse/testfiles/xparse004.tlg
===================================================================
--- trunk/l3packages/xparse/testfiles/xparse004.tlg	2017-02-09 22:51:27 UTC (rev 6872)
+++ trunk/l3packages/xparse/testfiles/xparse004.tlg	2017-02-09 23:08:07 UTC (rev 6873)
@@ -1501,3 +1501,14 @@
 \par 
 \par 
 ============================================================
+============================================================
+TEST 19: Environments and expansion
+============================================================
+.................................................
+. LaTeX info: "xparse/redefine-environment"
+. 
+. Redefining environment 'foo' with sig. 'o' on line ....
+.................................................
+\A \B \C 
+\A \B \C 
+============================================================

Modified: trunk/l3packages/xparse/xparse.dtx
===================================================================
--- trunk/l3packages/xparse/xparse.dtx	2017-02-09 22:51:27 UTC (rev 6872)
+++ trunk/l3packages/xparse/xparse.dtx	2017-02-09 23:08:07 UTC (rev 6873)
@@ -1166,7 +1166,7 @@
         \cs_set_nopar:Npx \exp_not:c { environment~ #1 ~end~aux }
           {
             \exp_not:N \exp_not:N \exp_not:c { environment~ #1~end~aux~ }
-            \exp_not:n { \l_@@_args_tl }
+            \exp_not:n { \exp_not:o \l_@@_args_tl }
           }
         \exp_not:n {#3}
       }



More information about the latex3-commits mailing list