[latex3-commits] [git/LaTeX3-latex3-latex3] github-629: Use the correct number of arguments for processors (2d78f3009)

Bruno Le Floch bruno at le-floch.fr
Sat Oct 5 22:08:11 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : github-629
Link       : https://github.com/latex3/latex3/commit/2d78f3009eb5d694de92b6cc16dd0d0d0c89bbfc

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

commit 2d78f3009eb5d694de92b6cc16dd0d0d0c89bbfc
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sat Oct 5 22:08:11 2019 +0200

    Use the correct number of arguments for processors


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

2d78f3009eb5d694de92b6cc16dd0d0d0c89bbfc
 l3packages/xparse/testfiles/xparse004.lvt | 1 +
 l3packages/xparse/xparse.dtx              | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/l3packages/xparse/testfiles/xparse004.lvt b/l3packages/xparse/testfiles/xparse004.lvt
index 25751d9a7..136560986 100644
--- a/l3packages/xparse/testfiles/xparse004.lvt
+++ b/l3packages/xparse/testfiles/xparse004.lvt
@@ -477,6 +477,7 @@
     \DeclareDocumentCommand { \foo } { >{\SplitList{#2}} m >{\CountArg} O{,} }
       { \TYPE { \tl_to_str:n { |#1|#2| } } }
     \foo { a , bcd ; e }
+    \DeclareDocumentCommand { \baz } { } { }
     \foo { a , bcd ; e } [;]
   }
 
diff --git a/l3packages/xparse/xparse.dtx b/l3packages/xparse/xparse.dtx
index 51671cd34..f3060148c 100644
--- a/l3packages/xparse/xparse.dtx
+++ b/l3packages/xparse/xparse.dtx
@@ -1574,7 +1574,9 @@
 %   Loop through arguments (stored in \cs{l_@@_args_tl}) and the
 %   corresponding processors (in \cs{l_@@_process_all_tl})
 %   simultaneously, apply all processors for each argument and store the
-%   result back into \cs{l_@@_args_tl}.
+%   result back into \cs{l_@@_args_tl}.  To allow processors to depend
+%   on other arguments, for every processor define a temporary auxiliary
+%   that receives all arguments \cs{l_@@_args_tl}.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_args_process:
   {
@@ -1596,7 +1598,7 @@
 \cs_new_protected:Npn \@@_args_process_aux:n #1
   {
     \cs_generate_from_arg_count:NNnn \@@_tmp:w \cs_set:Npn
-      { \l_@@_current_arg_int } {#1}
+      { \tl_count:N \l_@@_args_tl } {#1}
     \exp_args:NNNo \exp_after:wN \@@_tmp:w \l_@@_args_tl
       { \ProcessedArgument }
   }





More information about the latex3-commits mailing list