[latex3-commits] [l3svn] r6653 - Refactoring l3doc: add auxiliary for props of clists

noreply at latex-project.org noreply at latex-project.org
Sun Aug 14 18:28:51 CEST 2016


Author: bruno
Date: 2016-08-14 18:28:51 +0200 (Sun, 14 Aug 2016)
New Revision: 6653

Modified:
   trunk/l3kernel/l3doc.dtx
Log:
Refactoring l3doc: add auxiliary for props of clists


Modified: trunk/l3kernel/l3doc.dtx
===================================================================
--- trunk/l3kernel/l3doc.dtx	2016-08-14 16:22:11 UTC (rev 6652)
+++ trunk/l3kernel/l3doc.dtx	2016-08-14 16:28:51 UTC (rev 6653)
@@ -575,6 +575,7 @@
 %     \tl_if_head_eq_charcode:oNTF,
 %     \tl_if_head_eq_charcode:oNT,
 %     \tl_if_head_eq_charcode:oNF,
+%     \tl_if_head_eq_meaning:VNF,
 %     \tl_if_in:NoTF,
 %     \tl_if_in:NoT,
 %     \tl_if_in:NoF,
@@ -595,6 +596,7 @@
 \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o }
 \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT  { o }
 \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF  { o }
+\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF  { V }
 \cs_generate_variant:Nn \tl_if_in:NnTF { No }
 \cs_generate_variant:Nn \tl_if_in:NnT  { No }
 \cs_generate_variant:Nn \tl_if_in:NnF  { No }
@@ -712,6 +714,26 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}[aux]
+%   {
+%     \@@_clist_prop_put_right:Nnn, \@@_clist_prop_put_right:Nxn,
+%     \@@_clist_prop_put_right:Nnf
+%   }
+%   We sometimes want to collect multiple entries according to some key.
+%   This is done by having property lists whose values are themselves
+%   comma-lists: in short \enquote{clist_prop}.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_clist_prop_put_right:Nnn #1#2#3
+  {
+    \prop_get:NnNTF #1 {#2} \l_@@_tmpa_tl
+      { \tl_put_right:Nn \l_@@_tmpa_tl { , #3 } }
+      { \tl_set:Nn \l_@@_tmpa_tl {#3} }
+    \prop_put:Nno #1 {#2} \l_@@_tmpa_tl
+  }
+\cs_generate_variant:Nn \@@_clist_prop_put_right:Nnn { Nx , Nnf }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}[int]{\CodedocUseCs}
 %   To implement commands which can be used in bookmarks and moving
 %   arguments, it appears necessary to have an analogue of \cs{use:c}
@@ -1774,14 +1796,8 @@
   }
 \cs_new_protected:Npn \@@_function_parse_cs_aux:nnN #1#2#3
   {
-    \prop_get:NnNF
-      \l_@@_functions_block_prop {#1} \l_@@_tmpb_tl
-      { \tl_clear:N \l_@@_tmpb_tl }
-    \prop_put:Nnx \l_@@_functions_block_prop {#1}
-      {
-        \l_@@_tmpb_tl ,
-        \bool_if:NTF #3 { {#2} } { \scan_stop: }
-      }
+    \@@_clist_prop_put_right:Nnf \l_@@_functions_block_prop {#1}
+      { \bool_if:NTF #3 { {#2} } { \scan_stop: } }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1936,14 +1952,10 @@
     \prop_clear:N \l_@@_variants_prop
     \clist_map_inline:nn {#2}
       {
-        \tl_set:Nx \l_@@_tmpa_tl
+        \@@_clist_prop_put_right:Nxn
+          \l_@@_variants_prop
           { \@@_signature_base_form:n {##1} }
-        \prop_get:NoNTF \l_@@_variants_prop
-          \l_@@_tmpa_tl \l_@@_tmpb_tl
-          { \tl_put_right:Nn \l_@@_tmpb_tl { , {##1} } }
-          { \tl_set:Nn \l_@@_tmpb_tl { {##1} } }
-        \prop_put:Noo \l_@@_variants_prop
-          \l_@@_tmpa_tl \l_@@_tmpb_tl
+          { {##1} }
       }
     \prop_map_function:NN \l_@@_variants_prop
       \@@_typeset_functions_auxii:nn
@@ -1955,9 +1967,7 @@
     \exp_args:Nc \@@_typeset_functions_auxiii:N
       {
         \g_@@_base_name_tl
-        \exp_last_unbraced:Nf \token_if_eq_meaning:NNF
-          { \tl_head:f { \l_@@_tmpb_tl ? } }
-          \scan_stop:
+        \tl_if_head_eq_meaning:VNF \l_@@_tmpb_tl \scan_stop:
           { : \l_@@_tmpb_tl }
       }
   }
@@ -2436,22 +2446,15 @@
 %
 % \begin{macro}[aux]{\@@_test_missing:n}
 %   Keys in \cs{g_@@_missing_tests_prop} are lists of macros given as
-%   arguments of one \env{macro} environment.  Values are comma lists of
-%   filenames (Bruno thinks).
+%   arguments of one \env{macro} environment.  Values are pairs of a
+%   file name and a comment about the missing tests.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_test_missing:n #1
   {
-    \tl_set:Nx \l_@@_tmpb_tl
+    \@@_clist_prop_put_right:Nxn
+      \g_@@_missing_tests_prop
       { \seq_use:Nn \l_@@_macro_input_seq { , } }
-    \prop_if_in:NVTF \g_@@_missing_tests_prop \l_@@_tmpb_tl
-      {
-        \prop_get:NVN \g_@@_missing_tests_prop \l_@@_tmpb_tl
-          \l_@@_tmpa_tl
-      }
-      { \tl_clear:N \l_@@_tmpa_tl }
-    \clist_set:Nx \l_@@_tmpa_clist { \l_@@_tmpa_tl , #1 }
-    \prop_gput:NVV \g_@@_missing_tests_prop \l_@@_tmpb_tl
-      \l_@@_tmpa_clist
+      { { \g_file_current_name_tl \iow_char:N \ (#1) } }
   }
 %    \end{macrocode}
 % \end{macro}



More information about the latex3-commits mailing list