[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Simplify and one more test (b23b5e64)
PhelypeOleinik
phelype.oleinik at latex-project.org
Sun Mar 19 02:14:29 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : hook-args
Link : https://github.com/latex3/latex2e/commit/b23b5e64ea4c8cc2634ed1fc8ff1122c97d1b0de
>---------------------------------------------------------------
commit b23b5e64ea4c8cc2634ed1fc8ff1122c97d1b0de
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Sat Mar 18 22:14:29 2023 -0300
Simplify and one more test
>---------------------------------------------------------------
b23b5e64ea4c8cc2634ed1fc8ff1122c97d1b0de
base/lthooks.dtx | 9 +++------
base/testfiles-lthooks/lthooks-033.lvt | 23 +++++++++++++++++++++++
base/testfiles-lthooks/lthooks-033.tlg | 16 ++++++++++++++++
3 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 14614f00..fc67d8d7 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2604,13 +2604,10 @@
\@@_code_gset_auxi:veen
{ c_@@_#2_parameter_tl }
{
- \int_compare:nNnT { \@@_cs_parameter_count:c { @@#1~#2 } } = { 9 }
+ \exp_args:NNo \exp_args:No \@@_double_hashes:n
{
- \exp_args:NNo \exp_args:No \@@_double_hashes:n
- {
- \cs:w @@#1~#2 \exp_last_unbraced:Ne \cs_end:
- { \@@_braced_cs_parameter:n { @@#1~#2 } }
- }
+ \cs:w @@#1~#2 \exp_last_unbraced:Ne \cs_end:
+ { \@@_braced_cs_parameter:n { @@#1~#2 } }
}
}
{ } { @@#1~#2 }
diff --git a/base/testfiles-lthooks/lthooks-033.lvt b/base/testfiles-lthooks/lthooks-033.lvt
index d38947c0..f302ac9f 100644
--- a/base/testfiles-lthooks/lthooks-033.lvt
+++ b/base/testfiles-lthooks/lthooks-033.lvt
@@ -150,4 +150,27 @@
\UseHookWithArguments{not-declared}{foo}{bar}
}
+%
+
+\TEST{Testing with nine arguments}
+ {
+ \AddToHookWithArguments{not-nine}{\typeout{top-args(#1,#9)}}
+ \AddToHook{not-nine}{\typeout{top-hashes(#1,#9)}}
+ \AddToHookWithArguments{not-nine}[label]{\typeout{label-args(#1,#9)}}
+ \AddToHook{not-nine}[label]{\typeout{label-hashes(#1,#9)}}
+ \AddToHookNextWithArguments{not-nine}{\typeout{next-args(#1,#9)}}
+ \AddToHookNext{not-nine}{\typeout{next-hashes(#1,#9)}}
+ %
+ \NewHookWithArguments{not-nine}{9}
+ %
+ \AddToHookWithArguments{not-nine}{\typeout{top-more-args(#1,#9)}}
+ \AddToHook{not-nine}{\typeout{top-more-hashes(#1,#9)}}
+ \AddToHookWithArguments{not-nine}[label]{\typeout{label-more-args(#1,#9)}}
+ \AddToHook{not-nine}[label]{\typeout{label-more-hashes(#1,#9)}}
+ \AddToHookNextWithArguments{not-nine}{\typeout{next-more-args(#1,#9)}}
+ \AddToHookNext{not-nine}{\typeout{next-more-hashes(#1,#9)}}
+ %
+ \UseHookWithArguments{not-nine}{foo}2345678{bar}
+ }
+
\END
diff --git a/base/testfiles-lthooks/lthooks-033.tlg b/base/testfiles-lthooks/lthooks-033.tlg
index b6f64822..c08111b7 100644
--- a/base/testfiles-lthooks/lthooks-033.tlg
+++ b/base/testfiles-lthooks/lthooks-033.tlg
@@ -224,3 +224,19 @@ next-hashes(##1,##2)
next-more-args(foo,bar)
next-more-hashes(##1,##2)
============================================================
+============================================================
+TEST 8: Testing with nine arguments
+============================================================
+label-args(foo,bar)
+label-hashes(##1,##9)
+label-more-args(foo,bar)
+label-more-hashes(##1,##9)
+top-args(foo,bar)
+top-hashes(##1,##9)
+top-more-args(foo,bar)
+top-more-hashes(##1,##9)
+next-args(foo,bar)
+next-hashes(##1,##9)
+next-more-args(foo,bar)
+next-more-hashes(##1,##9)
+============================================================
More information about the latex3-commits
mailing list.