[latex3-commits] [git/LaTeX3-latex3-latex3] peek-regex: Rename \peek_regex_remove:nTF to \peek_regex_remove_once:nTF (9d44aa7aa)

Bruno Le Floch blflatex at gmail.com
Thu Jul 23 03:27:02 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : peek-regex
Link       : https://github.com/latex3/latex3/commit/9d44aa7aa0558b07c929f1daaef5774017fd2b48

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

commit 9d44aa7aa0558b07c929f1daaef5774017fd2b48
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Thu Jul 23 03:26:34 2020 +0200

    Rename \peek_regex_remove:nTF to \peek_regex_remove_once:nTF


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

9d44aa7aa0558b07c929f1daaef5774017fd2b48
 l3kernel/CHANGELOG.md             |  2 +-
 l3kernel/l3regex.dtx              | 24 ++++++++++++------------
 l3kernel/l3token.dtx              |  8 ++++----
 l3kernel/testfiles/m3regex011.lvt | 22 +++++++++++-----------
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index f0014f740..dac9cc3be 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -9,7 +9,7 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Added
 - `\peek_analysis_map_inline:n`
-- `\peek_regex:nTF`, `\peek_regex_remove:nTF`, and
+- `\peek_regex:nTF`, `\peek_regex_remove_once:nTF`, and
   `\peek_regex_replace_once:nnTF`
 
 ## [2020-07-17]
diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 1beedde31..fdb722955 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -6386,7 +6386,7 @@
 % \end{variable}
 %
 % \begin{macro}[TF]
-%   {\peek_regex:n, \peek_regex:N, \peek_regex_remove:n, \peek_regex_remove:N}
+%   {\peek_regex:n, \peek_regex:N, \peek_regex_remove_once:n, \peek_regex_remove_once:N}
 %   The |T| and |F| functions just call the corresponding |TF| function.
 %   The four |TF| functions differ along two axes: whether to remove the
 %   token or not, distinguished by using \cs{@@_peek_end:} or
