[latex3-commits] [l3svn] r6692 - l3doc: add "noTF" key for things like \int_case:nn(TF)

noreply at latex-project.org noreply at latex-project.org
Sat Aug 20 00:29:47 CEST 2016


Author: bruno
Date: 2016-08-20 00:29:47 +0200 (Sat, 20 Aug 2016)
New Revision: 6692

Modified:
   trunk/l3kernel/l3basics.dtx
   trunk/l3kernel/l3doc.dtx
   trunk/l3kernel/l3int.dtx
   trunk/l3kernel/l3skip.dtx
   trunk/l3kernel/l3str.dtx
   trunk/l3kernel/l3tl.dtx
Log:
l3doc: add "noTF" key for things like \int_case:nn(TF)

Sometimes one wants to simultaneously document \foo:nn and
\foo:nnTF (and \foo:nnF and \foo:nnT), but since function
environments cannot pleasantly be nested (at present) one
had to document them separately.  The new key "noTF" is
for such cases: it is similar to (and compatible with) "pTF".


Modified: trunk/l3kernel/l3basics.dtx
===================================================================
--- trunk/l3kernel/l3basics.dtx	2016-08-19 22:14:26 UTC (rev 6691)
+++ trunk/l3kernel/l3basics.dtx	2016-08-19 22:29:47 UTC (rev 6692)
@@ -743,25 +743,16 @@
 %   \end{verbatim}
 %   after two expansions of \cs{use:c}.
 %
-% \begin{function}[EXP,added = 2012-11-10]
+% \begin{function}[noTF, EXP, added = 2012-11-10]
 %   {\cs_if_exist_use:N, \cs_if_exist_use:c}
 %   \begin{syntax}
 %     \cs{cs_if_exist_use:N} \meta{control sequence}
-%   \end{syntax}
-%   Tests whether the \meta{control sequence} is currently defined
-%   (whether as a function or another control sequence type), and if it
-%   does inserts the  \meta{control sequence} into the input stream.
-% \end{function}
-%
-% \begin{function}[TF,EXP, added = 2012-11-10]
-%   {\cs_if_exist_use:N, \cs_if_exist_use:c}
-%   \begin{syntax}
 %     \cs{cs_if_exist_use:NTF} \meta{control sequence} \Arg{true code} \Arg{false code}
 %   \end{syntax}
 %   Tests whether the \meta{control sequence} is currently defined
 %   (whether as a function or another control sequence type), and if it
-%   does inserts the  \meta{control sequence} into the input stream followed
-%   by the \meta{true code}.
+%   is inserts the  \meta{control sequence} into the input stream followed
+%   by the \meta{true code}.  Otherwise the \meta{false code} is used.
 % \end{function}
 %
 % \begin{function}[EXP]{\cs:w, \cs_end:}
@@ -2251,10 +2242,8 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[EXP,TF,added=2011-10-10]
+% \begin{macro}[EXP,noTF,added=2011-10-10]
 %   {\cs_if_exist_use:N, \cs_if_exist_use:c}
-% \begin{macro}[EXP,added=2011-10-10]
-%   {\cs_if_exist_use:N, \cs_if_exist_use:c}
 %   The \cs[index=cs_if_exist_use:N]{cs_if_exist_use:\ldots{}}
 %   functions cannot be implemented
 %   as conditionals because the true branch must leave both the control
