[latex3-commits] [git/LaTeX3-latex3-latex3] master: Add \seq_map_tokens:Nn (0e9ec0c1f)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Aug 30 16:16:15 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/0e9ec0c1ffb10f41f03a5f172652d326d7dac50b

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

commit 0e9ec0c1ffb10f41f03a5f172652d326d7dac50b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Aug 29 13:39:09 2019 +0100

    Add \seq_map_tokens:Nn
    
    In readiness for file module changes.


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

0e9ec0c1ffb10f41f03a5f172652d326d7dac50b
 l3kernel/CHANGELOG.md                              |  4 ++++
 l3kernel/l3seq.dtx                                 | 25 ++++++++++++++++++++++
 .../l3token.synctex(busy)                          |  0
 l3kernel/testfiles/m3expl001.luatex.tlg            |  3 +++
 l3kernel/testfiles/m3expl001.ptex.tlg              |  3 +++
 l3kernel/testfiles/m3expl001.tlg                   |  3 +++
 l3kernel/testfiles/m3expl001.uptex.tlg             |  3 +++
 l3kernel/testfiles/m3expl001.xetex.tlg             |  3 +++
 l3kernel/testfiles/m3expl003.luatex.tlg            |  3 +++
 l3kernel/testfiles/m3expl003.ptex.tlg              |  3 +++
 l3kernel/testfiles/m3expl003.tlg                   |  3 +++
 l3kernel/testfiles/m3expl003.uptex.tlg             |  3 +++
 l3kernel/testfiles/m3expl003.xetex.tlg             |  3 +++
 13 files changed, 59 insertions(+)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index e53425d58..0b4b25d93 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Added
+
+- `\seq_map_tokens:Nn`
+
 ### Changed
 
 - Moved `\prop_map_tokens:Nn` to stable
diff --git a/l3kernel/l3seq.dtx b/l3kernel/l3seq.dtx
index 2a0083bd6..dcb435498 100644
--- a/l3kernel/l3seq.dtx
+++ b/l3kernel/l3seq.dtx
@@ -1835,6 +1835,31 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\seq_map_tokens:Nn, \seq_map_tokens:cn}
+% \begin{macro}{\@@_map_tokens:nw}
+%   This is based on the function mapping but using the same tricks as
+%   described for \cs{prop_map_tokens:Nn}. The idea is to remove the leading
+%   \cs{@@_item:n} and apply the tokens such that they are safe with the
+%   break points, hence the \cs{use:n}.
+%    \begin{macrocode}
+\cs_new:Npn \seq_map_tokens:Nn #1#2
+  {
+    \exp_last_unbraced:Nno
+      \use_i:nn { \@@_map_tokens:nw {#2} } #1
+    \prg_break: \@@_item:n { } \prg_break_point:
+    \prg_break_point:Nn \seq_map_break: { }
+  }
+\cs_generate_variant:Nn \seq_map_tokens:Nn { c }
+\cs_new:Npn \@@_map_tokens:nw #1#2 \@@_item:n #3
+  {
+    #2
+    \use:n {#1} {#3}
+    \@@_map_tokens:nw {#1}
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}
 %   {
 %     \seq_map_variable:NNn, \seq_map_variable:Ncn,
diff --git a/l3experimental/l3draw/testfiles/m3draw008.tlg b/l3kernel/l3token.synctex(busy)
similarity index 100%
copy from l3experimental/l3draw/testfiles/m3draw008.tlg
copy to l3kernel/l3token.synctex(busy)
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 7c0b70fc1..1bf9aad08 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -1241,6 +1241,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 68eefe86e..8c13179c5 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 09e84b9d1..bcd9cafb4 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 2d59b9e78..cc3254d68 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 7347939e6..92a65e73b 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 7c0b70fc1..1bf9aad08 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -1241,6 +1241,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 68eefe86e..8c13179c5 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 09e84b9d1..bcd9cafb4 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 2d59b9e78..cc3254d68 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 7347939e6..92a65e73b 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -1239,6 +1239,9 @@ Defining \__seq_push_item_def: on line ...
 Defining \__seq_pop_item_def: on line ...
 Defining \seq_map_inline:Nn on line ...
 Defining \seq_map_inline:cn on line ...
+Defining \seq_map_tokens:Nn on line ...
+Defining \seq_map_tokens:cn on line ...
+Defining \__seq_map_tokens:nw on line ...
 Defining \seq_map_variable:NNn on line ...
 Defining \seq_map_variable:Ncn on line ...
 Defining \seq_map_variable:cNn on line ...





More information about the latex3-commits mailing list