[latex3-commits] [git/LaTeX3-latex3-latex3] spaces: Bruno's faster check for null-space error condition (6334be8e6)
Marcel Fabian Krüger
tex at 2krueger.de
Sat Mar 26 22:37:26 CET 2022
Repository : https://github.com/latex3/latex3
On branch : spaces
Link : https://github.com/latex3/latex3/commit/6334be8e6f7dde54ec1983e5a7c9561b21520724
>---------------------------------------------------------------
commit 6334be8e6f7dde54ec1983e5a7c9561b21520724
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date: Sat Mar 26 22:37:26 2022 +0100
Bruno's faster check for null-space error condition
>---------------------------------------------------------------
6334be8e6f7dde54ec1983e5a7c9561b21520724
l3kernel/l3token.dtx | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index 1078fe444..aa5627f15 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -1529,24 +1529,22 @@
% \begin{macrocode}
\cs_new:Npn \@@_generate_aux:w #1 ; #2 ;
{
- \if_int_odd:w 1
- \if_int_compare:w #2 = 10 \exp_stop_f: \else: 0 \fi:
- \if_int_compare:w #1 = \c_zero_int \else: 0 \fi: \exp_stop_f:
- \msg_expandable_error:nn { char } { null-space }
+ \if_int_odd:w 0
+ \if_int_compare:w #2 < 1 \exp_stop_f: 1 \fi:
+ \if_int_compare:w #2 = 5 \exp_stop_f: 1 \fi:
+ \if_int_compare:w #2 = 9 \exp_stop_f: 1 \fi:
+ \if_int_compare:w #2 > 13 \exp_stop_f: 1 \fi: \exp_stop_f:
+ \msg_expandable_error:nn { char }
+ { invalid-catcode }
\else:
\if_int_odd:w 0
- \if_int_compare:w #2 < 1 \exp_stop_f: 1 \fi:
- \if_int_compare:w #2 = 5 \exp_stop_f: 1 \fi:
- \if_int_compare:w #2 = 9 \exp_stop_f: 1 \fi:
- \if_int_compare:w #2 > 13 \exp_stop_f: 1 \fi: \exp_stop_f:
+ \if_int_compare:w #1 < \c_zero_int 1 \fi:
+ \if_int_compare:w #1 > \c_max_char_int 1 \fi: \exp_stop_f:
\msg_expandable_error:nn { char }
- { invalid-catcode }
+ { out-of-range }
\else:
- \if_int_odd:w 0
- \if_int_compare:w #1 < \c_zero_int 1 \fi:
- \if_int_compare:w #1 > \c_max_char_int 1 \fi: \exp_stop_f:
- \msg_expandable_error:nn { char }
- { out-of-range }
+ \if_int_compare:w #2#1 = 100 \exp_stop_f:
+ \msg_expandable_error:nn { char } { null-space }
\else:
\@@_generate_aux:nnw {#1} {#2}
\fi:
More information about the latex3-commits
mailing list.