[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Final fix (f8373d15)
PhelypeOleinik
phelype.oleinik at latex-project.org
Sat Mar 11 03:06:36 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : hook-args
Link : https://github.com/latex3/latex2e/commit/f8373d15ec53af42cbe3ca86b219abb79bc9a84c
>---------------------------------------------------------------
commit f8373d15ec53af42cbe3ca86b219abb79bc9a84c
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Thu Mar 9 00:54:40 2023 -0300
Final fix
for the day
>---------------------------------------------------------------
f8373d15ec53af42cbe3ca86b219abb79bc9a84c
base/lthooks.dtx | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index f431b50a..edd993c4 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2653,9 +2653,11 @@
\int_eval:n
{
\exp_args:Nf \str_count:n
- { \exp_args:Nc \cs_parameter_spec:N {#1} } / 2
+ { \exp_args:Nc \@@_cs_parameter_count_aux:N {#1} } / 2
}
}
+\cs_new:Npn \@@_cs_parameter_count_aux:N #1
+ { \token_if_macro:NT #1 { \cs_parameter_spec:N #1 } }
% \end{macrocode}
% \end{macro}
%
@@ -2668,20 +2670,24 @@
{ \@@_tl_gset:cn {#3} { #1 #2 } }
\cs_new:Npn \@@_braced_cs_parameter:n #1
{
- \if_case:w \@@_cs_parameter_count:c {#1} \exp_stop_f:
- \or: {##1}
- \or: {##1} {##2}
- \or: {##1} {##2} {##3}
- \or: {##1} {##2} {##3} {##4}
- \or: {##1} {##2} {##3} {##4} {##5}
- \or: {##1} {##2} {##3} {##4} {##5} {##6}
- \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7}
- \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8}
- \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} {##9}
- \else:
- \msg_expandable_error:nnn { latex2e } { should-not-happen }
- { Invalid~parameter~spec. }
- \fi:
+ \exp_last_unbraced:Ne \@@_braced_loop:w
+ {
+ \if_case:w \@@_cs_parameter_count:c {#1} \exp_stop_f:
+ \or: ##1
+ \or: ##1##2
+ \or: ##1##2##3
+ \or: ##1##2##3##4
+ \or: ##1##2##3##4##5
+ \or: ##1##2##3##4##5##6
+ \or: ##1##2##3##4##5##6##7
+ \or: ##1##2##3##4##5##6##7##8
+ \or: ##1##2##3##4##5##6##7##8##9
+ \else:
+ \msg_expandable_error:nnn { latex2e } { should-not-happen }
+ { Invalid~parameter~spec. }
+ \fi:
+ }
+ ?? \s_@@_mark
}
\cs_new:Npn \@@_braced_parameter:n #1
{
More information about the latex3-commits
mailing list.