Skip to content

Commit

Permalink
Expand coverage of variants (see #1257)
Browse files Browse the repository at this point in the history
This is the '5+' set (created at least five times in a sweep of TL).
  • Loading branch information
josephwright committed Aug 23, 2023
1 parent f7088ff commit 6954357
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 88 deletions.
16 changes: 11 additions & 5 deletions l3kernel/l3file.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@
%
% \subsection{Writing to files}
%
% \begin{function}[updated = 2012-06-05]{\iow_now:Nn, \iow_now:Nx, \iow_now:cn, \iow_now:cx}
% \begin{function}[updated = 2012-06-05]
% {\iow_now:Nn, \iow_now:NV, \iow_now:Nx, \iow_now:cn, \iow_now:cV, \iow_now:cx}
% \begin{syntax}
% \cs{iow_now:Nn} \meta{stream} \Arg{tokens}
% \end{syntax}
Expand Down Expand Up @@ -922,7 +923,7 @@
% \end{function}
%
%
% \begin{function}[updated = 2017-06-26]{\file_input:n}
% \begin{function}[updated = 2017-06-26]{\file_input:n, \file_input:V}
% \begin{syntax}
% \cs{file_input:n} \Arg{file name}
% \end{syntax}
Expand Down Expand Up @@ -1798,7 +1799,11 @@
% \end{macro}
% \end{macro}
%
% \begin{macro}{\iow_now:Nn, \iow_now:Nx, \iow_now:cn, \iow_now:cx}
% \begin{macro}
% {
% \iow_now:Nn, \iow_now:NV, \iow_now:Nx,
% \iow_now:cn, \iow_now:cV, \iow_now:cx
% }
% This routine writes the second argument onto the output stream without
% expansion. If this stream isn't open, the output goes to the terminal
% instead. If the first argument is no output stream at all, we get an
Expand All @@ -1816,7 +1821,7 @@
\__kernel_iow_with:Nnn \tex_newlinechar:D { `\^^J }
{ \tex_immediate:D \tex_write:D #1 { \exp_not:n {#2} } }
}
\cs_generate_variant:Nn \iow_now:Nn { c, Nx, cx }
\cs_generate_variant:Nn \iow_now:Nn { NV , Nx , c , cV , cx }
% \end{macrocode}
% \end{macro}
%
Expand Down Expand Up @@ -3360,7 +3365,7 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\file_input:n}
% \begin{macro}{\file_input:n, \file_input:V}
% \begin{macro}{\@@_input:n, \@@_input:V}
% \begin{macro}{\@@_input_push:n, \__kernel_file_input_push:n}
% \begin{macro}{\@@_input_pop:, \__kernel_file_input_pop:}
Expand All @@ -3376,6 +3381,7 @@
{ \@@_input:V \l_@@_full_name_tl }
{ \__kernel_file_missing:n {#1} }
}
\cs_generate_variant:Nn \file_input:n { V }
\cs_new_protected:Npx \@@_input:n #1
{
\exp_not:N \clist_if_exist:NTF \exp_not:N \@filelist
Expand Down
18 changes: 18 additions & 0 deletions l3kernel/l3msg.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@
% \msg_fatal:nnnn ,
% \msg_fatal:nnn ,
% \msg_fatal:nn ,
% \msg_fatal:nnV ,
% \msg_fatal:nnxxxx ,
% \msg_fatal:nnxxx ,
% \msg_fatal:nnxx ,
Expand All @@ -333,6 +334,7 @@
% \msg_critical:nnnn ,
% \msg_critical:nnn ,
% \msg_critical:nn ,
% \msg_critical:nnV ,
% \msg_critical:nnxxxx ,
% \msg_critical:nnxxx ,
% \msg_critical:nnxx ,
Expand Down Expand Up @@ -360,6 +362,7 @@
% \msg_error:nnnn ,
% \msg_error:nnn ,
% \msg_error:nn ,
% \msg_error:nnV ,
% \msg_error:nnxxxx ,
% \msg_error:nnxxx ,
% \msg_error:nnxx ,
Expand All @@ -380,7 +383,9 @@
% \msg_warning:nnnnn ,
% \msg_warning:nnnn ,
% \msg_warning:nnn ,
% \msg_warning:nnn ,
% \msg_warning:nn ,
% \msg_warning:nnV ,
% \msg_warning:nnxxxx ,
% \msg_warning:nnxxx ,
% \msg_warning:nnxx ,
Expand All @@ -402,6 +407,7 @@
% \msg_note:nnnn ,
% \msg_note:nnn ,
% \msg_note:nn ,
% \msg_note:nnV ,
% \msg_note:nnxxxx ,
% \msg_note:nnxxx ,
% \msg_note:nnxx ,
Expand All @@ -411,6 +417,7 @@
% \msg_info:nnnn ,
% \msg_info:nnn ,
% \msg_info:nn ,
% \msg_info:nnV ,
% \msg_info:nnxxxx ,
% \msg_info:nnxxx ,
% \msg_info:nnxx ,
Expand All @@ -435,6 +442,7 @@
% \msg_term:nnnn ,
% \msg_term:nnn ,
% \msg_term:nn ,
% \msg_term:nnV ,
% \msg_term:nnxxxx ,
% \msg_term:nnxxx ,
% \msg_term:nnxx ,
Expand All @@ -444,6 +452,7 @@
% \msg_log:nnnn ,
% \msg_log:nnn ,
% \msg_log:nn ,
% \msg_log:nnV ,
% \msg_log:nnxxxx ,
% \msg_log:nnxxx ,
% \msg_log:nnxx ,
Expand Down Expand Up @@ -1113,6 +1122,7 @@
{ \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } }
\cs_new_protected:cpx { msg_ #1 :nn } ##1##2
{ \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } }
\cs_generate_variant:cn { msg_ #1 :nnn } { nnV }
\cs_new_protected:cpx { msg_ #1 :nnxxxx } ##1##2##3##4##5##6
{
\use:x
Expand All @@ -1139,6 +1149,7 @@
% \msg_fatal:nnnn ,
% \msg_fatal:nnn ,
% \msg_fatal:nn ,
% \msg_fatal:nnV ,
% \msg_fatal:nnxxxx ,
% \msg_fatal:nnxxx ,
% \msg_fatal:nnxx ,
Expand Down Expand Up @@ -1173,6 +1184,7 @@
% \msg_critical:nnnn ,
% \msg_critical:nnn ,
% \msg_critical:nn ,
% \msg_critical:nnV ,
% \msg_critical:nnxxxx ,
% \msg_critical:nnxxx ,
% \msg_critical:nnxx ,
Expand All @@ -1198,6 +1210,7 @@
% \msg_error:nnnn ,
% \msg_error:nnn ,
% \msg_error:nn ,
% \msg_error:nnV ,
% \msg_error:nnxxxx ,
% \msg_error:nnxxx ,
% \msg_error:nnxx ,
Expand Down Expand Up @@ -1229,6 +1242,7 @@
% \msg_warning:nnnn ,
% \msg_warning:nnn ,
% \msg_warning:nn ,
% \msg_warning:nnV ,
% \msg_warning:nnxxxx ,
% \msg_warning:nnxxx ,
% \msg_warning:nnxx ,
Expand All @@ -1238,6 +1252,7 @@
% \msg_note:nnnn ,
% \msg_note:nnn ,
% \msg_note:nn ,
% \msg_note:nnV ,
% \msg_note:nnxxxx ,
% \msg_note:nnxxx ,
% \msg_note:nnxx ,
Expand All @@ -1247,6 +1262,7 @@
% \msg_info:nnnn ,
% \msg_info:nnn ,
% \msg_info:nn ,
% \msg_info:nnV ,
% \msg_info:nnxxxx ,
% \msg_info:nnxxx ,
% \msg_info:nnxx ,
Expand Down Expand Up @@ -1303,6 +1319,7 @@
% \msg_log:nnnn ,
% \msg_log:nnn ,
% \msg_log:nn ,
% \msg_log:nnV ,
% \msg_log:nnxxxx ,
% \msg_log:nnxxx ,
% \msg_log:nnxx ,
Expand All @@ -1312,6 +1329,7 @@
% \msg_term:nnnn ,
% \msg_term:nnn ,
% \msg_term:nn ,
% \msg_term:nnV ,
% \msg_term:nnxxxx ,
% \msg_term:nnxxx ,
% \msg_term:nnxx ,
Expand Down
60 changes: 34 additions & 26 deletions l3kernel/l3prop.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,16 @@
% {
% \prop_put:Nnn, \prop_put:NnV, \prop_put:Nno, \prop_put:Nne, \prop_put:Nnx,
% \prop_put:NVn, \prop_put:NVV, \prop_put:NVx, \prop_put:Nvx,
% \prop_put:Non, \prop_put:Noo, \prop_put:Nxx,
% \prop_put:Non, \prop_put:Nxn, \prop_put:Noo, \prop_put:Nxx,
% \prop_put:cnn, \prop_put:cnV, \prop_put:cno, \prop_put:cne, \prop_put:cnx,
% \prop_put:cVn, \prop_put:cVV, \prop_put:cVx, \prop_put:cvx,
% \prop_put:con, \prop_put:coo, \prop_put:cxx,
% \prop_put:con, \prop_put:cxn, \prop_put:coo, \prop_put:cxx,
% \prop_gput:Nnn, \prop_gput:NnV, \prop_gput:Nno, \prop_gput:Nne, \prop_gput:Nnx,
% \prop_gput:NVn, \prop_gput:NVV, \prop_gput:NVx, \prop_gput:Nvx,
% \prop_gput:Non, \prop_gput:Noo, \prop_gput:Nxx,
% \prop_gput:Non, \prop_gput:cxn, \prop_gput:Noo, \prop_gput:Nxx,
% \prop_gput:cnn, \prop_gput:cnV, \prop_gput:cno, \prop_gput:cne, \prop_gput:cnx,
% \prop_gput:cVn, \prop_gput:cVV, \prop_gput:cVx, \prop_gput:cvx,
% \prop_gput:con, \prop_gput:coo, \prop_gput:cxx
% \prop_gput:con, \prop_gput:cxn, \prop_gput:coo, \prop_gput:cxx
% }
% \begin{syntax}
% \cs{prop_put:Nnn} \meta{property list} \Arg{key} \Arg{value}
Expand Down Expand Up @@ -250,8 +250,8 @@
%
% \begin{function}[updated = 2011-08-28]
% {
% \prop_get:NnN, \prop_get:NVN, \prop_get:NvN, \prop_get:NoN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:cvN, \prop_get:coN,
% \prop_get:NnN, \prop_get:NVN, \prop_get:NvN, \prop_get:NoN, \prop_get:NxN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:cvN, \prop_get:coN, \prop_get:cxN
% }
% \begin{syntax}
% \cs{prop_get:NnN} \meta{property list} \Arg{key} \meta{tl var}
Expand Down Expand Up @@ -294,7 +294,11 @@
% the \meta{token list variable} is local. See also \cs{prop_gpop:NnNTF}.
% \end{function}
%
% \begin{function}[added = 2014-07-17, EXP]{\prop_item:Nn, \prop_item:cn}
% \begin{function}[added = 2014-07-17, EXP]
% {
% \prop_item:Nn, \prop_item:NV, \prop_item:No, \prop_item:Ne,
% \prop_item:cn, \prop_item:cV, \prop_item:co, \prop_item:ce
% }
% \begin{syntax}
% \cs{prop_item:Nn} \meta{property list} \Arg{key}
% \end{syntax}
Expand Down Expand Up @@ -399,8 +403,8 @@
%
% \begin{function}[updated = 2012-05-19, TF]
% {
% \prop_get:NnN, \prop_get:NVN, \prop_get:NvN, \prop_get:NoN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:cvN, \prop_get:coN
% \prop_get:NnN, \prop_get:NVN, \prop_get:NvN, \prop_get:NoN, \prop_get:NxN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:cvN, \prop_get:coN, \prop_get:cxN
% }
% \begin{syntax}
% \cs{prop_get:NnNTF} \meta{property list} \Arg{key} \meta{token list variable} \\
Expand Down Expand Up @@ -982,8 +986,8 @@
%
% \begin{macro}[tested = m3prop002]
% {
% \prop_get:NnN, \prop_get:NVN, \prop_get:NoN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:coN
% \prop_get:NnN, \prop_get:NVN, \prop_get:NvN, \prop_get:NoN, \prop_get:NxN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:cvN, \prop_get:coN, \prop_get:cxN
% }
% Getting an item from a list is very easy: after splitting,
% if the key is in the property list, just set the token list variable
Expand All @@ -995,8 +999,8 @@
{ \tl_set:Nn #3 {##2} }
{ \tl_set:Nn #3 { \q_no_value } }
}
\cs_generate_variant:Nn \prop_get:NnN { NV , Nv , No }
\cs_generate_variant:Nn \prop_get:NnN { c , cV , cv , co }
\cs_generate_variant:Nn \prop_get:NnN { NV , Nv , No , Nx }
\cs_generate_variant:Nn \prop_get:NnN { c , cV , cv , co , cx }
% \end{macrocode}
% \end{macro}
%
Expand Down Expand Up @@ -1035,7 +1039,11 @@
% \end{macro}
% \end{macro}
%
% \begin{macro}[EXP]{\prop_item:Nn, \prop_item:cn}
% \begin{macro}[EXP]
% {
% \prop_item:Nn, \prop_item:NV, \prop_item:No, \prop_item:Ne,
% \prop_item:cn, \prop_item:cV, \prop_item:co, \prop_item:ce
% }
% \begin{macro}[EXP]{\@@_item:nnn}
% Getting the value corresponding to a key in a property list in an
% expandable fashion simply uses \cs{prop_map_tokens:Nn} to go through
Expand All @@ -1053,7 +1061,7 @@
\str_if_eq:eeT {#1} {#2}
{ \prop_map_break:n { \exp_not:n {#3} } }
}
\cs_generate_variant:Nn \prop_item:Nn { c }
\cs_generate_variant:Nn \prop_item:Nn { NV , No , Ne , c , cV , co , ce }
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand Down Expand Up @@ -1154,19 +1162,19 @@
% {
% \prop_put:Nnn, \prop_put:NnV, \prop_put:Nno, \prop_put:Nne, \prop_put:Nnx,
% \prop_put:NVn, \prop_put:NVV, \prop_put:NVx, \prop_put:Nvx,
% \prop_put:Non, \prop_put:Noo, \prop_put:Nxx,
% \prop_put:Non, \prop_put:Nxn, \prop_put:Noo, \prop_put:Nxx,
% \prop_put:cnn, \prop_put:cnV, \prop_put:cno, \prop_put:cne, \prop_put:cnx,
% \prop_put:cVn, \prop_put:cVV, \prop_put:cVx, \prop_put:cvx,
% \prop_put:con, \prop_put:coo, \prop_put:cxx
% \prop_put:con, \prop_put:cxn, \prop_put:coo, \prop_put:cxx
% }
% \begin{macro}[tested = m3prop002]
% {
% \prop_gput:Nnn, \prop_gput:NnV, \prop_gput:Nno, \prop_gput:Nne, \prop_gput:Nnx,
% \prop_gput:NVn, \prop_gput:NVV, \prop_hput:NVx, \prop_hput:Nvx,
% \prop_gput:Non, \prop_gput:Noo, \prop_gput:Nxx,
% \prop_gput:Non, \prop_gput:Nxn, \prop_gput:Noo, \prop_gput:Nxx,
% \prop_gput:cnn, \prop_gput:cnV, \prop_gput:cno, \prop_gput:cne, \prop_gput:cnx,
% \prop_gput:cVn, \prop_gput:cVV, \prop_gput:cVx, \prop_gput:cvx,
% \prop_gput:con, \prop_gput:coo, \prop_gput:cxx
% \prop_gput:con, \prop_gput:cxn, \prop_gput:coo, \prop_gput:cxx
% }
% \begin{macro}{\@@_put:NNnn}
% Since the branches of \cs{@@_split:NnTF} are used as the replacement
Expand Down Expand Up @@ -1196,13 +1204,13 @@
{ #1 #2 { \exp_not:o {#2} \l_@@_internal_tl } }
}
\cs_generate_variant:Nn \prop_put:Nnn
{ NnV , Nno , Nne , Nnx , NV , NVV , NVx , Nvx , No , Noo , Nxx }
{ NnV , Nno , Nne , Nnx , NV , NVV , NVx , Nvx , No , Nx , Noo , Nxx }
\cs_generate_variant:Nn \prop_put:Nnn
{ c , cnV , cno , cne , cnx , cV , cVV , cVx , cvx , co , coo , cxx }
{ c , cnV , cno , cne , cnx , cV , cVV , cVx , cvx , co , cx , coo , cxx }
\cs_generate_variant:Nn \prop_gput:Nnn
{ NnV , Nno , Nne , Nnx , NV , NVV , NVx , Nvx , No , Noo , Nxx }
{ NnV , Nno , Nne , Nnx , NV , NVV , NVx , Nvx , No , Nx , Noo , Nxx }
\cs_generate_variant:Nn \prop_gput:Nnn
{ c , cnV , cno , cne , cnx , cV , cVV , cVx , cvx , co , coo , cxx }
{ c , cnV , cno , cne , cnx , cV , cVV , cVx , cvx , co , cx , coo , cxx }
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand Down Expand Up @@ -1307,8 +1315,8 @@
%
% \begin{macro}[TF, tested = m3prop004]
% {
% \prop_get:NnN, \prop_get:NVN, \prop_get:NoN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:coN
% \prop_get:NnN, \prop_get:NVN, \prop_get:NvN, \prop_get:NoN, \prop_get:NxN,
% \prop_get:cnN, \prop_get:cVN, \prop_get:cvN, \prop_get:coN, \prop_get:cxN
% }
% Getting the value corresponding to a key, keeping track of whether
% the key was present or not, is implemented as a conditional (with
Expand All @@ -1324,7 +1332,7 @@
{ \prg_return_false: }
}
\prg_generate_conditional_variant:Nnn \prop_get:NnN
{ NV , Nv , No , c , cV , cv , co } { T , F , TF }
{ NV , Nv , No , Nx , c , cV , cv , co , cx } { T , F , TF }
% \end{macrocode}
% \end{macro}
%
Expand Down
20 changes: 14 additions & 6 deletions l3kernel/l3seq.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@
%
% \begin{function}[added = 2011-08-15, updated = 2012-07-02]
% {
% \seq_set_split:Nnn , \seq_set_split:NnV ,
% \seq_gset_split:Nnn, \seq_gset_split:NnV
% \seq_set_split:Nnn ,
% \seq_set_split:NVn , \seq_set_split:NnV , \seq_set_split:NVV ,
% \seq_set_split:Nnx , \seq_set_split:Nxx ,
% \seq_gset_split:Nnn,
% \seq_gset_split:NVn , \seq_gset_split:NnV, \seq_gset_split:NVV,
% \seq_gset_split:Nnx , \seq_gset_split:Nxx
% }
% \begin{syntax}
% \cs{seq_set_split:Nnn} \meta{seq~var} \Arg{delimiter} \Arg{token list}
Expand Down Expand Up @@ -1266,8 +1270,12 @@
%
% \begin{macro}
% {
% \seq_set_split:Nnn , \seq_set_split:NnV ,
% \seq_gset_split:Nnn, \seq_gset_split:NnV
% \seq_set_split:Nnn ,
% \seq_set_split:NVn , \seq_set_split:NnV , \seq_set_split:NVV ,
% \seq_set_split:Nnx , \seq_set_split:Nxx ,
% \seq_gset_split:Nnn,
% \seq_gset_split:NVn , \seq_gset_split:NnV, \seq_gset_split:NVV,
% \seq_gset_split:Nnx, \seq_gset_split:Nxx
% }
% \begin{macro}
% {
Expand Down Expand Up @@ -1340,8 +1348,8 @@
}
\cs_new:Npn \@@_set_split:w #1 \@@_set_split_end:
{ \@@_wrap_item:n {#1} }
\cs_generate_variant:Nn \seq_set_split:Nnn { NnV }
\cs_generate_variant:Nn \seq_gset_split:Nnn { NnV }
\cs_generate_variant:Nn \seq_set_split:Nnn { NV , NnV , NVV , Nnx , Nxx }
\cs_generate_variant:Nn \seq_gset_split:Nnn { NV , NnV , NVV , Nnx , Nxx }
\cs_generate_variant:Nn \seq_set_split_keep_spaces:Nnn { NnV }
\cs_generate_variant:Nn \seq_gset_split_keep_spaces:Nnn { NnV }
% \end{macrocode}
Expand Down

0 comments on commit 6954357

Please sign in to comment.