[latex3-commits] [git/LaTeX3-latex3-latex3] master: Remove unused argument in tl-act functions (1a596b2c3)
Bruno Le Floch
blflatex at gmail.com
Tue Oct 27 09:38:01 CET 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/1a596b2c3baa548eb38bbc41a2272016c8221990
>---------------------------------------------------------------
commit 1a596b2c3baa548eb38bbc41a2272016c8221990
Author: Bruno Le Floch <blflatex at gmail.com>
Date: Tue Oct 27 09:38:01 2020 +0100
Remove unused argument in tl-act functions
>---------------------------------------------------------------
1a596b2c3baa548eb38bbc41a2272016c8221990
l3kernel/l3tl.dtx | 87 ++++++++++++++++++++++++++-----------------------------
1 file changed, 41 insertions(+), 46 deletions(-)
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 62bebed7e..d6b37c371 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -2653,18 +2653,16 @@
{
\int_eval:n
{
- \@@_act:NNNnn
- \@@_act_count_normal:nN
- \@@_act_count_group:nn
- \@@_act_count_space:n
- { }
+ \@@_act:NNNn
+ \@@_act_count_normal:N
+ \@@_act_count_group:n
+ \@@_act_count_space:
{#1}
}
}
-\cs_new:Npn \@@_act_count_normal:nN #1 #2 { 1 + }
-\cs_new:Npn \@@_act_count_space:n #1 { 1 + }
-\cs_new:Npn \@@_act_count_group:nn #1 #2
- { 2 + \tl_count_tokens:n {#2} + }
+\cs_new:Npn \@@_act_count_normal:N #1 { 1 + }
+\cs_new:Npn \@@_act_count_space: { 1 + }
+\cs_new:Npn \@@_act_count_group:n #1 { 2 + \tl_count_tokens:n {#1} + }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3152,18 +3150,18 @@
% Hence, we use a private quark, to allow any token, even quarks,
% in the token list.
% Only \cs{s_@@_act_stop} may not appear in the token lists manipulated by
-% \cs{@@_act:NNNnn} functions.
+% \cs{@@_act:NNNn} functions.
% \begin{macrocode}
\scan_new:N \s_@@_act_stop
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[EXP]{\@@_act:NNNnn}
+% \begin{macro}[EXP]{\@@_act:NNNn}
% \begin{macro}[EXP]{\@@_act_output:n, \@@_act_reverse_output:n}
% \begin{macro}[EXP]{\@@_act_loop:w}
-% \begin{macro}[EXP]{\@@_act_normal:NwnNNN}
-% \begin{macro}[EXP]{\@@_act_group:nwnNNN}
-% \begin{macro}[EXP]{\@@_act_space:wwnNNN}
+% \begin{macro}[EXP]{\@@_act_normal:NwNNN}
+% \begin{macro}[EXP]{\@@_act_group:nwNNN}
+% \begin{macro}[EXP]{\@@_act_space:wwNNN}
% \begin{macro}[EXP]{\@@_act_end:w}
% \begin{macro}[EXP]
% {
@@ -3172,7 +3170,7 @@
% \@@_act_if_head_is_space_true:w
% }
% \begin{macro}[EXP]{\@@_use_none_delimit_by_q_act_stop:w}
-% To help control the expansion, \cs{@@_act:NNNnn} should always
+% To help control the expansion, \cs{@@_act:NNNn} should always
% be preceeded by \cs{exp:w} and ends by producing \cs{exp_end:}
% once the result has been obtained. This way no internal token of it can be
% accidentally end up in the input stream.
@@ -3208,55 +3206,55 @@
% \enquote{arguments}, |#3|
% and to the head of the token list. Then repeat the loop.
% The scheme is the same if the token list starts with an |N|-type
-% or with a space. Some extra work is needed to
-% make \cs{@@_act_space:wwnNNN} gobble the space.
+% or with a space, making sure that
+% \cs{@@_act_space:wwNNN} gobbles the space.
% \begin{macrocode}
\exp_args:Nnx \use:n { \cs_new:Npn \@@_act_loop:w #1 \s_@@_act_stop }
{
\exp_not:o { \@@_act_if_head_is_space:nTF {#1} }
- \exp_not:N \@@_act_space:wwnNNN
+ \exp_not:N \@@_act_space:wwNNN
{
\exp_not:o { \tl_if_head_is_group:nTF {#1} }
- \exp_not:N \@@_act_group:nwnNNN
- \exp_not:N \@@_act_normal:NwnNNN
+ \exp_not:N \@@_act_group:nwNNN
+ \exp_not:N \@@_act_normal:NwNNN
}
\exp_not:n {#1} \s_@@_act_stop
}
\cs_undefine:N \@@_act_if_head_is_space:nTF
-\cs_new:Npn \@@_act_normal:NwnNNN #1 #2 \s_@@_act_stop #3#4
+\cs_new:Npn \@@_act_normal:NwNNN #1 #2 \s_@@_act_stop #3
{
- #4 {#3} #1
+ #3 #1
\@@_act_loop:w #2 \s_@@_act_stop
- {#3} #4
+ #3
}
\cs_new:Npn \@@_use_none_delimit_by_s_act_stop:w #1 \s_@@_act_stop { }
\cs_new:Npn \@@_act_end:wn #1 \@@_act_result:n #2
{ \group_align_safe_end: \exp_end: #2 }
-\cs_new:Npn \@@_act_group:nwnNNN #1 #2 \s_@@_act_stop #3#4#5#6
+\cs_new:Npn \@@_act_group:nwNNN #1 #2 \s_@@_act_stop #3#4#5
{
\@@_use_none_delimit_by_s_act_stop:w #1 \@@_act_end:wn \s_@@_act_stop
- #6 {#3} {#1}
+ #5 {#1}
\@@_act_loop:w #2 \s_@@_act_stop
- {#3} #4 #5 #6
+ #3 #4 #5
}
\exp_last_unbraced:NNo
- \cs_new:Npn \@@_act_space:wwnNNN \c_space_tl #1 \s_@@_act_stop #2#3#4
+ \cs_new:Npn \@@_act_space:wwNNN \c_space_tl #1 \s_@@_act_stop #2#3
{
- #4 {#2}
+ #3
\@@_act_loop:w #1 \s_@@_act_stop
- {#2} #3 #4
+ #2 #3
}
% \end{macrocode}
-% \cs{@@_act:NNNnn} loops over tokens, groups, and spaces in |#5|.
+% \cs{@@_act:NNNn} loops over tokens, groups, and spaces in |#4|.
% |{\s_@@_act_stop}| serves as the end of token list marker, the |?| after it
% avoids losing outer braces. The result is stored as an argument for the
% dummy function \cs{@@_act_result:n}.
% \begin{macrocode}
-\cs_new:Npn \@@_act:NNNnn #1#2#3#4#5
+\cs_new:Npn \@@_act:NNNn #1#2#3#4
{
\group_align_safe_begin:
- \@@_act_loop:w #5 { \s_@@_act_stop } ? \s_@@_act_stop
- {#4} #1 #3 #2
+ \@@_act_loop:w #4 { \s_@@_act_stop } ? \s_@@_act_stop
+ #1 #3 #2
\@@_act_result:n { }
}
% \end{macrocode}
@@ -3284,32 +3282,29 @@
% \begin{macro}[EXP]{\@@_reverse_group_preserve:nn}
% \begin{macro}[EXP]{\@@_reverse_space:n}
% The goal here is to reverse without losing spaces nor braces.
-% This is done using the general internal function \cs{@@_act:NNNnn}.
+% This is done using the general internal function \cs{@@_act:NNNn}.
% Spaces and \enquote{normal} tokens are output on the left of the current
% output. Grouped tokens are output to the left but without any reversal
-% within the group. All of the internal functions here drop one argument:
-% this is needed by \cs{@@_act:NNNnn} when changing case (to record
-% which direction the change is in), but not when reversing the tokens.
+% within the group.
% \begin{macrocode}
\cs_new:Npn \tl_reverse:n #1
{
\__kernel_exp_not:w \exp_after:wN
{
\exp:w
- \@@_act:NNNnn
- \@@_reverse_normal:nN
- \@@_reverse_group_preserve:nn
- \@@_reverse_space:n
- { }
+ \@@_act:NNNn
+ \@@_reverse_normal:N
+ \@@_reverse_group_preserve:n
+ \@@_reverse_space:
{#1}
}
}
\cs_generate_variant:Nn \tl_reverse:n { o , V }
-\cs_new:Npn \@@_reverse_normal:nN #1
+\cs_new:Npn \@@_reverse_normal:N
{ \@@_act_reverse_output:n }
-\cs_new:Npn \@@_reverse_group_preserve:nn #1#2
- { \@@_act_reverse_output:n { {#2} } }
-\cs_new:Npn \@@_reverse_space:n #1
+\cs_new:Npn \@@_reverse_group_preserve:n #1
+ { \@@_act_reverse_output:n { {#1} } }
+\cs_new:Npn \@@_reverse_space:
{ \@@_act_reverse_output:n { ~ } }
% \end{macrocode}
% \end{macro}
More information about the latex3-commits
mailing list.