[latex3-commits] [git/LaTeX3-latex3-latex3] peek-refactor: Deprecate \peek_..._ignore_spaces:N(TF) functions (7a6ca199b)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Jan 10 09:02:30 CET 2022
Repository : https://github.com/latex3/latex3
On branch : peek-refactor
Link : https://github.com/latex3/latex3/commit/7a6ca199bca82b32300676d12848fb7ae3a01a30
>---------------------------------------------------------------
commit 7a6ca199bca82b32300676d12848fb7ae3a01a30
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sun Jan 9 12:19:03 2022 +0000
Deprecate \peek_..._ignore_spaces:N(TF) functions
>---------------------------------------------------------------
7a6ca199bca82b32300676d12848fb7ae3a01a30
l3kernel/CHANGELOG.md | 3 +
l3kernel/doc/l3obsolete.txt | 64 ++++++++------
l3kernel/l3token.dtx | 156 ++++++++-------------------------
l3kernel/testfiles/m3peek001.lvt | 24 -----
l3kernel/testfiles/m3peek001.ptex.tlg | 48 ----------
l3kernel/testfiles/m3peek001.tlg | 48 ----------
l3kernel/testfiles/m3peek001.uptex.tlg | 48 ----------
7 files changed, 73 insertions(+), 318 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 872578c35..1b8fce174 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -10,6 +10,9 @@ this project uses date-based 'snapshot' version identifiers.
### Changed
- Move some color functions from `l3backend`
+### Deprecated
+- `\peek_..._ignore_spaces:N(TF)` functions
+
### Removed
- Lua functions in `l3kernel` table
diff --git a/l3kernel/doc/l3obsolete.txt b/l3kernel/doc/l3obsolete.txt
index 9eca5a5ec..885167185 100644
--- a/l3kernel/doc/l3obsolete.txt
+++ b/l3kernel/doc/l3obsolete.txt
@@ -12,35 +12,41 @@ Deprecated functions and variables
These functions are deprecated and should be removed from packages.
They will be removed from the sources at the end of the given year.
---------------------------------------
-Function Expires end
---------------------------------------
-\char_fold_case:N 2022
-\char_lower_case:N 2022
-\char_mixed_case:N 2022
-\char_upper_case:N 2022
-\char_str_fold_case:N 2022
-\char_str_lower_case:N 2022
-\char_str_mixed_case:N 2022
-\char_str_upper_case:N 2022
-\l_keys_key_tl 2022
-\l_keys_path_tl 2022
-\str_declare_eight_bit_encoding:nnn 2022
-\str_fold_case:n 2022
-\str_fold_case:V 2022
-\str_lower_case:f 2022
-\str_lower_case:n 2022
-\str_upper_case:f 2022
-\str_upper_case:n 2022
-\seq_indexed_map_inline:Nn 2023
-\seq_indexed_map_function:NN 2023
-\tl_lower_case:n 2022
-\tl_lower_case:nn 2022
-\tl_mixed_case:n 2022
-\tl_mixed_case:nn 2022
-\tl_upper_case:n 2022
-\tl_upper_case:nn 2022
---------------------------------------
+---------------------------------------------
+Function Expires end
+---------------------------------------------
+\char_fold_case:N 2022
+\char_lower_case:N 2022
+\char_mixed_case:N 2022
+\char_upper_case:N 2022
+\char_str_fold_case:N 2022
+\char_str_lower_case:N 2022
+\char_str_mixed_case:N 2022
+\char_str_upper_case:N 2022
+\l_keys_key_tl 2022
+\l_keys_path_tl 2022
+\peek_catcode_ignore_spaces:N 2023
+\peek_catcode_remove_ignore_spaces:N 2023
+\peek_charcode_ignore_spaces:N 2023
+\peek_charcode_remove_ignore_spaces:N 2023
+\peek_meaning_ignore_spaces:N 2023
+\peek_meaning_remove_ignore_spaces:N 2023
+\str_declare_eight_bit_encoding:nnn 2022
+\str_fold_case:n 2022
+\str_fold_case:V 2022
+\str_lower_case:f 2022
+\str_lower_case:n 2022
+\str_upper_case:f 2022
+\str_upper_case:n 2022
+\seq_indexed_map_inline:Nn 2023
+\seq_indexed_map_function:NN 2023
+\tl_lower_case:n 2022
+\tl_lower_case:nn 2022
+\tl_mixed_case:n 2022
+\tl_mixed_case:nn 2022
+\tl_upper_case:n 2022
+\tl_upper_case:nn 2022
+------------------------------------------
Removed functions and variables
===============================
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index 7a3073674..fa4db072c 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -841,19 +841,6 @@
% result of the test).
% \end{function}
%
-% \begin{function}[updated = 2012-12-20, TF]{\peek_catcode_ignore_spaces:N}
-% \begin{syntax}
-% \cs{peek_catcode_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the next non-space \meta{token} in the input stream has the
-% same category code as the \meta{test token} (as defined by the test
-% \cs{token_if_eq_catcode:NNTF}). Explicit and implicit space tokens
-% (with character code 32 and category code 10) are ignored and
-% removed by the test and the \meta{token} is left in the input
-% stream after the \meta{true code} or \meta{false code} (as
-% appropriate to the result of the test).
-% \end{function}
-%
% \begin{function}[updated = 2012-12-20, TF]{\peek_catcode_remove:N}
% \begin{syntax}
% \cs{peek_catcode_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code}
@@ -867,21 +854,6 @@
% appropriate to the result of the test).
% \end{function}
%
-% \begin{function}[updated = 2012-12-20, TF]
-% {\peek_catcode_remove_ignore_spaces:N}
-% \begin{syntax}
-% \cs{peek_catcode_remove_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the next non-space \meta{token} in the input stream has the
-% same category code as the \meta{test token} (as defined by the test
-% \cs{token_if_eq_catcode:NNTF}). Explicit and implicit space tokens
-% (with character code 32 and category code 10) are ignored and
-% removed by the test and the \meta{token} is removed from the
-% input stream if the test is true. The function then places
-% either the \meta{true code} or \meta{false code} in the input stream
-% (as appropriate to the result of the test).
-% \end{function}
-%
% \begin{function}[updated = 2012-12-20, TF]{\peek_charcode:N}
% \begin{syntax}
% \cs{peek_charcode:NTF} \meta{test token} \Arg{true code} \Arg{false code}
@@ -894,19 +866,6 @@
% result of the test).
% \end{function}
%
-% \begin{function}[updated = 2012-12-20, TF]{\peek_charcode_ignore_spaces:N}
-% \begin{syntax}
-% \cs{peek_charcode_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the next non-space \meta{token} in the input stream has the
-% same character code as the \meta{test token} (as defined by the test
-% \cs{token_if_eq_charcode:NNTF}). Explicit and implicit space tokens
-% (with character code 32 and category code 10) are ignored and removed by
-% the test and the \meta{token} is left in the input stream after
-% the \meta{true code} or \meta{false code} (as appropriate to the
-% result of the test).
-% \end{function}
-%
% \begin{function}[updated = 2012-12-20, TF]{\peek_charcode_remove:N}
% \begin{syntax}
% \cs{peek_charcode_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code}
@@ -920,22 +879,6 @@
% appropriate to the result of the test).
% \end{function}
%
-% \begin{function}[updated = 2012-12-20, TF]
-% {\peek_charcode_remove_ignore_spaces:N}
-% \begin{syntax}
-% \cs{peek_charcode_remove_ignore_spaces:NTF} \meta{test token}
-% ~~\Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the next non-space \meta{token} in the input stream has the
-% same character code as the \meta{test token} (as defined by the test
-% \cs{token_if_eq_charcode:NNTF}). Explicit and implicit space tokens
-% (with character code 32 and category code 10) are ignored and
-% removed by the test and the \meta{token} is removed from the
-% input stream if the test is true. The function then places
-% either the \meta{true code} or \meta{false code} in the input stream
-% (as appropriate to the result of the test).
-% \end{function}
-%
% \begin{function}[updated = 2011-07-02, TF]{\peek_meaning:N}
% \begin{syntax}
% \cs{peek_meaning:NTF} \meta{test token} \Arg{true code} \Arg{false code}
@@ -948,19 +891,6 @@
% result of the test).
% \end{function}
%
-% \begin{function}[updated = 2012-12-05, TF]{\peek_meaning_ignore_spaces:N}
-% \begin{syntax}
-% \cs{peek_meaning_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the next non-space \meta{token} in the input stream has the
-% same meaning as the \meta{test token} (as defined by the test
-% \cs{token_if_eq_meaning:NNTF}). Explicit and implicit space tokens
-% (with character code 32 and category code 10) are ignored and
-% removed by the test and the \meta{token} is left in the input
-% stream after the \meta{true code} or \meta{false code} (as
-% appropriate to the result of the test).
-% \end{function}
-%
% \begin{function}[updated = 2011-07-02, TF]{\peek_meaning_remove:N}
% \begin{syntax}
% \cs{peek_meaning_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code}
@@ -974,22 +904,6 @@
% appropriate to the result of the test).
% \end{function}
%
-% \begin{function}[updated = 2012-12-05, TF]
-% {\peek_meaning_remove_ignore_spaces:N}
-% \begin{syntax}
-% \cs{peek_meaning_remove_ignore_spaces:NTF} \meta{test token}
-% ~~\Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the next non-space \meta{token} in the input stream has the
-% same meaning as the \meta{test token} (as defined by the test
-% \cs{token_if_eq_meaning:NNTF}). Explicit and implicit space tokens
-% (with character code 32 and category code 10) are ignored and
-% removed by the test and the \meta{token} is removed from the
-% input stream if the test is true. The function then places
-% either the \meta{true code} or \meta{false code} in the input stream
-% (as appropriate to the result of the test).
-% \end{function}
-%
% \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:}
% \begin{syntax}
% \cs{peek_N_type:TF} \Arg{true code} \Arg{false code}
@@ -3080,41 +2994,6 @@ end
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[TF]
-% {
-% \peek_catcode_ignore_spaces:N, \peek_catcode_remove_ignore_spaces:N,
-% \peek_charcode_ignore_spaces:N, \peek_charcode_remove_ignore_spaces:N,
-% \peek_meaning_ignore_spaces:N, \peek_meaning_remove_ignore_spaces:N
-% }
-% To ignore spaces, remove them using \cs{peek_remove_spaces:n}
-% before running the tests.
-% \begin{macrocode}
-\tl_map_inline:nn
- {
- { catcode } { catcode_remove }
- { charcode } { charcode_remove }
- { meaning } { meaning_remove }
- }
- {
- \cs_new_protected:cpx { peek_#1_ignore_spaces:NTF } ##1##2##3
- {
- \peek_remove_spaces:n
- { \exp_not:c { peek_#1:NTF } ##1 {##2} {##3} }
- }
- \cs_new_protected:cpx { peek_#1_ignore_spaces:NT } ##1##2
- {
- \peek_remove_spaces:n
- { \exp_not:c { peek_#1:NT } ##1 {##2} }
- }
- \cs_new_protected:cpx { peek_#1_ignore_spaces:NF } ##1##2
- {
- \peek_remove_spaces:n
- { \exp_not:c { peek_#1:NF } ##1 {##2} }
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}[TF]{\peek_N_type:}
% \begin{macro}
% {\@@_execute_branches_N_type:, \@@_N_type:w, \@@_N_type_aux:nnw}
@@ -3186,6 +3065,41 @@ end
% \end{macro}
% \end{macro}
%
+% \subsection{Deprecated functions}
+%
+% \begin{macro}[deprecated = 2023-12-31, TF]
+% {
+% \peek_catcode_ignore_spaces:N, \peek_catcode_remove_ignore_spaces:N,
+% \peek_charcode_ignore_spaces:N, \peek_charcode_remove_ignore_spaces:N,
+% \peek_meaning_ignore_spaces:N, \peek_meaning_remove_ignore_spaces:N
+% }
+% \begin{macrocode}
+\tl_map_inline:nn
+ {
+ { catcode } { catcode_remove }
+ { charcode } { charcode_remove }
+ { meaning } { meaning_remove }
+ }
+ {
+ \cs_new_protected:cpx { peek_#1_ignore_spaces:NTF } ##1##2##3
+ {
+ \peek_remove_spaces:n
+ { \exp_not:c { peek_#1:NTF } ##1 {##2} {##3} }
+ }
+ \cs_new_protected:cpx { peek_#1_ignore_spaces:NT } ##1##2
+ {
+ \peek_remove_spaces:n
+ { \exp_not:c { peek_#1:NT } ##1 {##2} }
+ }
+ \cs_new_protected:cpx { peek_#1_ignore_spaces:NF } ##1##2
+ {
+ \peek_remove_spaces:n
+ { \exp_not:c { peek_#1:NF } ##1 {##2} }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</tex>
% \end{macrocode}
diff --git a/l3kernel/testfiles/m3peek001.lvt b/l3kernel/testfiles/m3peek001.lvt
index d86c76721..e275df6d8 100644
--- a/l3kernel/testfiles/m3peek001.lvt
+++ b/l3kernel/testfiles/m3peek001.lvt
@@ -37,19 +37,11 @@
\peek_meaning:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
\peek_meaning_remove:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE } ! {-}
\peek_meaning_remove:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
- \peek_meaning_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE } ! {-}
- \peek_meaning_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
- \peek_meaning_remove_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE } ! {-}
- \peek_meaning_remove_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
\SEPARATOR
\peek_meaning:NT ! { \TRUE \TYPE } ! {-}
\peek_meaning:NF ! { \FALSE \TYPE }~! {-}
\peek_meaning_remove:NT ! { \TRUE \TYPE } ! {-}
\peek_meaning_remove:NF ! { \FALSE \TYPE }~! {-}
- \peek_meaning_ignore_spaces:NT ! { \TRUE \TYPE } ! {-}
- \peek_meaning_ignore_spaces:NT ! { \TRUE \TYPE }~! {-}
- \peek_meaning_remove_ignore_spaces:NT ! { \TRUE \TYPE } ! {-}
- \peek_meaning_remove_ignore_spaces:NT ! { \TRUE \TYPE }~! {-}
}
\group_begin:
@@ -71,19 +63,11 @@
\exp_after:wN \peek_charcode:NTF \active_bang { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
\exp_after:wN \peek_charcode_remove:NTF \active_bang { \TRUE\TYPE }{ \FALSE\TYPE } ! {-}
\exp_after:wN \peek_charcode_remove:NTF \active_bang { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
- \exp_after:wN \peek_charcode_ignore_spaces:NTF \active_bang { \TRUE\TYPE }{ \FALSE\TYPE } ! {-}
- \exp_after:wN \peek_charcode_ignore_spaces:NTF \active_bang { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
- \exp_after:wN \peek_charcode_remove_ignore_spaces:NTF \active_bang { \TRUE\TYPE }{ \FALSE\TYPE } ! {-}
- \exp_after:wN \peek_charcode_remove_ignore_spaces:NTF \active_bang { \TRUE\TYPE }{ \FALSE\TYPE }~! {-}
\SEPARATOR
\exp_after:wN \peek_charcode:NT \active_bang { \TRUE \TYPE } ! {-}
\exp_after:wN \peek_charcode:NF \active_bang { \FALSE \TYPE }~! {-}
\exp_after:wN \peek_charcode_remove:NT \active_bang { \TRUE \TYPE } ! {-}
\exp_after:wN \peek_charcode_remove:NF \active_bang { \FALSE \TYPE }~! {-}
- \exp_after:wN \peek_charcode_ignore_spaces:NT \active_bang { \TRUE \TYPE } ! {-}
- \exp_after:wN \peek_charcode_ignore_spaces:NT \active_bang { \TRUE \TYPE }~! {-}
- \exp_after:wN \peek_charcode_remove_ignore_spaces:NT \active_bang { \TRUE \TYPE } ! {-}
- \exp_after:wN \peek_charcode_remove_ignore_spaces:NT \active_bang { \TRUE \TYPE }~! {-}
}
\TEST{peek_charcode~again}{
@@ -99,19 +83,11 @@
\peek_catcode:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~? {-}
\peek_catcode_remove:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE } ? {-}
\peek_catcode_remove:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~? {-}
- \peek_catcode_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE } ? {-}
- \peek_catcode_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~? {-}
- \peek_catcode_remove_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE } ? {-}
- \peek_catcode_remove_ignore_spaces:NTF ! { \TRUE\TYPE }{ \FALSE\TYPE }~? {-}
\SEPARATOR
\peek_catcode:NT ! { \TRUE \TYPE } ? {-}
\peek_catcode:NF ! { \FALSE \TYPE }~? {-}
\peek_catcode_remove:NT ! { \TRUE \TYPE } ? {-}
\peek_catcode_remove:NF ! { \FALSE \TYPE }~? {-}
- \peek_catcode_ignore_spaces:NT ! { \TRUE \TYPE } ? {-}
- \peek_catcode_ignore_spaces:NT ! { \TRUE \TYPE }~? {-}
- \peek_catcode_remove_ignore_spaces:NT ! { \TRUE \TYPE } ? {-}
- \peek_catcode_remove_ignore_spaces:NT ! { \TRUE \TYPE }~? {-}
}
\TEST{peek_catcode~again}{
diff --git a/l3kernel/testfiles/m3peek001.ptex.tlg b/l3kernel/testfiles/m3peek001.ptex.tlg
index 49b9f48b8..061ffe46f 100644
--- a/l3kernel/testfiles/m3peek001.ptex.tlg
+++ b/l3kernel/testfiles/m3peek001.ptex.tlg
@@ -20,14 +20,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
TRUE
!
@@ -37,14 +29,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 3: peek_meaning again
@@ -67,14 +51,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
TRUE
!
@@ -84,14 +60,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 5: peek_charcode again
@@ -114,14 +82,6 @@ TRUE
-
FALSE
?
-TRUE
-?
-TRUE
-?
-TRUE
--
-TRUE
--
============================================================
TRUE
?
@@ -131,14 +91,6 @@ TRUE
-
FALSE
?
-TRUE
-?
-TRUE
-?
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 7: peek_catcode again
diff --git a/l3kernel/testfiles/m3peek001.tlg b/l3kernel/testfiles/m3peek001.tlg
index 49b9f48b8..061ffe46f 100644
--- a/l3kernel/testfiles/m3peek001.tlg
+++ b/l3kernel/testfiles/m3peek001.tlg
@@ -20,14 +20,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
TRUE
!
@@ -37,14 +29,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 3: peek_meaning again
@@ -67,14 +51,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
TRUE
!
@@ -84,14 +60,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 5: peek_charcode again
@@ -114,14 +82,6 @@ TRUE
-
FALSE
?
-TRUE
-?
-TRUE
-?
-TRUE
--
-TRUE
--
============================================================
TRUE
?
@@ -131,14 +91,6 @@ TRUE
-
FALSE
?
-TRUE
-?
-TRUE
-?
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 7: peek_catcode again
diff --git a/l3kernel/testfiles/m3peek001.uptex.tlg b/l3kernel/testfiles/m3peek001.uptex.tlg
index 49b9f48b8..061ffe46f 100644
--- a/l3kernel/testfiles/m3peek001.uptex.tlg
+++ b/l3kernel/testfiles/m3peek001.uptex.tlg
@@ -20,14 +20,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
TRUE
!
@@ -37,14 +29,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 3: peek_meaning again
@@ -67,14 +51,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
TRUE
!
@@ -84,14 +60,6 @@ TRUE
-
FALSE
!
-TRUE
-!
-TRUE
-!
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 5: peek_charcode again
@@ -114,14 +82,6 @@ TRUE
-
FALSE
?
-TRUE
-?
-TRUE
-?
-TRUE
--
-TRUE
--
============================================================
TRUE
?
@@ -131,14 +91,6 @@ TRUE
-
FALSE
?
-TRUE
-?
-TRUE
-?
-TRUE
--
-TRUE
--
============================================================
============================================================
TEST 7: peek_catcode again
More information about the latex3-commits
mailing list.