[latex3-commits] [git/LaTeX3-latex3-latex3] master: Avoid \__tl_trim_spaces:nn (ffb5def)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Mar 29 12:18:23 CEST 2018


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

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

commit ffb5def3bd1b81f504c181efc9471d4b9a72a19f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Mar 29 09:06:58 2018 +0100

    Avoid \__tl_trim_spaces:nn
    
    This requires a new public function, and is slightly slower.


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

ffb5def3bd1b81f504c181efc9471d4b9a72a19f
 l3kernel/l3clist.dtx                          |   14 +++++------
 l3kernel/l3keys.dtx                           |   14 ++++-------
 l3kernel/l3prop.dtx                           |   17 ++++++++-----
 l3kernel/l3tl.dtx                             |   33 ++++++++++++-------------
 l3kernel/testfiles/m3expl001.luatex.tlg       |    5 ++++
 l3kernel/testfiles/m3expl001.ptex.tlg         |    5 ++++
 l3kernel/testfiles/m3expl001.tlg              |    5 ++++
 l3kernel/testfiles/m3expl001.uptex.tlg        |    5 ++++
 l3kernel/testfiles/m3expl001.xetex.tlg        |    5 ++++
 l3kernel/testfiles/m3expl003.luatex.tlg       |    5 ++++
 l3kernel/testfiles/m3expl003.ptex.tlg         |    5 ++++
 l3kernel/testfiles/m3expl003.tlg              |    5 ++++
 l3kernel/testfiles/m3expl003.uptex.tlg        |    5 ++++
 l3kernel/testfiles/m3expl003.xetex.tlg        |    5 ++++
 l3trial/l3str-format-new/l3str-format-new.dtx |   18 ++++++++------
 15 files changed, 99 insertions(+), 47 deletions(-)

diff --git a/l3kernel/l3clist.dtx b/l3kernel/l3clist.dtx
index b8ce007..4607c23 100644
--- a/l3kernel/l3clist.dtx
+++ b/l3kernel/l3clist.dtx
@@ -922,16 +922,15 @@
 %   containing the \meta{item}, with leading and trailing spaces
 %   removed.  The calling function is responsible for inserting
 %   \cs{q_mark} in front of the \meta{item}, as well as testing for the
