[latex3-commits] [git/LaTeX3-latex3-latex3] main: implement faster group_align_safe_begin: (205c9cc3b)

Bruno Le Floch blflatex at gmail.com
Mon May 10 21:52:37 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/205c9cc3bc036cdfb050efcd26133dc3b2d7dcc8

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

commit 205c9cc3bc036cdfb050efcd26133dc3b2d7dcc8
Author: Jonathan Spratte <jspratte at yahoo.de>
Date:   Sat May 8 22:10:42 2021 +0200

    implement faster group_align_safe_begin:
    
    The code in this commit uses non-standard category codes and as a result
    will not work correctly if group_align_safe_begin: is expanded once and
    after that tokens with category code 2 get normalized. This should be
    rarely the case, but in \unravel this would break for instance. As a
    result this code might be considered unstable.


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

205c9cc3bc036cdfb050efcd26133dc3b2d7dcc8
 l3kernel/l3prg.dtx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/l3kernel/l3prg.dtx b/l3kernel/l3prg.dtx
index 972e41799..70df08c7b 100644
--- a/l3kernel/l3prg.dtx
+++ b/l3kernel/l3prg.dtx
@@ -1637,8 +1637,11 @@
 %   that the successive expansions of \cs{group_align_safe_begin/end:}
 %   are always brace balanced.
 %    \begin{macrocode}
+\group_begin:
+\tex_catcode:D `\^^@ = 2 \exp_stop_f:
 \cs_new:Npn \group_align_safe_begin:
-  { \if_int_compare:w \if_false: { \fi: `} = \c_zero_int \fi: }
+  { \exp:w \if_false: { \fi: `^^@ \exp_stop_f: }
+\group_end:
 \cs_new:Npn \group_align_safe_end:
   { \if_int_compare:w `{ = \c_zero_int } \fi: }
 %    \end{macrocode}





More information about the latex3-commits mailing list.