[latex3-commits] [git/LaTeX3-latex3-latex3] master: Code formatting (26d649f26)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue Mar 3 17:59:10 CET 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/26d649f26c59f539d64160c375e31d0aadbd9d5e
>---------------------------------------------------------------
commit 26d649f26c59f539d64160c375e31d0aadbd9d5e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Feb 21 09:17:27 2020 +0000
Code formatting
>---------------------------------------------------------------
26d649f26c59f539d64160c375e31d0aadbd9d5e
l3kernel/l3keys.dtx | 180 ++++++++++++++++++++++++++--------------------------
1 file changed, 89 insertions(+), 91 deletions(-)
diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index c97845395..1be748cb9 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -967,8 +967,8 @@
% comma and |#2| will be the active equals sign.
% \begin{macrocode}
\group_begin:
-\cs_set:Npn \@@_tmp:NN #1 #2
- {
+ \cs_set_protected:Npn \@@_tmp:NN #1#2
+ {
% \end{macrocode}
% \end{macro}
%
@@ -978,10 +978,10 @@
% commas. The use of \cs{q_mark} here prevents loss of braces from the key
% argument.
% \begin{macrocode}
- \cs_new:Npn \keyval_parse:NNn ##1 ##2 ##3
- {
- \@@_loop_active:NNw ##1 ##2 \s_@@_mark ##3 #1 \s_@@_tail #1
- }
+ \cs_new:Npn \keyval_parse:NNn ##1 ##2 ##3
+ {
+ \@@_loop_active:NNw ##1 ##2 \s_@@_mark ##3 #1 \s_@@_tail #1
+ }
% \end{macrocode}
% \end{macro}
%
@@ -993,13 +993,13 @@
% If the end isn't reached yet, start the second loop splitting at other
% comments, and after that one iterate the current loop.
% \begin{macrocode}
- \cs_new:Npn \@@_loop_active:NNw ##1 ##2 ##3 #1
- {
- \@@_if_recursion_tail:w ##3
- \@@_end_loop_active:w \s_@@_mark \s_@@_tail
- \@@_loop_other:NNw ##1 ##2 ##3 , \s_@@_tail ,
- \@@_loop_active:NNw ##1 ##2 \s_@@_mark
- }
+ \cs_new:Npn \@@_loop_active:NNw ##1 ##2 ##3 #1
+ {
+ \@@_if_recursion_tail:w ##3
+ \@@_end_loop_active:w \s_@@_mark \s_@@_tail
+ \@@_loop_other:NNw ##1 ##2 ##3 , \s_@@_tail ,
+ \@@_loop_active:NNw ##1 ##2 \s_@@_mark
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1010,30 +1010,30 @@
% a single key. If there are only active equals signs split at those, else
% split at others. Finally, iterate the loop.
% \begin{macrocode}
- \cs_new:Npn \@@_loop_other:NNw ##1 ##2 ##3 ,
- {
- \@@_if_recursion_tail:w ##3
- \@@_end_loop_other:w \s_@@_mark \s_@@_tail
- \@@_if_has_equal_other:w ##3 = \s_@@_stop
- \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
- {
- \@@_if_has_equal_active:w ##3 #2 \s_@@_stop
- \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
- \@@_misplaced_equal_error:
- { \@@_split_other:wN ##3 = \s_@@_stop ##2 }
- }
- {
- \@@_if_has_equal_active:w ##3 #2 \s_@@_stop
- \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
- { \@@_split_active:wN ##3 #2 \s_@@_stop ##2 }
- {
- \@@_if_blank:w ##3 \s_@@_nil \s_@@_stop
- \@@_blank_true:w \s_@@_mark \s_@@_stop \use:n
- { \@@_trim:nN { ##3 } \@@_key:nN ##1 }
- }
- }
- \@@_loop_other:NNw ##1 ##2 \s_@@_mark
- }
+ \cs_new:Npn \@@_loop_other:NNw ##1 ##2 ##3 ,
+ {
+ \@@_if_recursion_tail:w ##3
+ \@@_end_loop_other:w \s_@@_mark \s_@@_tail
+ \@@_if_has_equal_other:w ##3 = \s_@@_stop
+ \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
+ {
+ \@@_if_has_equal_active:w ##3 #2 \s_@@_stop
+ \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
+ \@@_misplaced_equal_error:
+ { \@@_split_other:wN ##3 = \s_@@_stop ##2 }
+ }
+ {
+ \@@_if_has_equal_active:w ##3 #2 \s_@@_stop
+ \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
+ { \@@_split_active:wN ##3 #2 \s_@@_stop ##2 }
+ {
+ \@@_if_blank:w ##3 \s_@@_nil \s_@@_stop
+ \@@_blank_true:w \s_@@_mark \s_@@_stop \use:n
+ { \@@_trim:nN { ##3 } \@@_key:nN ##1 }
+ }
+ }
+ \@@_loop_other:NNw ##1 ##2 \s_@@_mark
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1044,17 +1044,17 @@
% active equals sign start trimming the spaces off the key and give control to
% \cs[no-index]{@@_key_val:nnN}.
% \begin{macrocode}
- \cs_new:Npn \@@_split_active:wN ##1 #2
- {
- \@@_trim:nN { ##1 } \@@_split_active_aux:nwN \s_@@_mark
- }
- \cs_new:Npn \@@_split_active_aux:nwN ##1 ##2 #2 ##3 \s_@@_stop
+ \cs_new:Npn \@@_split_active:wN ##1 #2
{
- \@@_if_empty:w \s_@@_mark ##3 \s_@@_stop
- \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
- { \@@_misplaced_equal_error: \use_none:n }
- { \@@_trim:nN { ##2 } \@@_key_val:nnN { ##1 } }
+ \@@_trim:nN { ##1 } \@@_split_active_aux:nwN \s_@@_mark
}
+ \cs_new:Npn \@@_split_active_aux:nwN ##1 ##2 #2 ##3 \s_@@_stop
+ {
+ \@@_if_empty:w \s_@@_mark ##3 \s_@@_stop
+ \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
+ { \@@_misplaced_equal_error: \use_none:n }
+ { \@@_trim:nN { ##2 } \@@_key_val:nnN { ##1 } }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1062,10 +1062,10 @@
% The test for an active equals sign just gobbles tokens until the first
% active equals sign and then runs the test for an empty argument.
% \begin{macrocode}
- \cs_new:Npn \@@_if_has_equal_active:w ##1 #2
- {
- \@@_if_empty:w \s_@@_mark
- }
+ \cs_new:Npn \@@_if_has_equal_active:w ##1 #2
+ {
+ \@@_if_empty:w \s_@@_mark
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1073,10 +1073,10 @@
% definition, so we can end that scope and call the temporary macro which will
% do the definitions.
% \begin{macrocode}
- }
-\char_set_catcode_active:n { `\, }
-\char_set_catcode_active:n { `\= }
-\@@_tmp:NN , =
+ }
+ \char_set_catcode_active:n { `\, }
+ \char_set_catcode_active:n { `\= }
+ \@@_tmp:NN , =
\group_end:
% \end{macrocode}
%
@@ -1208,48 +1208,46 @@
% worth it.
% \begin{macrocode}
\group_begin:
-\cs_set:Npn \@@_tmp:n #1
- {
- \cs_new:Npn \@@_trim:nN ##1
- {
- \@@_trim_auxi:w
+ \cs_set_protected:Npn \@@_tmp:n #1
+ {
+ \cs_new:Npn \@@_trim:nN ##1
+ {
+ \@@_trim_auxi:w
+ ##1
+ \s_@@_nil
+ \s_@@_mark #1 {}
+ \s_@@_mark \@@_trim_auxii:w
+ \@@_trim_auxiii:w
+ #1 \s_@@_nil
+ \@@_trim_auxiv:w
+ \s_@@_stop
+ }
+ \cs_new:Npn \@@_trim_auxi:w ##1 \s_@@_mark #1 ##2 \s_@@_mark ##3
+ {
+ ##3
+ \@@_trim_auxi:w
+ \s_@@_mark
+ ##2
+ \s_@@_mark #1 {##1}
+ }
+ \cs_new:Npn \@@_trim_auxii:w \@@_trim_auxi:w \s_@@_mark \s_@@_mark ##1
+ {
+ \@@_trim_auxiii:w
##1
- \s_@@_nil
- \s_@@_mark #1 {}
- \s_@@_mark \@@_trim_auxii:w
+ }
+ \cs_new:Npn \@@_trim_auxiii:w ##1 #1 \s_@@_nil ##2
+ {
+ ##2
+ ##1 \s_@@_nil
\@@_trim_auxiii:w
- #1 \s_@@_nil
- \@@_trim_auxiv:w
- \s_@@_stop
- }
- \cs_new:Npn \@@_trim_auxi:w ##1 \s_@@_mark #1 ##2 \s_@@_mark ##3
- {
- ##3
- \@@_trim_auxi:w
- \s_@@_mark
- ##2
- \s_@@_mark #1 {##1}
- }
- \cs_new:Npn \@@_trim_auxii:w \@@_trim_auxi:w \s_@@_mark \s_@@_mark ##1
- {
- \@@_trim_auxiii:w
- ##1
- }
- \cs_new:Npn \@@_trim_auxiii:w ##1 #1 \s_@@_nil ##2
- {
- ##2
- ##1 \s_@@_nil
- \@@_trim_auxiii:w
- }
+ }
% \end{macrocode}
% This is the one macro which differs from the original definition.
% \begin{macrocode}
- \cs_new:Npn \@@_trim_auxiv:w \s_@@_mark ##1 \s_@@_nil ##2 \s_@@_stop ##3
- {
- ##3 { ##1 }
- }
- }
-\@@_tmp:n { ~ }
+ \cs_new:Npn \@@_trim_auxiv:w \s_@@_mark ##1 \s_@@_nil ##2 \s_@@_stop ##3
+ { ##3 { ##1 } }
+ }
+ \@@_tmp:n { ~ }
\group_end:
% \end{macrocode}
% \end{macro}
More information about the latex3-commits
mailing list.