[latex3-commits] [git/LaTeX3-latex3-latex3] master: Indenting (4e275cb)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue Apr 3 23:28:56 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/4e275cbc79196acf026bb24888f11503136528dd
>---------------------------------------------------------------
commit 4e275cbc79196acf026bb24888f11503136528dd
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Apr 3 22:28:56 2018 +0100
Indenting
... to make things clearer for non-experts.
>---------------------------------------------------------------
4e275cbc79196acf026bb24888f11503136528dd
l3kernel/l3fp-random.dtx | 256 +++++++++++++++++++++++-----------------------
1 file changed, 128 insertions(+), 128 deletions(-)
diff --git a/l3kernel/l3fp-random.dtx b/l3kernel/l3fp-random.dtx
index a3d24b2..c1c294e 100644
--- a/l3kernel/l3fp-random.dtx
+++ b/l3kernel/l3fp-random.dtx
@@ -109,11 +109,11 @@
% of \cs{int_rand:nn}. We also use variants of this number
% rounded down to multiples of $10^4$ and $10^8$.
% \begin{macrocode}
-\cs_new:Npn \@@_rand_uniform:
- { \pdftex_uniformdeviate:D \c_@@_rand_size_int }
-\int_const:Nn \c_@@_rand_size_int { 268 435 456 }
-\int_const:Nn \c_@@_rand_four_int { 268 430 000 }
-\int_const:Nn \c_@@_rand_eight_int { 200 000 000 }
+ \cs_new:Npn \@@_rand_uniform:
+ { \pdftex_uniformdeviate:D \c_@@_rand_size_int }
+ \int_const:Nn \c_@@_rand_size_int { 268 435 456 }
+ \int_const:Nn \c_@@_rand_four_int { 268 430 000 }
+ \int_const:Nn \c_@@_rand_eight_int { 200 000 000 }
% \end{macrocode}
% \end{variable}
% \end{macro}
@@ -137,50 +137,50 @@
% characters from the input stream with \cs{use_i:nnn}, \cs{use_i:nn}
% or nothing.
% \begin{macrocode}
-\cs_new:Npn \@@_rand_myriads:n #1
- {
- \@@_rand_myriads_loop:nn #1
- { ? \use_i_delimit_by_q_stop:nw \@@_rand_myriads_last: }
- { ? \use_none_delimit_by_q_stop:w } \q_stop
- }
-\cs_new:Npn \@@_rand_myriads_loop:nn #1#2
- {
- \use_none:n #2
- \exp_after:wN \@@_rand_myriads_get:w
- \int_value:w \@@_rand_uniform: ; {#1}{#2}
- }
-\cs_new:Npn \@@_rand_myriads_get:w #1 ;
- {
- \if_int_compare:w #1 < \c_@@_rand_eight_int
- \exp_after:wN \use_none:n
- \int_value:w \@@_int_eval:w
- \c_@@_rand_eight_int + #1 \@@_int_eval_end:
- \exp_after:wN \use_i:nnn
- \else:
- \if_int_compare:w #1 < \c_@@_rand_four_int
- \exp_after:wN \use_none:nnnnn
- \int_value:w \@@_int_eval:w
- \c_@@_rand_four_int + #1 \@@_int_eval_end:
- \exp_after:wN \exp_after:wN \exp_after:wN \use_i:nn
- \fi:
- \fi:
- \@@_rand_myriads_loop:nn
- }
-\cs_new:Npn \@@_rand_myriads_last:
- {
- \exp_after:wN \@@_rand_myriads_last:w
- \int_value:w \@@_rand_uniform: ;
- }
-\cs_new:Npn \@@_rand_myriads_last:w #1 ;
- {
- \if_int_compare:w #1 < \c_@@_rand_four_int
- \exp_after:wN \use_none:nnnnn
- \int_value:w \@@_int_eval:w
- \c_@@_rand_four_int + #1 \@@_int_eval_end:
- \else:
- \exp_after:wN \@@_rand_myriads_last:
- \fi:
- }
+ \cs_new:Npn \@@_rand_myriads:n #1
+ {
+ \@@_rand_myriads_loop:nn #1
+ { ? \use_i_delimit_by_q_stop:nw \@@_rand_myriads_last: }
+ { ? \use_none_delimit_by_q_stop:w } \q_stop
+ }
+ \cs_new:Npn \@@_rand_myriads_loop:nn #1#2
+ {
+ \use_none:n #2
+ \exp_after:wN \@@_rand_myriads_get:w
+ \int_value:w \@@_rand_uniform: ; {#1}{#2}
+ }
+ \cs_new:Npn \@@_rand_myriads_get:w #1 ;
+ {
+ \if_int_compare:w #1 < \c_@@_rand_eight_int
+ \exp_after:wN \use_none:n
+ \int_value:w \@@_int_eval:w
+ \c_@@_rand_eight_int + #1 \@@_int_eval_end:
+ \exp_after:wN \use_i:nnn
+ \else:
+ \if_int_compare:w #1 < \c_@@_rand_four_int
+ \exp_after:wN \use_none:nnnnn
+ \int_value:w \@@_int_eval:w
+ \c_@@_rand_four_int + #1 \@@_int_eval_end:
+ \exp_after:wN \exp_after:wN \exp_after:wN \use_i:nn
+ \fi:
+ \fi:
+ \@@_rand_myriads_loop:nn
+ }
+ \cs_new:Npn \@@_rand_myriads_last:
+ {
+ \exp_after:wN \@@_rand_myriads_last:w
+ \int_value:w \@@_rand_uniform: ;
+ }
+ \cs_new:Npn \@@_rand_myriads_last:w #1 ;
+ {
+ \if_int_compare:w #1 < \c_@@_rand_four_int
+ \exp_after:wN \use_none:nnnnn
+ \int_value:w \@@_int_eval:w
+ \c_@@_rand_four_int + #1 \@@_int_eval_end:
+ \else:
+ \exp_after:wN \@@_rand_myriads_last:
+ \fi:
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -192,18 +192,18 @@
% First we check that |random| was called without argument. Then get
% four blocks of four digits.
% \begin{macrocode}
-\cs_new:Npn \@@_rand_o:Nw ? #1 @
- {
- \tl_if_empty:nTF {#1}
- { \@@_rand_o: }
+ \cs_new:Npn \@@_rand_o:Nw ? #1 @
{
- \__kernel_msg_expandable_error:nnnnn
- { kernel } { fp-num-args } { rand() } { 0 } { 0 }
- \exp_after:wN \c_nan_fp
+ \tl_if_empty:nTF {#1}
+ { \@@_rand_o: }
+ {
+ \__kernel_msg_expandable_error:nnnnn
+ { kernel } { fp-num-args } { rand() } { 0 } { 0 }
+ \exp_after:wN \c_nan_fp
+ }
}
- }
-\cs_new:Npn \@@_rand_o:
- { \@@_parse_o:n { . \@@_rand_myriads:n { xxxx } } }
+ \cs_new:Npn \@@_rand_o:
+ { \@@_parse_o:n { . \@@_rand_myriads:n { xxxx } } }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -244,83 +244,83 @@
% bound. The result is compared to the upper bound and the process
% repeats if needed.
% \begin{macrocode}
-\cs_new:Npn \@@_randint_o:Nw ?
- {
- \@@_parse_function_one_two:nnw
- { randint }
- { \@@_randint_default:w \@@_randint_o:w }
- }
-\cs_new:Npn \@@_randint_default:w #1 { \exp_after:wN #1 \c_one_fp }
-\cs_new:Npn \@@_randint_badarg:w \s_@@ \@@_chk:w #1#2#3;
- {
- \@@_int:wTF \s_@@ \@@_chk:w #1#2#3;
+ \cs_new:Npn \@@_randint_o:Nw ?
{
- \if_meaning:w 1 #1
- \if_int_compare:w
- \use_i_delimit_by_q_stop:nw #3 \q_stop > \c_@@_prec_int
- 1 \exp_stop_f:
- \fi:
+ \@@_parse_function_one_two:nnw
+ { randint }
+ { \@@_randint_default:w \@@_randint_o:w }
+ }
+ \cs_new:Npn \@@_randint_default:w #1 { \exp_after:wN #1 \c_one_fp }
+ \cs_new:Npn \@@_randint_badarg:w \s_@@ \@@_chk:w #1#2#3;
+ {
+ \@@_int:wTF \s_@@ \@@_chk:w #1#2#3;
+ {
+ \if_meaning:w 1 #1
+ \if_int_compare:w
+ \use_i_delimit_by_q_stop:nw #3 \q_stop > \c_@@_prec_int
+ 1 \exp_stop_f:
+ \fi:
+ \fi:
+ }
+ { 1 \exp_stop_f: }
+ }
+ \cs_new:Npn \@@_randint_o:w #1; #2; @
+ {
+ \if_case:w
+ \@@_randint_badarg:w #1;
+ \@@_randint_badarg:w #2;
+ \fp_compare:nNnTF { #1; } > { #2; } { 1 } { 0 } \exp_stop_f:
+ \exp_after:wN \exp_after:wN \exp_after:wN \@@_randint_e:wnn
+ \@@_parse:n { #2; - #1; } { #1; } { #2; }
+ \or:
+ \@@_invalid_operation_tl_o:ff
+ { randint } { \@@_array_to_clist:n { #1; #2; } }
+ \exp:w
\fi:
+ \exp_after:wN \exp_end:
}
- { 1 \exp_stop_f: }
- }
-\cs_new:Npn \@@_randint_o:w #1; #2; @
- {
- \if_case:w
- \@@_randint_badarg:w #1;
- \@@_randint_badarg:w #2;
- \fp_compare:nNnTF { #1; } > { #2; } { 1 } { 0 } \exp_stop_f:
- \exp_after:wN \exp_after:wN \exp_after:wN \@@_randint_e:wnn
- \@@_parse:n { #2; - #1; } { #1; } { #2; }
- \or:
- \@@_invalid_operation_tl_o:ff
- { randint } { \@@_array_to_clist:n { #1; #2; } }
- \exp:w
- \fi:
- \exp_after:wN \exp_end:
- }
-\cs_new:Npn \@@_randint_e:wnn #1;
- {
- \exp_after:wN \@@_randint_e:wwNnn
- \int_value:w \@@_rand_uniform: \exp_after:wN ;
- \exp:w \exp_end_continue_f:w
- \fp_compare:nNnTF { #1 ; } < \c_@@_rand_size_int
- { \fp_to_int:n { #1 ; + 1 } ; \@@_randint_narrow_e:nnnn }
- { \fp_to_int:n { floor(#1 ; * 1e-8 + 1) } ; \@@_randint_wide_e:nnnn }
- }
-\cs_new:Npn \@@_randint_e:wwNnn #1 ; #2 ;
- {
- \exp_after:wN \@@_randint_e:wwwNnn
- \int_value:w \int_mod:nn {#1} {#2} ; #1 ; #2 ;
- }
-\cs_new:Npn \@@_randint_e:wwwNnn #1 ; #2 ; #3 ; #4
- {
- \int_compare:nNnTF { #2 - #1 + #3 } > \c_@@_rand_size_int
+ \cs_new:Npn \@@_randint_e:wnn #1;
{
\exp_after:wN \@@_randint_e:wwNnn
- \int_value:w \@@_rand_uniform: ; #3 ; #4
+ \int_value:w \@@_rand_uniform: \exp_after:wN ;
+ \exp:w \exp_end_continue_f:w
+ \fp_compare:nNnTF { #1 ; } < \c_@@_rand_size_int
+ { \fp_to_int:n { #1 ; + 1 } ; \@@_randint_narrow_e:nnnn }
+ { \fp_to_int:n { floor(#1 ; * 1e-8 + 1) } ; \@@_randint_wide_e:nnnn }
}
- { #4 {#1} {#3} }
- }
-\cs_new:Npn \@@_randint_narrow_e:nnnn #1#2#3#4
- { \@@_parse_o:n { #3 + #1 } \exp:w }
-\cs_new:Npn \@@_randint_wide_e:nnnn #1#2#3#4
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \@@_randint_wide_e:wnnn
- \@@_parse:n { #3 + #1e8 + \@@_rand_myriads:n { xx } }
- {#2} {#3} {#4}
- }
-\cs_new:Npn \@@_randint_wide_e:wnnn #1 ; #2#3#4
- {
- \fp_compare:nNnTF { #1 ; } > {#4}
+ \cs_new:Npn \@@_randint_e:wwNnn #1 ; #2 ;
{
- \exp_after:wN \@@_randint_e:wwNnn
- \int_value:w \@@_rand_uniform: ; #2 ;
- \@@_randint_wide_e:nnnn {#3} {#4}
+ \exp_after:wN \@@_randint_e:wwwNnn
+ \int_value:w \int_mod:nn {#1} {#2} ; #1 ; #2 ;
+ }
+ \cs_new:Npn \@@_randint_e:wwwNnn #1 ; #2 ; #3 ; #4
+ {
+ \int_compare:nNnTF { #2 - #1 + #3 } > \c_@@_rand_size_int
+ {
+ \exp_after:wN \@@_randint_e:wwNnn
+ \int_value:w \@@_rand_uniform: ; #3 ; #4
+ }
+ { #4 {#1} {#3} }
+ }
+ \cs_new:Npn \@@_randint_narrow_e:nnnn #1#2#3#4
+ { \@@_parse_o:n { #3 + #1 } \exp:w }
+ \cs_new:Npn \@@_randint_wide_e:nnnn #1#2#3#4
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \@@_randint_wide_e:wnnn
+ \@@_parse:n { #3 + #1e8 + \@@_rand_myriads:n { xx } }
+ {#2} {#3} {#4}
+ }
+ \cs_new:Npn \@@_randint_wide_e:wnnn #1 ; #2#3#4
+ {
+ \fp_compare:nNnTF { #1 ; } > {#4}
+ {
+ \exp_after:wN \@@_randint_e:wwNnn
+ \int_value:w \@@_rand_uniform: ; #2 ;
+ \@@_randint_wide_e:nnnn {#3} {#4}
+ }
+ { \@@_exp_after_o:w #1 ; \exp:w }
}
- { \@@_exp_after_o:w #1 ; \exp:w }
- }
% \end{macrocode}
% \end{macro}
% \end{macro}
More information about the latex3-commits
mailing list