[latex3-commits] [latex3/latex3] gh914-sort-use: Deprecate \tl_reverse:n for \tl_reverse_use:n (de3d247ca)
github at latex-project.org
github at latex-project.org
Mon May 22 14:14:05 CEST 2023
Repository : https://github.com/latex3/latex3
On branch : gh914-sort-use
Link : https://github.com/latex3/latex3/commit/de3d247cac3db41b587ddb5e47e44c38d18324c9
>---------------------------------------------------------------
commit de3d247cac3db41b587ddb5e47e44c38d18324c9
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon May 22 13:07:48 2023 +0100
Deprecate \tl_reverse:n for \tl_reverse_use:n
>---------------------------------------------------------------
de3d247cac3db41b587ddb5e47e44c38d18324c9
l3kernel/CHANGELOG.md | 2 ++
l3kernel/doc/l3syntax-changes.tex | 2 +-
l3kernel/l3deprecation.dtx | 7 +++++++
l3kernel/l3tl.dtx | 18 +++++++++---------
l3kernel/testfiles/m3tl-build001.lvt | 4 ++--
l3kernel/testfiles/m3tl007.lvt | 16 ++++++++--------
l3kernel/testfiles/m3tl007.tlg | 2 +-
l3kernel/testfiles/m3tl009.lvt | 4 ++--
l3kernel/testfiles/m3tlist002.lvt | 6 +++---
9 files changed, 35 insertions(+), 26 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index e2b3716df..7bd101263 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,12 +13,14 @@ this project uses date-based 'snapshot' version identifiers.
- `\coffin_(g)reset_poles:N`
- `\int_if_zero:n(TF)`
- `\str_mdfive_hash:n`
+- `\tl_reverse_use:n` (was `\tl_reverse:n`)
- `\tl_sort_use:nN` (was `\tl_sort:nN`)
### Changed
- Remove `\noexpand` inside math mode in `\text_expand:n`
## Deprecated
+- `\tl_reverse:n`, replaced by `\tl_reverse_use:n`
- `\tl_sort:nN`, replaced by `\tl_sort_use:nN` (issue \#914)
### Fixed
diff --git a/l3kernel/doc/l3syntax-changes.tex b/l3kernel/doc/l3syntax-changes.tex
index 8218429e7..902114f2e 100644
--- a/l3kernel/doc/l3syntax-changes.tex
+++ b/l3kernel/doc/l3syntax-changes.tex
@@ -59,7 +59,7 @@ changes after August 2011 are listed, with an approximate date.
\meta{normal token or brace group}
\meta{optional spaces}.
\]
- \item \cs{tl_reverse:n} stripped outer braces and lost unprotected spaces.
+ \item \cs{tl_reverse_use:n} stripped outer braces and lost unprotected spaces.
Now it keeps spaces, leaves unbraced single tokens unbraced, and
braced groups braced.
\item \cs{tl_trim_spaces:n} only removed one leading and trailing space.
diff --git a/l3kernel/l3deprecation.dtx b/l3kernel/l3deprecation.dtx
index 0ead8bf4d..593c00465 100644
--- a/l3kernel/l3deprecation.dtx
+++ b/l3kernel/l3deprecation.dtx
@@ -590,6 +590,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tl_reverse:n}
+% \begin{macrocode}
+\__kernel_patch_deprecation:nnNNpn { 2023-05-22 } { \tl_reverse_use:n }
+\cs_gset:Npn \tl_reverse:n { \tl_reverse_use:n }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Deprecated \pkg{l3token} functions}
%
% \begin{macro}[EXP]{\char_to_utfviii_bytes:n}
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index f8a9faef6..b8dee6d13 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -559,10 +559,10 @@
% |a~{bc}| is $6$.
% \end{function}
%
-% \begin{function}[updated = 2012-01-08, EXP]
-% {\tl_reverse:n, \tl_reverse:V, \tl_reverse:o}
+% \begin{function}[added = 2023-05-22, EXP]
+% {\tl_reverse_use:n, \tl_reverse_use:V, \tl_reverse_use:o}
% \begin{syntax}
-% \cs{tl_reverse:n} \Arg{token list}
+% \cs{tl_reverse_use:n} \Arg{token list}
% \end{syntax}
% Reverses the order of the \meta{items} in the \meta{token list},
% so that \meta{item_1}\meta{item_2}\meta{item_3} \ldots \meta{item_n}
@@ -609,7 +609,7 @@
% reversing the order of tokens, and keep the outer set of braces.
% Items which are initially not braced are copied with braces in
% the result. In cases where preserving spaces is important,
-% consider the slower function \cs{tl_reverse:n}.
+% consider the slower function \cs{tl_reverse_use:n}.
% \begin{texnote}
% The result is returned within \tn{unexpanded}, which means that the token
% list does not expand further when appearing in an \texttt{x}-type
@@ -3313,7 +3313,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[EXP]{\tl_reverse:n, \tl_reverse:o, \tl_reverse:V}
+% \begin{macro}[EXP]{\tl_reverse_use:n, \tl_reverse_use:o, \tl_reverse_use:V}
% \begin{macro}[EXP]{\@@_reverse_normal:nN}
% \begin{macro}[EXP]{\@@_reverse_group_preserve:nn}
% \begin{macro}[EXP]{\@@_reverse_space:n}
@@ -3323,7 +3323,7 @@
% output. Grouped tokens are output to the left but without any reversal
% within the group.
% \begin{macrocode}
-\cs_new:Npn \tl_reverse:n #1
+\cs_new:Npn \tl_reverse_use:n #1
{
\__kernel_exp_not:w \exp_after:wN
{
@@ -3335,7 +3335,7 @@
{#1}
}
}
-\cs_generate_variant:Nn \tl_reverse:n { o , V }
+\cs_generate_variant:Nn \tl_reverse_use:n { o , V }
\cs_new:Npn \@@_reverse_normal:N
{ \@@_act_reverse_output:n }
\cs_new:Npn \@@_reverse_group_preserve:n #1
@@ -3353,9 +3353,9 @@
% which stops the \texttt{f}-expansion.
% \begin{macrocode}
\cs_new_protected:Npn \tl_reverse:N #1
- { \__kernel_tl_set:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } }
+ { \__kernel_tl_set:Nx #1 { \exp_args:No \tl_reverse_use:n { #1 } } }
\cs_new_protected:Npn \tl_greverse:N #1
- { \__kernel_tl_gset:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } }
+ { \__kernel_tl_gset:Nx #1 { \exp_args:No \tl_reverse_use:n { #1 } } }
\cs_generate_variant:Nn \tl_reverse:N { c }
\cs_generate_variant:Nn \tl_greverse:N { c }
% \end{macrocode}
diff --git a/l3kernel/testfiles/m3tl-build001.lvt b/l3kernel/testfiles/m3tl-build001.lvt
index 8634fcdbd..79b313b79 100644
--- a/l3kernel/testfiles/m3tl-build001.lvt
+++ b/l3kernel/testfiles/m3tl-build001.lvt
@@ -1,5 +1,5 @@
%
-% Copyright (C) 2012,2017,2018,2021 The LaTeX Project
+% Copyright (C) 2012,2017,2018,2021,2023 The LaTeX Project
%
\documentclass{minimal}
@@ -34,7 +34,7 @@
{
\tl_build_gput_right:Nn \g_tmpb_tl { #1 : }
\tl_build_gput_left:Nn \g_tmpb_tl { #1 ~ }
- \tl_build_gput_right:Nx \g_tmpb_tl { \tl_reverse:n {#1} ~ }
+ \tl_build_gput_right:Nx \g_tmpb_tl { \tl_reverse_use:n {#1} ~ }
}
\tl_build_gend:N \g_tmpb_tl
\group_end:
diff --git a/l3kernel/testfiles/m3tl007.lvt b/l3kernel/testfiles/m3tl007.lvt
index 4b98c701e..5eac8902a 100644
--- a/l3kernel/testfiles/m3tl007.lvt
+++ b/l3kernel/testfiles/m3tl007.lvt
@@ -1,5 +1,5 @@
%
-% Copyright (C) 2011,2012,2015,2018-2021 The LaTeX Project
+% Copyright (C) 2011,2012,2015,2018-2021,2023 The LaTeX Project
%
\documentclass{minimal}
\input{regression-test}
@@ -23,20 +23,20 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\TEST{tl_reverse}{
- \test:n { \tl_reverse:n { } }
- \test:n { \tl_reverse:n {a\bc} }
- \test:n { \tl_reverse:n {a~\bc} }
+\TEST{tl_reverse_use}{
+ \test:n { \tl_reverse_use:n { } }
+ \test:n { \tl_reverse_use:n {a\bc} }
+ \test:n { \tl_reverse_use:n {a~\bc} }
\use:x
{
\test:n
{
- \exp_not:N \tl_reverse:n
+ \exp_not:N \tl_reverse_use:n
{ a ~ \use:n {~} \exp_not:N \b \c_space_tl }
}
}
- \test:n { \tl_reverse:n { { } } }
- \test:n { \tl_reverse:n { a ~ { \b { { } c } D # & \if_false: } } }
+ \test:n { \tl_reverse_use:n { { } } }
+ \test:n { \tl_reverse_use:n { a ~ { \b { { } c } D # & \if_false: } } }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/l3kernel/testfiles/m3tl007.tlg b/l3kernel/testfiles/m3tl007.tlg
index 9f1fcd5e3..a92abc915 100644
--- a/l3kernel/testfiles/m3tl007.tlg
+++ b/l3kernel/testfiles/m3tl007.tlg
@@ -2,7 +2,7 @@ This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
Author: Bruno Le Floch
============================================================
-TEST 1: tl_reverse
+TEST 1: tl_reverse_use
============================================================
||
|\bc a|
diff --git a/l3kernel/testfiles/m3tl009.lvt b/l3kernel/testfiles/m3tl009.lvt
index 98cffaf4a..571a68017 100644
--- a/l3kernel/testfiles/m3tl009.lvt
+++ b/l3kernel/testfiles/m3tl009.lvt
@@ -1,5 +1,5 @@
%
-% Copyright (C) 2011-2016,2018-2021 The LaTeX Project
+% Copyright (C) 2011-2016,2018-2021,2023 The LaTeX Project
%
\documentclass{minimal}
\input{regression-test}
@@ -203,7 +203,7 @@
\tl_log:N \l_A_tl
\tl_log:n { & \tex_cr:D }
\tex_cr:D
- \TYPE{1} \tl_reverse:n { \tex_cr:D & }
+ \TYPE{1} \tl_reverse_use:n { \tex_cr:D & }
}
}
}
diff --git a/l3kernel/testfiles/m3tlist002.lvt b/l3kernel/testfiles/m3tlist002.lvt
index d8e600eaf..5cef6df3d 100644
--- a/l3kernel/testfiles/m3tlist002.lvt
+++ b/l3kernel/testfiles/m3tlist002.lvt
@@ -1,5 +1,5 @@
%
-% Copyright (C) 2009-2014,2016-2019,2021 The LaTeX Project
+% Copyright (C) 2009-2014,2016-2019,2021,2023 The LaTeX Project
%
\documentclass{minimal}
\input{regression-test}
@@ -127,8 +127,8 @@
\tl_set:Nn \l_tmpa_tl { abc~{abc}~abc }
\TESTEXP{Reversing~(TLIST)}{
- \tl_reverse:n { abc~{abc}~abc } \NEWLINE
- \tl_reverse:o { \l_tmpa_tl }
+ \tl_reverse_use:n { abc~{abc}~abc } \NEWLINE
+ \tl_reverse_use:o { \l_tmpa_tl }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
More information about the latex3-commits
mailing list.