-%   end of the list.  We reuse a \pkg{l3tl} internal function, whose
-%   first argument must start with \cs{q_mark}.  That trims the item
+%   end of the list.  That trims the item
 %   |#2|, then feeds the result (after having to do an \texttt{o}-type
 %   expansion) to \cs{@@_trim_spaces_generic:nn} which places the
 %   \meta{code} in front of the \meta{trimmed item}.
 %    \begin{macrocode}
 \cs_new:Npn \@@_trim_spaces_generic:nw #1#2 ,
   {
-    \__tl_trim_spaces:nn {#2}
-      { \exp_args:No \@@_trim_spaces_generic:nn } {#1}
+    \tl_trim_spaces:oN { \use_none:n #2 }
+      { \@@_trim_spaces_generic:nn } {#1}
   }
 \cs_new:Npn \@@_trim_spaces_generic:nn #1#2 { #2 {#1} }
 %    \end{macrocode}
@@ -1769,6 +1768,7 @@
 %     \@@_item_n:nw,
 %     \@@_item_n_loop:nw,
 %     \@@_item_n_end:n,
+%     \@@_item_n_strip:n,
 %     \@@_item_n_strip:w}
 %   This starts in the same way as \cs{clist_item:Nn} by counting the items
 %   of the comma list. The final item should be space-trimmed before being
@@ -1800,10 +1800,8 @@
       }
   }
 \cs_new:Npn \@@_item_n_end:n #1 #2 \q_stop
-  {
-    \__tl_trim_spaces:nn { \q_mark #1 }
-      { \exp_last_unbraced:No \@@_item_n_strip:w } ,
-  }
+  { \tl_trim_spaces:nN {#1} { \@@_item_n_strip:n } }
+\cs_new:Npn \@@_item_n_strip:n #1 { \@@_item_n_strip:w #1 , }
 \cs_new:Npn \@@_item_n_strip:w #1 , { \exp_not:n {#1} }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index 5a619d6..9bac8be 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -913,9 +913,7 @@
 %   The main function starts off by normalising category codes in package mode.
 %   That's relatively \enquote{expensive} so is skipped (hopefully) in format
 %   mode. We then hand off to the parser. The use of \cs{q_mark} here prevents
-%   loss of braces from the key argument. This particular quark is chosen as
-%   it fits in with \cs{__tl_trim_spaces:nn} and allows a performance enhancement
-%   as the token can be carried through. Notice that by passing the two
+%   loss of braces from the key argument. Notice that by passing the two
 %   processor commands along the input stack we avoid the need to track these
 %   at all.
 %    \begin{macrocode}
@@ -1088,15 +1086,13 @@
 % \begin{macro}{\@@_def:Nn}
 % \begin{macro}[EXP]{\@@_def_aux:n}
 % \begin{macro}[EXP]{\@@_def_aux:w}
-%   First trim spaces off, then potentially remove a set of braces. By using
-%   the internal interface |\__tl_trim_spaces:nn| we can take advantage of the
-%   fact it needs a leading |\q_mark| in this process. The |\exp_after:wN|
-%   removes the quark, the delimited argument deals with any braces.
+%   First remove the leading quark, then trim spaces off, and finally remove
+%   a set of braces. 
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_def:Nn #1#2
-  { \tl_set:Nx #1 { \__tl_trim_spaces:nn {#2} \@@_def_aux:n } }
+  { \tl_set:Nx #1 { \tl_trim_spaces:oN { \use_none:n #2 } \@@_def_aux:n } }
 \cs_new:Npn \@@_def_aux:n #1
-  { \exp_after:wN \@@_def_aux:w #1 \q_stop }
+  { \@@_def_aux:w #1 \q_stop }
 \cs_new:Npn \@@_def_aux:w #1 \q_stop { \exp_not:n {#1} }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/l3prop.dtx b/l3kernel/l3prop.dtx
index 037d842..a2b5d08 100644
--- a/l3kernel/l3prop.dtx
+++ b/l3kernel/l3prop.dtx
@@ -634,14 +634,15 @@
 %     \@@_from_keyval:n,
 %     \@@_from_keyval_loop:w,
 %     \@@_from_keyval_split:Nw,
+%     \@@_from_keyval_key:n,
 %     \@@_from_keyval_key:w,
+%     \@@_from_keyval_value:n,
 %     \@@_from_keyval_value:w
 %   }
 %   Loop through items separated by commas, with \cs{q_mark} to avoid
 %   losing braces.  After checking for termination, split the item at
 %   the first then at the second |=| (which ought to be the first of the
-%   trailing~|=|).  At both splits, trim spaces (the internal
-%   \cs{__tl_trim_spaces:nn} expects the \cs{q_mark} we give it) and
+%   trailing~|=|).  At both splits, trim spaces and
 %   call \cs{@@_from_keyval_key:w}, then \cs{@@_from_keyval_value:w},
 %   followed by the trimmed material, \cs{q_nil}, the subsequent part of
 %   the item, and the trailing |=|'s and \cs{q_stop}.  After finding the
@@ -670,20 +671,24 @@
 \cs_new:Npn \@@_from_keyval_loop:w #1 ,
   {
     \quark_if_recursion_tail_stop:o { \use_none:n #1 }
-    \@@_from_keyval_split:Nw \@@_from_keyval_key:w
+    \@@_from_keyval_split:Nw \@@_from_keyval_key:n
       #1 = = \q_stop { \use_none:n #1 }
     \@@_from_keyval_loop:w \q_mark
   }
 \cs_new:Npn \@@_from_keyval_split:Nw #1#2 =
   {
-    \__tl_trim_spaces:nn {#2}
-      { \exp_last_unbraced:No #1 } \q_nil
+    \tl_trim_spaces:oN { \use_none:n #2 } #1
+      \q_nil
   }
+\cs_new:Npn \@@_from_keyval_key:n #1
+  { \@@_from_keyval_key:w #1 }
 \cs_new:Npn \@@_from_keyval_key:w #1 \q_nil #2 \q_stop
   {
-    \@@_from_keyval_split:Nw \@@_from_keyval_value:w
+    \@@_from_keyval_split:Nw \@@_from_keyval_value:n
       \q_mark #2 \q_stop {#1}
   }
+\cs_new:Npn \@@_from_keyval_value:n #1
+  { \@@_from_keyval_value:w #1 }
 \cs_new:Npn \@@_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4
   {
     \tl_if_empty:nF { #3 #1 #2 }
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index e87650f..32f16a1 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -754,7 +754,7 @@
 % \end{function}
 %
 % \begin{function}[added = 2011-07-09, updated = 2012-06-25, EXP]
-%   {\tl_trim_spaces:n}
+%   {\tl_trim_spaces:n, \tl_trim_spaces:o}
 %   \begin{syntax}
 %     \cs{tl_trim_spaces:n} \Arg{token list}
 %   \end{syntax}
@@ -769,6 +769,16 @@
 %   \end{texnote}
 % \end{function}
 %
+% \begin{function}[added = 2018-03-29, EXP]
+%   {\tl_trim_spaces:nN, \tl_trim_spaces:oN}
+%   \begin{syntax}
+%     \cs{tl_trim_spaces:nN} \Arg{token list} \meta{function}
+%   \end{syntax}
+%   Removes any leading and trailing explicit space characters
+%   (explicit tokens with character code~$32$ and category code~$10$)
+%   from the \meta{token list} and passes the result to the \meta{function}.
+% \end{function}
+%
 % \begin{function}[added = 2011-07-09]
 %   {
 %     \tl_trim_spaces:N,  \tl_trim_spaces:c,
@@ -1079,22 +1089,6 @@
 %   code and so should only be used for short-term storage.
 % \end{variable}
 %
-% \section{Internal functions}
-%
-% \begin{function}{\__tl_trim_spaces:nn}
-%   \begin{syntax}
-%     \cs{__tl_trim_spaces:nn} |{ \q_mark| \meta{token list} |}| \Arg{continuation}
-%   \end{syntax}
-%   This function removes all leading and trailing explicit space
-%   characters from the \meta{token list}, and expands to the
-%   \meta{continuation}, followed by a brace group containing
-%   \cs{use_none:n} \cs{q_mark} \meta{trimmed token list}.  For
-%   instance, \cs{tl_trim_spaces:n} is implemented by taking the
-%   \meta{continuation} to be \cs{exp_not:o}, and the \texttt{o}-type
-%   expansion removes the \cs{q_mark}.  This function is also used in
-%   \pkg{l3clist} and \pkg{l3candidates}.
-% \end{function}
-%
 % \end{documentation}
 %
 % \begin{implementation}
@@ -2378,6 +2372,7 @@
 % \end{macro}
 %
 % \begin{macro}{\tl_trim_spaces:n, \tl_trim_spaces:o}
+% \begin{macro}{\tl_trim_spaces:nN, \tl_trim_spaces:oN}
 % \begin{macro}
 %   {
 %     \tl_trim_spaces:N, \tl_trim_spaces:c,
@@ -2394,6 +2389,9 @@
 \cs_new:Npn \tl_trim_spaces:n #1
   { \@@_trim_spaces:nn { \q_mark #1 } \exp_not:o }
 \cs_generate_variant:Nn \tl_trim_spaces:n { o }
+\cs_new:Npn \tl_trim_spaces:nN #1#2
+  { \@@_trim_spaces:nn { \q_mark #1 } { \exp_args:No #2 } }
+\cs_generate_variant:Nn \tl_trim_spaces:nN { o }
 \cs_new_protected:Npn \tl_trim_spaces:N #1
   { \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
 \cs_new_protected:Npn \tl_gtrim_spaces:N #1
@@ -2466,6 +2464,7 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}
 %   {\tl_sort:Nn, \tl_sort:cn, \tl_gsort:Nn, \tl_gsort:cn, \tl_sort:nN}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 8dcb971..28f2b26 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -530,6 +530,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2337,6 +2339,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2653,7 +2656,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 8631c7e..415b686 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2018,6 +2020,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2590,7 +2593,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index b37f8da..b99bd84 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2018,6 +2020,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2590,7 +2593,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index f503307..23fb8a9 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2018,6 +2020,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2590,7 +2593,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 9fe683e..cd1b87f 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2335,6 +2337,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2651,7 +2654,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 8dcb971..28f2b26 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -530,6 +530,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2337,6 +2339,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2653,7 +2656,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 8631c7e..415b686 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2018,6 +2020,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2590,7 +2593,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index b37f8da..b99bd84 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2018,6 +2020,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2590,7 +2593,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index f503307..23fb8a9 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2018,6 +2020,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2590,7 +2593,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 9fe683e..cd1b87f 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -529,6 +529,8 @@ Defining \__tl_reverse_items:nwNwn on line ...
 Defining \__tl_reverse_items:wn on line ...
 Defining \tl_trim_spaces:n on line ...
 Defining \tl_trim_spaces:o on line ...
+Defining \tl_trim_spaces:nN on line ...
+Defining \tl_trim_spaces:oN on line ...
 Defining \tl_trim_spaces:N on line ...
 Defining \tl_gtrim_spaces:N on line ...
 Defining \tl_trim_spaces:c on line ...
@@ -2335,6 +2337,7 @@ Defining \clist_item:nn on line ...
 Defining \__clist_item_n:nw on line ...
 Defining \__clist_item_n_loop:nw on line ...
 Defining \__clist_item_n_end:n on line ...
+Defining \__clist_item_n_strip:n on line ...
 Defining \__clist_item_n_strip:w on line ...
 Defining \clist_show:N on line ...
 Defining \clist_show:c on line ...
@@ -2651,7 +2654,9 @@ Defining \prop_const_from_keyval:cn on line ...
 Defining \__prop_from_keyval:n on line ...
 Defining \__prop_from_keyval_loop:w on line ...
 Defining \__prop_from_keyval_split:Nw on line ...
+Defining \__prop_from_keyval_key:n on line ...
 Defining \__prop_from_keyval_key:w on line ...
+Defining \__prop_from_keyval_value:n on line ...
 Defining \__prop_from_keyval_value:w on line ...
 Defining \__prop_split:NnTF on line ...
 Defining \__prop_split_aux:NnTF on line ...
diff --git a/l3trial/l3str-format-new/l3str-format-new.dtx b/l3trial/l3str-format-new/l3str-format-new.dtx
index bd54171..7d6f04b 100644
--- a/l3trial/l3str-format-new/l3str-format-new.dtx
+++ b/l3trial/l3str-format-new/l3str-format-new.dtx
@@ -250,8 +250,6 @@
 % \section{Possibilities, and things to do}
 %
 % \begin{itemize}
-%   \item Note somewhere that the internal \cs{__tl_trim_spaces:nn} is
-%     used!  Fix that.
 %   \item Provide a token list formatting \meta{style} which keeps the
 %     last \meta{precision} characters rather than the first
 %     \meta{precision}.
@@ -315,21 +313,27 @@
 %
 % \subsection{Key--value pairs}
 %
-% \begin{macro}[aux,EXP]{\@@_keyval_strip:w, \@@_keyval_strip_aux:wn}
+% \begin{macro}[EXP]{\@@_keyval_strip_do:nn}
+% \begin{macro}[EXP]{\@@_keyval_strip:n}
+% \begin{macro}[EXP]{\@@_keyval_strip:wn}
 %   \cs{@@_keyval_strip_do:nn} receives |{| \cs{q_mark} \meta{token
 %       list} |}| as its first argument, trims spaces from both ends of
-%   the \meta{token list} thanks to \cs{__tl_trim_spaces:nn}, and
+%   the \meta{token list}, and
 %   removes one set of braces, then feeds the result to its second
 %   argument as a brace group.
 %    \begin{macrocode}
 \cs_new:Npn \@@_keyval_strip_do:nn #1
   {
-    \__tl_trim_spaces:nn {#1}
-      { \exp_last_unbraced:No \@@_keyval_strip_aux:wn } \q_stop
+    \tl_trim_spaces:oN { \use_none:n #1 }
+      \@@_keyval_strip:n
+      \q_stop
   }
-\cs_new:Npn \@@_keyval_strip_aux:wn #1 \q_stop #2 { #2 {#1} }
+\cs_new:Npn \@@_keyval_strip:n #1 { \@@_keyval_strip:wn #1 }
+\cs_new:Npn \@@_keyval_strip:wn #1 \q_stop #2 { #2 {#1} }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \begin{macro}[int,EXP]{\@@_keyval_parse:NNn}
 % \begin{macro}[aux,EXP]





More information about the latex3-commits mailing list