@@ -2280,7 +2269,6 @@
   { \cs_if_exist:cTF {#1} { \use:c {#1} } { } }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 % \subsection{Defining and checking (new) functions}
 %

Modified: trunk/l3kernel/l3doc.dtx
===================================================================
--- trunk/l3kernel/l3doc.dtx	2016-08-19 22:14:26 UTC (rev 6691)
+++ trunk/l3kernel/l3doc.dtx	2016-08-19 22:29:47 UTC (rev 6692)
@@ -387,9 +387,10 @@
 %
 % Function environments take an optional argument to indicate whether
 % the function(s) it describes are expandable or restricted-expandable
-% or defined in conditional forms. Use |EXP|, |rEXP|, |TF|, or |pTF| for
+% or defined in conditional forms. Use |EXP|, |rEXP|, |TF|, |pTF|, or |noTF| for
 % this; note that |pTF| implies |EXP| since predicates must always be
-% expandable.  As an example:
+% expandable, and that |noTF| means that the function without |TF|
+% should be documented in addition to |TF|.  As an example:
 % \begin{framed}
 %   \vspace{-\baselineskip}
 % \begin{verbatim}
@@ -661,6 +662,7 @@
 %     \l_@@_macro_aux_bool,
 %     \l_@@_macro_TF_bool,
 %     \l_@@_macro_pTF_bool,
+%     \l_@@_macro_noTF_bool,
 %     \l_@@_macro_EXP_bool,
 %     \l_@@_macro_rEXP_bool,
 %     \l_@@_macro_var_bool,
@@ -675,6 +677,7 @@
 \bool_new:N \l_@@_macro_aux_bool
 \bool_new:N \l_@@_macro_TF_bool
 \bool_new:N \l_@@_macro_pTF_bool
+\bool_new:N \l_@@_macro_noTF_bool
 \bool_new:N \l_@@_macro_EXP_bool
 \bool_new:N \l_@@_macro_rEXP_bool
 \bool_new:N \l_@@_macro_var_bool
@@ -1232,7 +1235,7 @@
 \msg_new:nnnn { l3doc } { no-signature-TF }
   { Function/macro~'#1'~cannot~be~turned~into~a~conditional. }
   {
-    A~function~or~macro~environment~with~option~pTF~or~TF~
+    A~function~or~macro~environment~with~option~pTF,~TF~or~noTF~
     received~the~argument~'#1'.~This~function's~name~has~no~
     ':'~hence~it~is~not~clear~where~to~add~'_p'~or~'TF'.~
     Please~follow~expl3~naming~conventions.
@@ -2071,8 +2074,9 @@
 % \begin{macro}[aux]
 %   {\@@_names_typeset_auxii:n, \@@_names_typeset_auxii:x}
 %   In case the option |pTF| was given, typeset predicates before the
-%   |TF| functions.  Pass the relevant boolean in both cases to control
-%   whether to append |TF|.
+%   |TF| functions.  In case the option |noTF| was given, typeset the
+%   non-|TF| function as well.  Pass the relevant boolean in both cases
+%   to control whether to append |TF|.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_names_typeset_auxii:n #1
   {
@@ -2082,6 +2086,8 @@
           { \@@_predicate_from_base:n {#1} }
           \c_false_bool
       }
+    \bool_if:NT \l_@@_macro_noTF_bool
+      { \@@_names_typeset_block:nN {#1} \c_false_bool }
     \@@_names_typeset_block:nN {#1} \l_@@_macro_TF_bool
   }
 \cs_generate_variant:Nn \@@_names_typeset_auxii:n { x }
@@ -2135,6 +2141,12 @@
         \bool_set_true:N \l_@@_macro_EXP_bool
         \bool_set_false:N \l_@@_macro_rEXP_bool
       } ,
+    noTF .value_forbidden:n = true ,
+    noTF .code:n =
+      {
+        \bool_set_true:N \l_@@_macro_noTF_bool
+        \bool_set_true:N \l_@@_macro_TF_bool
+      } ,
     added .tl_set:N = \l_@@_date_added_tl ,
     updated .tl_set:N = \l_@@_date_updated_tl ,
     deprecated .code:n = { \@@_deprecated_on:n {#1} } ,
@@ -2239,6 +2251,7 @@
       \coffin_clear:N \l_@@_functions_coffin
       \bool_set_false:N \l_@@_macro_TF_bool
       \bool_set_false:N \l_@@_macro_pTF_bool
+      \bool_set_false:N \l_@@_macro_noTF_bool
       \bool_set_false:N \l_@@_macro_EXP_bool
       \bool_set_false:N \l_@@_macro_rEXP_bool
       \bool_set_false:N \l_@@_no_label_bool
@@ -2551,6 +2564,12 @@
         \bool_set_true:N \l_@@_macro_EXP_bool
         \bool_set_false:N \l_@@_macro_rEXP_bool
       } ,
+    noTF .value_forbidden:n = true ,
+    noTF .code:n =
+      {
+        \bool_set_true:N \l_@@_macro_TF_bool
+        \bool_set_true:N \l_@@_macro_noTF_bool
+      } ,
     EXP .value_forbidden:n = true ,
     EXP .code:n =
       {
@@ -2582,7 +2601,7 @@
 %   initialize some variables before applying the \meta{options}, then
 %   parse the \meta{names} to get a sequence of macro names, then apply
 %   \cs{@@_macro_single:nNN} to each (this step is more subtle than
-%   \cs{seq_map_function:NN} because of |TF|/|pTF|).  Finally typeset
+%   \cs{seq_map_function:NN} because of |TF|/|pTF|/|noTF|).  Finally typeset
 %   the macro names in the margin.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_macro:nnw #1#2
@@ -2613,6 +2632,7 @@
     \bool_set_false:N \l_@@_macro_internal_bool
     \bool_set_false:N \l_@@_macro_TF_bool
     \bool_set_false:N \l_@@_macro_pTF_bool
+    \bool_set_false:N \l_@@_macro_noTF_bool
     \bool_set_false:N \l_@@_macro_EXP_bool
     \bool_set_false:N \l_@@_macro_rEXP_bool
     \bool_set_false:N \l_@@_macro_var_bool

Modified: trunk/l3kernel/l3int.dtx
===================================================================
--- trunk/l3kernel/l3int.dtx	2016-08-19 22:14:26 UTC (rev 6691)
+++ trunk/l3kernel/l3int.dtx	2016-08-19 22:29:47 UTC (rev 6692)
@@ -356,7 +356,7 @@
 %   \end{center}
 % \end{function}
 %
-% \begin{function}[added = 2013-07-24, EXP, TF]{\int_case:nn}
+% \begin{function}[added = 2013-07-24, EXP, noTF]{\int_case:nn}
 %   \begin{syntax}
 %     \cs{int_case:nnTF} \Arg{test integer expression} \\
 %     ~~|{| \\
@@ -1547,8 +1547,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[EXP, TF]{\int_case:nn}
-% \begin{macro}[EXP]{\int_case:nn}
+% \begin{macro}[EXP, noTF]{\int_case:nn}
 % \begin{macro}[aux]{\@@_case:nnTF}
 % \begin{macro}[aux]{\@@_case:nw, \@@_case_end:nw}
 %   For integer cases, the first task to fully expand the check
@@ -1588,7 +1587,6 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}[pTF]{\int_if_odd:n}
 % \UnitTested

Modified: trunk/l3kernel/l3skip.dtx
===================================================================
--- trunk/l3kernel/l3skip.dtx	2016-08-19 22:14:26 UTC (rev 6691)
+++ trunk/l3kernel/l3skip.dtx	2016-08-19 22:29:47 UTC (rev 6692)
@@ -273,7 +273,7 @@
 %   \end{center}
 % \end{function}
 %
-% \begin{function}[added = 2013-07-24, EXP, TF]{\dim_case:nn}
+% \begin{function}[added = 2013-07-24, EXP, noTF]{\dim_case:nn}
 %   \begin{syntax}
 %     \cs{dim_case:nnTF} \Arg{test dimension expression} \\
 %     ~~|{| \\
@@ -1271,8 +1271,7 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[EXP, TF]{\dim_case:nn}
-% \begin{macro}[EXP]{\dim_case:nn}
+% \begin{macro}[EXP, noTF]{\dim_case:nn}
 % \begin{macro}[aux]{\@@_case:nnTF}
 % \begin{macro}[aux]{\@@_case:nw, \@@_case_end:nw}
 %   For dimension cases, the first task to fully expand the check
@@ -1312,7 +1311,6 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \subsection{Dimension expression loops}
 %

Modified: trunk/l3kernel/l3str.dtx
===================================================================
--- trunk/l3kernel/l3str.dtx	2016-08-19 22:14:26 UTC (rev 6691)
+++ trunk/l3kernel/l3str.dtx	2016-08-19 22:29:47 UTC (rev 6692)
@@ -270,7 +270,7 @@
 %   is logically \texttt{true}.
 % \end{function}
 %
-% \begin{function}[added = 2013-07-24, updated = 2015-02-28, EXP, TF]
+% \begin{function}[added = 2013-07-24, updated = 2015-02-28, EXP, noTF]
 %   {\str_case:nn, \str_case:on, \str_case:nV, \str_case:nv}
 %   \begin{syntax}
 %     \cs{str_case:nnTF} \Arg{test string} \\
@@ -875,10 +875,8 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[EXP, TF]
+% \begin{macro}[EXP, noTF]
 %   {\str_case:nn, \str_case:on, \str_case:nV, \str_case:nv, \str_case_x:nn}
-% \begin{macro}[EXP]
-%   {\str_case:nn, \str_case:on, \str_case:nV, \str_case:nv, \str_case_x:nn}
 % \begin{macro}[EXP, aux]{\@@_case:nnTF, \@@_case_x:nnTF}
 % \begin{macro}[aux, EXP]
 %   {\@@_case:nw, \@@_case_x:nw, \@@_case_end:nw}
@@ -950,7 +948,6 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \subsection{Accessing specific characters in a string}
 %

Modified: trunk/l3kernel/l3tl.dtx
===================================================================
--- trunk/l3kernel/l3tl.dtx	2016-08-19 22:14:26 UTC (rev 6691)
+++ trunk/l3kernel/l3tl.dtx	2016-08-19 22:29:47 UTC (rev 6692)
@@ -480,7 +480,7 @@
 %   token count $1$ according to \cs{tl_count:n}.
 % \end{function}
 %
-% \begin{function}[added = 2013-07-24, EXP, TF]{\tl_case:Nn, \tl_case:cn}
+% \begin{function}[added = 2013-07-24, EXP, noTF]{\tl_case:Nn, \tl_case:cn}
 %   \begin{syntax}
 %     \cs{tl_case:NnTF} \meta{test token list variable} \\
 %     ~~"{" \\
@@ -2082,8 +2082,7 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[EXP, TF]{\tl_case:Nn, \tl_case:cn}
-% \begin{macro}[EXP]{\tl_case:Nn, \tl_case:cn}
+% \begin{macro}[EXP, noTF]{\tl_case:Nn, \tl_case:cn}
 % \begin{macro}[EXP, aux]{\@@_case:nnTF}
 % \begin{macro}[aux, EXP]{\@@_case:Nw}
 % \begin{macro}[int, EXP]{\__prg_case_end:nw}
@@ -2149,7 +2148,6 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \subsection{Mapping to token lists}
 %



More information about the latex3-commits mailing list