[latex3-commits] [latex3/latex3] main: Add `\str_case_e:en(TF)` (e-variant) (761986f9b)

github at latex-project.org github at latex-project.org
Wed Nov 8 10:50:09 CET 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/761986f9b071db35250939f69de55a32069329e2

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

commit 761986f9b071db35250939f69de55a32069329e2
Author: Yukai Chou <muzimuzhi at gmail.com>
Date:   Sat Nov 4 19:11:01 2023 +0800

    Add `\str_case_e:en(TF)` (e-variant)


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

761986f9b071db35250939f69de55a32069329e2
 l3kernel/CHANGELOG.md |  1 +
 l3kernel/l3str.dtx    | 13 ++++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 3477e76d2..9699f5f7a 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Added
 - Documentation for `\c_nan_fp`
+- `\str_case_e:en(TF)`
 
 ### Fixed
 - Normalisation of `.inherit:n` key data (issue \#1314)
diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index 6aca45dae..c91998e3d 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -316,7 +316,8 @@
 %   be used instead.
 % \end{function}
 %
-% \begin{function}[added = 2018-06-19, EXP, noTF]{\str_case_e:nn}
+% \begin{function}[added = 2018-06-19, EXP, noTF]
+%   {\str_case_e:nn, \str_case_e:en}
 %   \begin{syntax}
 %     \cs{str_case_e:nnTF} \Arg{test string} \\
 %     ~~|{| \\
@@ -339,9 +340,9 @@
 %   match then the \meta{false code} is inserted. The function
 %   \cs{str_case_e:nn}, which does nothing if there is no match, is also
 %   available.
-%   The \meta{test string} is expanded in each comparison, and must
-%   always yield the same result: for example, random numbers must
-%   not be used within this string.
+%   In \cs[index=str_case_e:nnTF]{str_case_e:nn(TF)}, the \meta{test string}
+%   is expanded in each comparison, and must always yield the same result:
+%   for example, random numbers must not be used within this string.
 % \end{function}
 %
 % \begin{function}[EXP, pTF, added = 2021-05-17]{\str_compare:nNn, \str_compare:eNe}
@@ -1234,7 +1235,7 @@
 % \begin{macro}[EXP, noTF]
 %   {
 %     \str_case:nn, \str_case:Vn, \str_case:Nn, \str_case:on, \str_case:en, \str_case:nV, \str_case:nv,
-%     \str_case_e:nn
+%     \str_case_e:nn, \str_case_e:en
 %   }
 % \begin{macro}[EXP]{\@@_case:nnTF, \@@_case_e:nnTF}
 % \begin{macro}[EXP]
@@ -1299,6 +1300,8 @@
   }
 \cs_new:Npn \@@_case_e:nnTF #1#2#3#4
   { \@@_case_e:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop }
+\cs_generate_variant:Nn \str_case_e:nn { e }
+\prg_generate_conditional_variant:Nnn \str_case_e:nn { e } { T , F , TF }
 \cs_new:Npn \@@_case_e:nw #1#2#3
   {
     \str_if_eq:eeTF {#1} {#2}





More information about the latex3-commits mailing list.