[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Final fix (d8e7d5fb)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Mar 9 04:54:40 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : hook-args
Link       : https://github.com/latex3/latex2e/commit/d8e7d5fb5d9818b7c887421a3a05db5f4715bd79

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

commit d8e7d5fb5d9818b7c887421a3a05db5f4715bd79
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu Mar 9 00:54:40 2023 -0300

    Final fix
    
    for the day


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

d8e7d5fb5d9818b7c887421a3a05db5f4715bd79
 base/lthooks.dtx | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 663fe107..7af46943 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.