[latex3-commits] [git/LaTeX3-latex3-latex3] main: Fix unbracing behaviour of \clist_map_tokens:nn (bc8f2cdaf)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri May 7 11:59:15 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/bc8f2cdaf12ee088c59b5e1126b83f95614d99a7

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

commit bc8f2cdaf12ee088c59b5e1126b83f95614d99a7
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Wed May 5 15:16:10 2021 +0200

    Fix unbracing behaviour of \clist_map_tokens:nn


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

bc8f2cdaf12ee088c59b5e1126b83f95614d99a7
 l3kernel/l3clist.dtx              | 3 ++-
 l3kernel/testfiles/m3clist002.lvt | 4 ++--
 l3kernel/testfiles/m3clist002.tlg | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/l3kernel/l3clist.dtx b/l3kernel/l3clist.dtx
index 4aaa6b5f7..a3b31b77d 100644
--- a/l3kernel/l3clist.dtx
+++ b/l3kernel/l3clist.dtx
@@ -1814,7 +1814,8 @@
     \tl_if_empty:oF { \use_none:nn #2 ? }
       {
         \exp_args:No \@@_if_recursion_tail_break:nN {#2} \clist_map_break:
-        \tl_trim_spaces_apply:oN {#2} \@@_map_unbrace:wn , {#1}
+        \exp_after:wN \@@_map_unbrace:wn
+        \exp:w \tl_trim_spaces_apply:oN {#2} \exp_end: , {#1}
       }
     \@@_map_tokens_n:nw {#1} \prg_do_nothing:
   }
diff --git a/l3kernel/testfiles/m3clist002.lvt b/l3kernel/testfiles/m3clist002.lvt
index 8392a7287..0fc6f97ac 100644
--- a/l3kernel/testfiles/m3clist002.lvt
+++ b/l3kernel/testfiles/m3clist002.lvt
@@ -378,11 +378,11 @@
   \cs_set:Npn \MAP:n #1 { \exp_args:No \TYPE {\tl_to_str:n{#1}} }
   \clist_map_function:NN \l_tmpa_clist  \MAP:n
   \clist_map_function:cN {l_tmpa_clist} \MAP:n
-  \clist_map_function:nN {aa,bb\par,cc} \MAP:n
+  \clist_map_function:nN {aa,bb\par,~{cc}} \MAP:n
   \cs_set:Npn \MAP:nn #1#2 { \exp_args:No \TYPE {\tl_to_str:n{#1:#2}} }
   \clist_map_tokens:Nn \l_tmpa_clist  { \MAP:nn \A }
   \clist_map_tokens:cn {l_tmpa_clist} { \MAP:nn \B }
-  \clist_map_tokens:nn {aa,bb\par,cc} { \MAP:n }
+  \clist_map_tokens:nn {aa,bb\par,~{cc}} { \MAP:n }
 }
 
 \TEST{map_variable}{
diff --git a/l3kernel/testfiles/m3clist002.tlg b/l3kernel/testfiles/m3clist002.tlg
index 2c8bf5dac..ac08cd461 100644
--- a/l3kernel/testfiles/m3clist002.tlg
+++ b/l3kernel/testfiles/m3clist002.tlg
@@ -306,7 +306,7 @@ cc
 \B :a
 aa
 bb\par 
-cc
+{cc}
 ============================================================
 ============================================================
 TEST 25: map_variable





More information about the latex3-commits mailing list.