[latex3-commits] [git/LaTeX3-latex3-latex3] master: Check all cctab are closed at the end of the TeX run (103e3fcb3)

Bruno Le Floch bruno at le-floch.fr
Thu Jul 16 12:54:09 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/103e3fcb31244ce2391d91c865d46a9cb970c6b9

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

commit 103e3fcb31244ce2391d91c865d46a9cb970c6b9
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Thu Jul 16 12:54:09 2020 +0200

    Check all cctab are closed at the end of the TeX run
    
    This is untested because the hook management system is not there
    yet.  Did I get the syntax of \hook_gput_code:nnn right?


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

103e3fcb31244ce2391d91c865d46a9cb970c6b9
 l3kernel/l3cctab.dtx | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/l3kernel/l3cctab.dtx b/l3kernel/l3cctab.dtx
index 37f9bcad3..42ac8f566 100644
--- a/l3kernel/l3cctab.dtx
+++ b/l3kernel/l3cctab.dtx
@@ -659,6 +659,19 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% Finally, install some code at the end of the \TeX{} run to check that
+% all \cs{cctab_begin:N} were ended by some \cs{cctab_end:}.
+%    \begin{macrocode}
+\cs_if_exist:NT \hook_gput_code:nnn
+  {
+    \hook_gput_code:nnn { enddocument/end } { kernel }
+      {
+        \seq_if_empty:NF \g_@@_stack_seq
+          { \__kernel_msg_error:nn { kernel } { cctab-missing-end } }
+      }
+  }
+%    \end{macrocode}
+%
 % \subsection{Category code table conditionals}
 %
 % \begin{macro}{\cctab_if_exist:N,\cctab_if_exist:c}
@@ -838,6 +851,12 @@
     LaTeX~came~across~a~\iow_char:N\\cctab_end:~without~a~matching~
     \iow_char:N\\cctab_begin:N.~This~command~will~be~ignored.
   }
+\__kernel_msg_new:nnnn { kernel } { cctab-missing-end }
+  { Missing~\iow_char:N\\cctab_end:~before~end~of~TeX~run. }
+  {
+    LaTeX~came~across~more~\iow_char:N\\cctab_begin:N~than~
+    \iow_char:N\\cctab_end:.
+  }
 \__kernel_msg_new:nnnn { kernel } { invalid-cctab }
   { Invalid~\iow_char:N\\catcode~table. }
   {





More information about the latex3-commits mailing list.