[latex3-commits] [l3svn] r7392 - Make l3doc's syntax environment use its box if outside a function (see #381)

noreply at latex-project.org noreply at latex-project.org
Mon Jul 17 06:30:21 CEST 2017


Author: bruno
Date: 2017-07-17 06:30:21 +0200 (Mon, 17 Jul 2017)
New Revision: 7392

Modified:
   trunk/l3kernel/l3doc.dtx
Log:
Make l3doc's syntax environment use its box if outside a function (see #381)

This is an incomplete fix, there is still no check that only one syntax
environment appears in each function environment, nothing sensible if
function environments are nested.  We should start using it in the kernel's
doc and see what breaks.


Modified: trunk/l3kernel/l3doc.dtx
===================================================================
--- trunk/l3kernel/l3doc.dtx	2017-07-17 04:21:35 UTC (rev 7391)
+++ trunk/l3kernel/l3doc.dtx	2017-07-17 04:30:21 UTC (rev 7392)
@@ -594,6 +594,15 @@
 %    \end{macrocode}
 % \end{variable}
 %
+% \begin{variable}[int]{\l_@@_in_function_bool}
+%   True when inside a \texttt{function} or \texttt{variable}
+%   environment.  Used by the \texttt{syntax} environment to determine
+%   its behaviour.
+%    \begin{macrocode}
+\bool_new:N \l_@@_in_function_bool
+%    \end{macrocode}
+% \end{variable}
+%
 % \begin{variable}[int]{\l_@@_long_name_bool, \l_@@_trial_width_dim}
 %   The boolean \cs{l_@@_long_name_bool} is \texttt{true} if the width
 %   \cs{l_@@_trial_width_dim} of the coffin \cs{l_@@_functions_coffin}
@@ -2261,11 +2270,12 @@
       \bool_set_false:N \l_@@_macro_rEXP_bool
       \bool_set_false:N \l_@@_no_label_bool
       \bool_set_false:N \l_@@_names_verb_bool
+      \bool_set_true:N \l_@@_in_function_bool
       \clist_clear:N \l_@@_function_label_clist
       \tl_set:Nn \l_@@_override_module_tl { \q_no_value }
       \char_set_catcode_active:N \<
       \cs_set_protected_nopar:Npn < ##1 > { \meta {##1} }
-  }
+    }
 \group_end:
 %    \end{macrocode}
 % \end{macro}
@@ -2534,6 +2544,11 @@
       \end{tabular}
       \arrayrulecolor{black}
     \hbox_gset_end:
+    \bool_if:NF \l_@@_in_function_bool
+      {
+        \mode_leave_vertical:
+        \box_use:N \g_@@_syntax_box
+      }
   }
 %    \end{macrocode}
 % \end{macro}



More information about the latex3-commits mailing list