[latex3-commits] [latex3/latex2e] cmd-args: Use 9 arguments for next and toplevel code (97fe7252)
github at latex-project.org
github at latex-project.org
Thu May 18 06:18:14 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : cmd-args
Link : https://github.com/latex3/latex2e/commit/97fe725290d5d721c066494447e493dea272bd39
>---------------------------------------------------------------
commit 97fe725290d5d721c066494447e493dea272bd39
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Thu May 18 01:18:14 2023 -0300
Use 9 arguments for next and toplevel code
>---------------------------------------------------------------
97fe725290d5d721c066494447e493dea272bd39
base/lthooks.dtx | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 7e5b6c70..4c5f2de8 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -4221,6 +4221,11 @@
\tl_const:cn { c_@@_generic_include/./excluded_tl } { + }
% \end{macrocode}
%
+% \begin{macrocode}
+\tl_const:cn { c_@@_parameter_cmd/./before_tl } { #1#2#3#4#5#6#7#8#9 }
+\tl_const:cn { c_@@_parameter_cmd/./after_tl } { #1#2#3#4#5#6#7#8#9 }
+% \end{macrocode}
+%
% Deprecated generic hooks:
% \begin{macrocode}
\clist_map_inline:nn { file , package , class , include }
@@ -4373,7 +4378,7 @@
% \end{macro}
%
% \begin{macro}{\@@_cs_gput_right:nnn}
-% \begin{macro}{\@@_code_gset_auxi:nnnn,\@@_code_gset_auxi:veen}
+% \begin{macro}{\@@_code_gset_auxi:nnnn,\@@_code_gset_auxi:eeen}
% This macro is used to append code to the \verb|toplevel| and
% \verb|next| token lists, trating them correctly depending on their
% number of arguments, and depending if the code being added should
@@ -4387,7 +4392,7 @@
\cs_new_protected:Npn \@@_cs_gput_right:nnn #1 #2 #3
{
% \end{macrocode}
-% The auxiliary \cs{@@_code_gset_auxi:veen} just does the assignment
+% The auxiliary \cs{@@_code_gset_auxi:eeen} just does the assignment
% at the end. Its first argument is the parameter text of the macro,
% which is chosen here depending if
% \cs[no-index]{c_@@_\meta{hook}_parameter_tl} exists, if the hook is
@@ -4395,13 +4400,15 @@
% \begin{macrocode}
\cs_if_exist:cF { @@#1~#2 }
{ \@@_code_gset_aux:nnn {#1} {#2} { } }
- \@@_code_gset_auxi:veen
+ \@@_code_gset_auxi:eeen
{
- c_@@_
\@@_if_declared:nTF {#2}
- { #2_parameter }
- { \@@_if_generic:nTF {#2} { empty } { nine_parameters } }
- _tl
+ { \tl_use:c { c_@@_#2_parameter_tl } }
+ {
+ \@@_if_generic:nTF {#2}
+ { \@@_generic_parameter:n {#2} }
+ { \c_@@_nine_parameters_tl }
+ }
}
% \end{macrocode}
% Here we take the existing code in the macro, expand it with as many
@@ -4437,7 +4444,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_code_gset_auxi:nnnn #1 #2 #3 #4
{ \cs_gset:cpn {#4} #1 { #2 #3 } }
-\cs_generate_variant:Nn \@@_code_gset_auxi:nnnn { veen }
+\cs_generate_variant:Nn \@@_code_gset_auxi:nnnn { eeen }
% \end{macrocode}
%
% \begin{macrocode}
@@ -4511,8 +4518,8 @@
{
\cs_if_exist:cT { @@#1~#2 }
{
- \@@_code_gset_auxi:veen
- { c_@@_#2_parameter_tl }
+ \@@_code_gset_auxi:eeen
+ { \tl_use:c { c_@@_#2_parameter_tl } }
{
\exp_args:NNo \exp_args:No \@@_double_hashes:n
{
@@ -4838,6 +4845,13 @@
{ #1_parameter } { empty }
_tl \cs_end:
}
+\cs_new:Npn \@@_generic_parameter:n #1
+ { \@@_generic_parameter:w #1 / / / \s_@@_mark }
+\cs_new:Npn \@@_generic_parameter:w #1 / #2 / #3 / #4 \s_@@_mark
+ {
+ \cs_if_exist_use:cF { c_@@_parameter_#1/./#3_tl }
+ { \c_@@_empty_tl }
+ }
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
More information about the latex3-commits
mailing list.