[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use e-type expansion rather than home-brew version in l3fp (ff26140)
Bruno Le Floch
bruno at le-floch.fr
Thu Feb 28 02:02:28 CET 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/ff2614089484ecad47bb54eafc27c1209dc1ad1c
>---------------------------------------------------------------
commit ff2614089484ecad47bb54eafc27c1209dc1ad1c
Author: Bruno Le Floch <bruno at le-floch.fr>
Date: Thu Feb 28 02:02:28 2019 +0100
Use e-type expansion rather than home-brew version in l3fp
>---------------------------------------------------------------
ff2614089484ecad47bb54eafc27c1209dc1ad1c
l3kernel/l3fp-aux.dtx | 37 +++----------------------------
l3kernel/l3fp-convert.dtx | 19 +++++-----------
l3kernel/testfiles/m3expl001.luatex.tlg | 2 --
l3kernel/testfiles/m3expl001.ptex.tlg | 2 --
l3kernel/testfiles/m3expl001.tlg | 2 --
l3kernel/testfiles/m3expl001.uptex.tlg | 2 --
l3kernel/testfiles/m3expl001.xetex.tlg | 2 --
l3kernel/testfiles/m3expl003.luatex.tlg | 2 --
l3kernel/testfiles/m3expl003.ptex.tlg | 2 --
l3kernel/testfiles/m3expl003.tlg | 2 --
l3kernel/testfiles/m3expl003.uptex.tlg | 2 --
l3kernel/testfiles/m3expl003.xetex.tlg | 2 --
12 files changed, 9 insertions(+), 67 deletions(-)
diff --git a/l3kernel/l3fp-aux.dtx b/l3kernel/l3fp-aux.dtx
index 1a93847..6784813 100644
--- a/l3kernel/l3fp-aux.dtx
+++ b/l3kernel/l3fp-aux.dtx
@@ -1207,37 +1207,6 @@
% \end{macro}
% \end{macro}
%
-% \subsection{\texttt{x}-like expansion expandably}
-%
-% \begin{macro}[EXP]{\@@_expand:n}
-% \begin{macro}[EXP]{\@@_expand_loop:nwnN}
-% This expandable function behaves in a way somewhat similar to
-% \cs{use:x}, but much less robust. The argument is
-% \texttt{f}-expanded, then the leading item (often a single character
-% token) is moved to a storage area after \cs{s_@@_mark}, and
-% \texttt{f}-expansion is applied again, repeating until the argument
-% is empty. The result built one piece at a time is then inserted in
-% the input stream. Note that spaces are ignored by this procedure,
-% unless surrounded with braces. Multiple tokens which do not need
-% expansion can be inserted within braces.
-% \begin{macrocode}
-\cs_new:Npn \@@_expand:n #1
- {
- \@@_expand_loop:nwnN { }
- #1 \prg_do_nothing:
- \s_@@_mark { } \@@_expand_loop:nwnN
- \s_@@_mark { } \@@_use_i_until_s:nw ;
- }
-\cs_new:Npn \@@_expand_loop:nwnN #1#2 \s_@@_mark #3 #4
- {
- \exp_after:wN #4 \exp:w \exp_end_continue_f:w
- #2
- \s_@@_mark { #3 #1 } #4
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \subsection{Fast string comparison}
%
% \begin{macro}{\@@_str_if_eq:nn}
@@ -1247,10 +1216,9 @@
% No \pkg{l3sys} or \pkg{l3luatex} just yet so we have to define in terms of
% primitives.
% \begin{macrocode}
-\cs_new:Npn \@@_str_if_eq:nn #1#2 { \tex_strcmp:D {#1} {#2} }
-\sys_if_engine_luatex:T
+\sys_if_engine_luatex:TF
{
- \cs_set:Npn \@@_str_if_eq:nn #1#2
+ \cs_new:Npn \@@_str_if_eq:nn #1#2
{
\tex_directlua:D
{
@@ -1262,6 +1230,7 @@
}
}
}
+ { \cs_new_eq:NN \@@_str_if_eq:nn \tex_strcmp:D }
% \end{macrocode}
% \end{macro}
%
diff --git a/l3kernel/l3fp-convert.dtx b/l3kernel/l3fp-convert.dtx
index b7a76f0..ed1d3bc 100644
--- a/l3kernel/l3fp-convert.dtx
+++ b/l3kernel/l3fp-convert.dtx
@@ -592,26 +592,19 @@
{
\tl_if_empty:nF {#1}
{
- \@@_expand:n
+ \exp_last_unbraced:Ne \use_ii:nn
{
- { \use_ii:nn }
\@@_array_to_clist_loop:Nw #1 { ? \prg_break: } ;
\prg_break_point:
}
}
}
-\cs_new:Npx \@@_array_to_clist_loop:Nw #1#2;
+\cs_new:Npn \@@_array_to_clist_loop:Nw #1#2;
{
- \exp_not:N \use_none:n #1
- \exp_not:N \exp_after:wN
- {
- \exp_not:N \exp_after:wN ,
- \exp_not:N \exp_after:wN \c_space_tl
- \exp_not:N \exp:w
- \exp_not:N \exp_end_continue_f:w
- \exp_not:N \@@_to_tl_dispatch:w #1 #2 ;
- }
- \exp_not:N \@@_array_to_clist_loop:Nw
+ \use_none:n #1
+ , ~
+ \exp_not:f { \@@_to_tl_dispatch:w #1 #2 ; }
+ \@@_array_to_clist_loop:Nw
}
% \end{macrocode}
% \end{macro}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index ebd7086..19579d3 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -3627,8 +3627,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index ce341ee..a568225 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -3924,8 +3924,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 5a8b9cb..6754051 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -3924,8 +3924,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 8cd39c9..f42d4f3 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -3924,8 +3924,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 89e6879..fda6979 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -3662,8 +3662,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index ebd7086..19579d3 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -3627,8 +3627,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index ce341ee..a568225 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -3924,8 +3924,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 5a8b9cb..6754051 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -3924,8 +3924,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 8cd39c9..f42d4f3 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -3924,8 +3924,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 89e6879..fda6979 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -3662,8 +3662,6 @@ Defining \__fp_small_int:wTF on line ...
Defining \__fp_small_int_true:wTF on line ...
Defining \__fp_small_int_normal:NnwTF on line ...
Defining \__fp_small_int_test:NnnwNw on line ...
-Defining \__fp_expand:n on line ...
-Defining \__fp_expand_loop:nwnN on line ...
Defining \__fp_str_if_eq:nn on line ...
Defining \__fp_func_to_name:N on line ...
Defining \__fp_func_to_name_aux:w on line ...
More information about the latex3-commits
mailing list