@@ -6417,26 +6417,26 @@
 \cs_new_protected:Npn \peek_regex:NT #1#2
   { \peek_regex:NTF #1 {#2} { } }
 \cs_new_protected:Npn \peek_regex:NF #1 { \peek_regex:NTF {#1} { } }
-\cs_new_protected:Npn \peek_regex_remove:nTF #1
+\cs_new_protected:Npn \peek_regex_remove_once:nTF #1
   {
     \@@_peek:nnTF
       { \@@_build_aux:Nn \c_false_bool {#1} }
       { \@@_peek_remove_end:n {##1} }
   }
-\cs_new_protected:Npn \peek_regex_remove:nT #1#2
-  { \peek_regex_remove:nTF {#1} {#2} { } }
-\cs_new_protected:Npn \peek_regex_remove:nF #1
-  { \peek_regex_remove:nTF {#1} { } }
-\cs_new_protected:Npn \peek_regex_remove:NTF #1
+\cs_new_protected:Npn \peek_regex_remove_once:nT #1#2
+  { \peek_regex_remove_once:nTF {#1} {#2} { } }
+\cs_new_protected:Npn \peek_regex_remove_once:nF #1
+  { \peek_regex_remove_once:nTF {#1} { } }
+\cs_new_protected:Npn \peek_regex_remove_once:NTF #1
   {
     \@@_peek:nnTF
       { \@@_build_aux:NN \c_false_bool #1 }
       { \@@_peek_remove_end:n {##1} }
   }
-\cs_new_protected:Npn \peek_regex_remove:NT #1#2
-  { \peek_regex_remove:NTF #1 {#2} { } }
-\cs_new_protected:Npn \peek_regex_remove:NF #1
-  { \peek_regex_remove:NTF #1 { } }
+\cs_new_protected:Npn \peek_regex_remove_once:NT #1#2
+  { \peek_regex_remove_once:NTF #1 {#2} { } }
+\cs_new_protected:Npn \peek_regex_remove_once:NF #1
+  { \peek_regex_remove_once:NTF #1 { } }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -6490,7 +6490,7 @@
 %   last token seen (or rather tokens that \texttt{o}-expand and
 %   \texttt{x}-expand to it).  For \cs{peek_regex:nTF} we reinsert
 %   tokens seen by calling \cs{@@_peek_reinsert:N} regardless of the
-%   result of the match.  For \cs{peek_regex_remove:nTF} we reinsert the
+%   result of the match.  For \cs{peek_regex_remove_once:nTF} we reinsert the
 %   tokens seen only if the match failed; otherwise we just reinsert the
 %   tokens~|#1|, with one expansion.
 %    \begin{macrocode}
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index e697de0f5..fb06706a0 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -1047,9 +1047,9 @@
 % \end{function}
 %
 % \begin{function}[added = 2020-07-20, TF]
-%   {\peek_regex_remove:n, \peek_regex_remove:N}
+%   {\peek_regex_remove_once:n, \peek_regex_remove_once:N}
 %   \begin{syntax}
-%     \cs{peek_regex_remove:nTF} \Arg{regex} \Arg{true code} \Arg{false code}
+%     \cs{peek_regex_remove_once:nTF} \Arg{regex} \Arg{true code} \Arg{false code}
 %   \end{syntax}
 %   Tests if the \meta{tokens} that follow in the input stream match the
 %   \meta{regex}.  If the test is true, the \meta{tokens} are removed
@@ -1059,11 +1059,11 @@
 %   See \pkg{l3regex} for documentation of the syntax of
 %   regular expressions.  The \meta{regular expression} is implicitly
 %   anchored at the start, so for instance
-%   \cs{peek_regex_remove:nTF}~|{|~|a|~|}| is essentially equivalent to
+%   \cs{peek_regex_remove_once:nTF}~|{|~|a|~|}| is essentially equivalent to
 %   \cs{peek_charcode_remove:NTF}~|a|.
 %   \begin{texnote}
 %     Implicit character tokens are correctly considered by
-%     \cs{peek_regex_remove:nTF} as control sequences, while functions
+%     \cs{peek_regex_remove_once:nTF} as control sequences, while functions
 %     that inspect individual tokens (for instance
 %     \cs{peek_charcode:NTF}) only take into account their meaning.
 %   \end{texnote}
diff --git a/l3kernel/testfiles/m3regex011.lvt b/l3kernel/testfiles/m3regex011.lvt
index a2837f0ed..08bbd2ac9 100644
--- a/l3kernel/testfiles/m3regex011.lvt
+++ b/l3kernel/testfiles/m3regex011.lvt
@@ -48,14 +48,14 @@
     \peek_regex:nF { \c[^C] . (. a()) } { \FALSE \test:w } \test:w { a b } c \s_stop
     \peek_regex:nTF { a \{ \b c } { \ERROR \test:w } { \FALSE \test:w } a { b } \s_stop
     \SEPARATOR
-    \peek_regex_remove:nTF { } { \TRUE \test:w } { \ERROR \test:w } \aaa \s_stop
-    \peek_regex_remove:nT { a } { \TRUE \test:w } a \s_stop
-    \peek_regex_remove:nF { . (. a()) } { \ERROR \test:w } \test:w { a b \s_stop \test_show:w } \s_stop
-    \peek_regex_remove:nTF { a \{ } { \TRUE \test:w } { \ERROR \test:w } a { b \s_stop \test_show:w } \s_stop
-    \peek_regex_remove:nTF { \cL. } { \ERROR \test:w } { \FALSE \test:w } \aaa \s_stop
-    \peek_regex_remove:nT { b } { \ERROR \test:w } \test:w a \s_stop
-    \peek_regex_remove:nF { \c[^C] . (. a()) } { \FALSE \test:w } \test:w { a b } c \s_stop
-    \peek_regex_remove:nTF { a \{ \b c } { \ERROR \test:w } { \FALSE \test:w } a { b } \s_stop
+    \peek_regex_remove_once:nTF { } { \TRUE \test:w } { \ERROR \test:w } \aaa \s_stop
+    \peek_regex_remove_once:nT { a } { \TRUE \test:w } a \s_stop
+    \peek_regex_remove_once:nF { . (. a()) } { \ERROR \test:w } \test:w { a b \s_stop \test_show:w } \s_stop
+    \peek_regex_remove_once:nTF { a \{ } { \TRUE \test:w } { \ERROR \test:w } a { b \s_stop \test_show:w } \s_stop
+    \peek_regex_remove_once:nTF { \cL. } { \ERROR \test:w } { \FALSE \test:w } \aaa \s_stop
+    \peek_regex_remove_once:nT { b } { \ERROR \test:w } \test:w a \s_stop
+    \peek_regex_remove_once:nF { \c[^C] . (. a()) } { \FALSE \test:w } \test:w { a b } c \s_stop
+    \peek_regex_remove_once:nTF { a \{ \b c } { \ERROR \test:w } { \FALSE \test:w } a { b } \s_stop
   }
 
 \TEST { Peek~regex~compiled }
@@ -64,9 +64,9 @@
     \peek_regex:NTF \l_tmpa_regex { \TRUE \test:w } { \ERROR \test:w } a \s_stop
     \peek_regex:NT \l_tmpa_regex { \TRUE \test:w } a \s_stop
     \peek_regex:NF \l_tmpa_regex { \ERROR \test:w } \test:w a \s_stop
-    \peek_regex_remove:NTF \l_tmpa_regex { \TRUE \test:w } { \ERROR \test:w } a \s_stop
-    \peek_regex_remove:NT \l_tmpa_regex { \TRUE \test:w } a \s_stop
-    \peek_regex_remove:NF \l_tmpa_regex { \ERROR \test:w } \test:w a \s_stop
+    \peek_regex_remove_once:NTF \l_tmpa_regex { \TRUE \test:w } { \ERROR \test:w } a \s_stop
+    \peek_regex_remove_once:NT \l_tmpa_regex { \TRUE \test:w } a \s_stop
+    \peek_regex_remove_once:NF \l_tmpa_regex { \ERROR \test:w } \test:w a \s_stop
   }
 
 \TEST { Peek~regex~replace }





More information about the latex3-commits mailing list.