diff options
author | Karl Berry <karl@freefriends.org> | 2023-05-05 21:23:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-05-05 21:23:26 +0000 |
commit | 847808083e98635eb04dad9a4fb45ee3936f5520 (patch) | |
tree | a1db51910bc0b3e2f49eb6fb17260dad92718979 /Master/texmf-dist/tex/latex/l3kernel | |
parent | 7ba90ca45bbdc7354c25890431ec21f1a9f58ffd (diff) |
l3kernel (5may23)
git-svn-id: svn://tug.org/texlive/trunk@67026 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex | 1184 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3.ltx | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3debug.def | 2 |
5 files changed, 476 insertions, 716 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex index 6e79139e1e0..2b822a03cdf 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex @@ -71,7 +71,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2023-04-20}% +\def\ExplFileDate{2023-05-05}% \begingroup \def\next{\endgroup}% \expandafter\ifx\csname PackageError\endcsname\relax @@ -5838,50 +5838,42 @@ Type H <return> for immediate help}\def~{\errmessage{% } \prg_generate_conditional_variant:Nnn \seq_if_empty:N { c } { p , T , F , TF } -\cs_if_exist:NTF \tex_uniformdeviate:D +\seq_new:N \g__seq_internal_seq +\cs_new_protected:Npn \seq_shuffle:N { \__seq_shuffle:NN \seq_set_eq:NN } +\cs_new_protected:Npn \seq_gshuffle:N { \__seq_shuffle:NN \seq_gset_eq:NN } +\cs_new_protected:Npn \__seq_shuffle:NN #1#2 { - \seq_new:N \g__seq_internal_seq - \cs_new_protected:Npn \seq_shuffle:N { \__seq_shuffle:NN \seq_set_eq:NN } - \cs_new_protected:Npn \seq_gshuffle:N { \__seq_shuffle:NN \seq_gset_eq:NN } - \cs_new_protected:Npn \__seq_shuffle:NN #1#2 + \int_compare:nNnTF { \seq_count:N #2 } > \c_max_register_int { - \int_compare:nNnTF { \seq_count:N #2 } > \c_max_register_int - { - \msg_error:nnx { seq } { shuffle-too-large } - { \token_to_str:N #2 } - } - { - \group_begin: - \int_zero:N \l__seq_internal_a_int - \__seq_push_item_def: - \cs_gset_eq:NN \__seq_item:n \__seq_shuffle_item:n - #2 - \__seq_pop_item_def: - \seq_gset_from_inline_x:Nnn \g__seq_internal_seq - { \int_step_function:nN { \l__seq_internal_a_int } } - { \tex_the:D \tex_toks:D ##1 } - \group_end: - #1 #2 \g__seq_internal_seq - \seq_gclear:N \g__seq_internal_seq - } + \msg_error:nnx { seq } { shuffle-too-large } + { \token_to_str:N #2 } } - \cs_new_protected:Npn \__seq_shuffle_item:n { - \int_incr:N \l__seq_internal_a_int - \int_set:Nn \l__seq_internal_b_int - { 1 + \tex_uniformdeviate:D \l__seq_internal_a_int } - \tex_toks:D \l__seq_internal_a_int - = \tex_toks:D \l__seq_internal_b_int - \tex_toks:D \l__seq_internal_b_int - } + \group_begin: + \int_zero:N \l__seq_internal_a_int + \__seq_push_item_def: + \cs_gset_eq:NN \__seq_item:n \__seq_shuffle_item:n + #2 + \__seq_pop_item_def: + \seq_gclear:N \g__seq_internal_seq + \int_step_inline:nn \l__seq_internal_a_int + { + \seq_gput_right:Nx \g__seq_internal_seq + { \tex_the:D \tex_toks:D ##1 } + } + \group_end: + #1 #2 \g__seq_internal_seq + \seq_gclear:N \g__seq_internal_seq + } } +\cs_new_protected:Npn \__seq_shuffle_item:n { - \cs_new_protected:Npn \seq_shuffle:N #1 - { - \msg_error:nnn { kernel } { fp-no-random } - { \seq_shuffle:N #1 } - } - \cs_new_eq:NN \seq_gshuffle:N \seq_shuffle:N + \int_incr:N \l__seq_internal_a_int + \int_set:Nn \l__seq_internal_b_int + { 1 + \tex_uniformdeviate:D \l__seq_internal_a_int } + \tex_toks:D \l__seq_internal_a_int + = \tex_toks:D \l__seq_internal_b_int + \tex_toks:D \l__seq_internal_b_int } \cs_generate_variant:Nn \seq_shuffle:N { c } \cs_generate_variant:Nn \seq_gshuffle:N { c } @@ -7117,11 +7109,11 @@ Type H <return> for immediate help}\def~{\errmessage{% \cs_new_eq:NN \int_show:N \__kernel_register_show:N \cs_generate_variant:Nn \int_show:N { c } \cs_new_protected:Npn \int_show:n - { \msg_show_eval:Nn \int_eval:n } + { \__kernel_msg_show_eval:Nn \int_eval:n } \cs_new_eq:NN \int_log:N \__kernel_register_log:N \cs_generate_variant:Nn \int_log:N { c } \cs_new_protected:Npn \int_log:n - { \msg_log_eval:Nn \int_eval:n } + { \__kernel_msg_log_eval:Nn \int_eval:n } \int_const:Nn \c_one_int { 1 } \int_const:Nn \c_max_int { 2 147 483 647 } \int_const:Nn \c_max_char_int @@ -7199,6 +7191,13 @@ Type H <return> for immediate help}\def~{\errmessage{% \cs:w flag~#1 \exp_after:wN \cs_end: \int_value:w \flag_height:n {#1} ; } +\cs_new:Npn \flag_ensure_raised:n #1 + { + \if_cs_exist:w flag~#1~0 \cs_end: + \else: + \cs:w flag~#1 \cs_end: 0 ; + \fi: + } %% File: l3prg.dtx \cs_new_eq:NN \if_predicate:w \tex_ifodd:D \cs_new_protected:Npn \bool_new:N #1 { \cs_new_eq:NN #1 \c_false_bool } @@ -7237,6 +7236,12 @@ Type H <return> for immediate help}\def~{\errmessage{% } \cs_generate_variant:Nn \bool_set:Nn { c } \cs_generate_variant:Nn \bool_gset:Nn { c } +\cs_new_protected:Npn \bool_set_inverse:N #1 + { \bool_if:NTF #1 { \bool_set_false:N } { \bool_set_true:N } #1 } +\cs_generate_variant:Nn \bool_set_inverse:N { c } +\cs_new_protected:Npn \bool_gset_inverse:N #1 + { \bool_if:NTF #1 { \bool_gset_false:N } { \bool_gset_true:N } #1 } +\cs_generate_variant:Nn \bool_gset_inverse:N { c } \quark_new:N \q__bool_recursion_tail \quark_new:N \q__bool_recursion_stop \cs_new:Npn \__bool_use_i_delimit_by_q_recursion_stop:nw @@ -7255,9 +7260,9 @@ Type H <return> for immediate help}\def~{\errmessage{% \cs_generate_variant:Nn \bool_to_str:N { c } \cs_new:Npn \bool_to_str:n #1 { \bool_if:nTF {#1} { true } { false } } \cs_new_protected:Npn \bool_show:n - { \msg_show_eval:Nn \bool_to_str:n } + { \__kernel_msg_show_eval:Nn \bool_to_str:n } \cs_new_protected:Npn \bool_log:n - { \msg_log_eval:Nn \bool_to_str:n } + { \__kernel_msg_log_eval:Nn \bool_to_str:n } \cs_new_protected:Npn \bool_show:N { \__bool_show:NN \tl_show:n } \cs_generate_variant:Nn \bool_show:N { c } \cs_new_protected:Npn \bool_log:N { \__bool_show:NN \tl_log:n } @@ -7444,6 +7449,29 @@ Type H <return> for immediate help}\def~{\errmessage{% #2 \bool_if:nF {#1} { \bool_do_until:nn {#1} {#2} } } +\scan_new:N \s__bool_mark +\scan_new:N \s__bool_stop +\cs_new:Npn \bool_case:nTF + { \exp:w \__bool_case:nTF } +\cs_new:Npn \bool_case:nT #1#2 + { \exp:w \__bool_case:nTF {#1} {#2} { } } +\cs_new:Npn \bool_case:nF #1 + { \exp:w \__bool_case:nTF {#1} { } } +\cs_new:Npn \bool_case:n #1 + { \exp:w \__bool_case:nTF {#1} { } { } } +\cs_new:Npn \__bool_case:nTF #1#2#3 + { + \__bool_case:w + #1 \c_true_bool { } \s__bool_mark {#2} \s__bool_mark {#3} \s__bool_stop + } +\cs_new:Npn \__bool_case:w #1#2 + { + \bool_if:nTF {#1} + { \__bool_case_end:nw {#2} } + { \__bool_case:w } + } +\cs_new:Npn \__bool_case_end:nw #1#2#3 \s__bool_mark #4#5 \s__bool_stop + { \exp_end: #1 #4 } \cs_new:Npn \prg_replicate:nn #1 { \exp:w @@ -7594,8 +7622,63 @@ Type H <return> for immediate help}\def~{\errmessage{% } { unknown } } -\__sys_const:nn { sys_if_rand_exist } - { \cs_if_exist_p:N \tex_uniformdeviate:D } +\str_const:Nx \c_sys_engine_version_str + { + \str_case:on \c_sys_engine_str + { + { pdftex } + { + \int_div_truncate:nn { \tex_pdftexversion:D } { 100 } + . + \int_mod:nn { \tex_pdftexversion:D } { 100 } + . + \tex_pdftexrevision:D + } + { ptex } + { + \cs_if_exist:NT \tex_ptexversion:D + { + p + \int_use:N \tex_ptexversion:D + . + \int_use:N \tex_ptexminorversion:D + \tex_ptexrevision:D + - + \int_use:N \tex_epTeXversion:D + } + } + { luatex } + { + \int_div_truncate:nn { \tex_luatexversion:D } { 100 } + . + \int_mod:nn { \tex_luatexversion:D } { 100 } + . + \tex_luatexrevision:D + } + { uptex } + { + \cs_if_exist:NT \tex_ptexversion:D + { + p + \int_use:N \tex_ptexversion:D + . + \int_use:N \tex_ptexminorversion:D + \tex_ptexrevision:D + - + u + \int_use:N \tex_uptexversion:D + \tex_uptexrevision:D + - + \int_use:N \tex_epTeXversion:D + } + } + { xetex } + { + \int_use:N \tex_XeTeXversion:D + \tex_XeTeXrevision:D + } + } + } \cs_new_protected:Npn \sys_load_backend:n #1 { \sys_finalise: @@ -7786,32 +7869,12 @@ Type H <return> for immediate help}\def~{\errmessage{% } \__sys_everyjob:n { - \sys_if_rand_exist:TF - { \cs_new:Npn \sys_rand_seed: { \tex_the:D \tex_randomseed:D } } - { - \cs_new:Npn \sys_rand_seed: - { - \int_value:w - \msg_expandable_error:nnn { kernel } { fp-no-random } - { \sys_rand_seed: } - \c_zero_int - } - } + \cs_new:Npn \sys_rand_seed: { \tex_the:D \tex_randomseed:D } } \__sys_everyjob:n { - \sys_if_rand_exist:TF - { - \cs_new_protected:Npn \sys_gset_rand_seed:n #1 - { \tex_setrandomseed:D \int_eval:n {#1} \exp_stop_f: } - } - { - \cs_new_protected:Npn \sys_gset_rand_seed:n #1 - { - \msg_error:nnn { kernel } { fp-no-random } - { \sys_gset_rand_seed:n {#1} } - } - } + \cs_new_protected:Npn \sys_gset_rand_seed:n #1 + { \tex_setrandomseed:D \int_eval:n {#1} \exp_stop_f: } } \sys_if_engine_luatex:TF { @@ -8961,6 +9024,11 @@ Type H <return> for immediate help}\def~{\errmessage{% } \cs_new:Npn \__char_str_change_case:n #1 { \char_generate:nn {#1} { 12 } } +\group_begin: + \char_set_catcode_active:N * + \char_set_lccode:nn { `* } { `\ } + \tex_lowercase:D { \tl_const:Nn \c_catcode_active_space_tl { * } } +\group_end: \tl_const:Nx \c_catcode_other_space_tl { \char_generate:nn { `\ } { 12 } } \scan_new:N \s__token_mark \scan_new:N \s__token_stop @@ -10248,6 +10316,24 @@ Type H <return> for immediate help}\def~{\errmessage{% } } \group_end: +\cs_new:Npx \msg_show_item:n #1 + { ^^J > ~ \c_space_tl \exp_not:N \tl_to_str:n { {#1} } } +\cs_new:Npx \msg_show_item_unbraced:n #1 + { ^^J > ~ \c_space_tl \exp_not:N \tl_to_str:n {#1} } +\cs_new:Npx \msg_show_item:nn #1#2 + { + ^^J > \use:nn { ~ } { ~ } + \exp_not:N \tl_to_str:n { {#1} } + \use:nn { ~ } { ~ } => \use:nn { ~ } { ~ } + \exp_not:N \tl_to_str:n { {#2} } + } +\cs_new:Npx \msg_show_item_unbraced:nn #1#2 + { + ^^J > \use:nn { ~ } { ~ } + \exp_not:N \tl_to_str:n {#1} + \use:nn { ~ } { ~ } => \use:nn { ~ } { ~ } + \exp_not:N \tl_to_str:n {#2} + } \cs_new:Npn \__msg_class_chk_exist:nT #1 { \cs_if_free:cTF { __msg_ #1 _code:nnnnnn } @@ -10382,6 +10468,11 @@ Type H <return> for immediate help}\def~{\errmessage{% } \cs_generate_variant:Nn \__msg_redirect_loop_chk:nnn { o } \cs_new:Npn \__msg_redirect_loop_list:n #1 { {#1} ~ => ~ } +\cs_new_protected:Npn \__kernel_msg_show_eval:Nn #1#2 + { \exp_args:Nf \__msg_show_eval:nnN { #1 {#2} } {#2} \tl_show:n } +\cs_new_protected:Npn \__kernel_msg_log_eval:Nn #1#2 + { \exp_args:Nf \__msg_show_eval:nnN { #1 {#2} } {#2} \tl_log:n } +\cs_new_protected:Npn \__msg_show_eval:nnN #1#2#3 { #3 { #2 = #1 } } \cs_new_protected:Npn \__kernel_msg_new:nnnn #1 { \msg_new:nnnn { LaTeX / #1 } } \cs_new_protected:Npn \__kernel_msg_new:nnn #1 @@ -10854,6 +10945,27 @@ Type H <return> for immediate help}\def~{\errmessage{% { {#2} } { \exp_not:N \__kernel_file_name_quote:n {#2} \scan_stop: } } +\cs_new_protected:Npn \ior_shell_open:Nn #1#2 + { + \sys_if_shell:TF + { \exp_args:No \__ior_shell_open:nN { \tl_to_str:n {#2} } #1 } + { \msg_error:nn { ior } { pipe-failed } } + } +\cs_new_protected:Npn \__ior_shell_open:nN #1#2 + { + \tl_if_in:nnTF {#1} { " } + { + \msg_error:nnx + { kernel } { quote-in-shell } {#1} + } + { \__kernel_ior_open:Nn #2 { |#1 } } + } +\msg_new:nnnn { ior } { pipe-failed } + { Cannot~run~piped~system~commands. } + { + LaTeX~tried~to~call~a~system~process~but~this~was~not~possible.\\ + Try~the~"--shell-escape"~(or~"--enable-pipes")~option. + } \cs_new_protected:Npn \ior_close:N #1 { \int_compare:nT { -1 < #1 < \c__ior_term_ior } @@ -11184,16 +11296,16 @@ Type H <return> for immediate help}\def~{\errmessage{% \c_catcode_other_space_tl } } -\cs_new_protected:Npn \iow_allow_break: +\cs_new_protected:Npn \iow_wrap_allow_break: { \msg_error:nnnn { kernel } { iow-indent } - { \iow_wrap:nnnN } { \iow_allow_break: } + { \iow_wrap:nnnN } { \iow_wrap_allow_break: } } -\cs_new:Npx \__iow_allow_break: { \c__iow_wrap_allow_break_marker_tl } -\cs_new:Npn \__iow_allow_break_error: +\cs_new:Npx \__iow_wrap_allow_break: { \c__iow_wrap_allow_break_marker_tl } +\cs_new:Npn \__iow_wrap_allow_break_error: { \msg_expandable_error:nnnn { kernel } { iow-indent } - { \iow_wrap:nnnN } { \iow_allow_break: } + { \iow_wrap:nnnN } { \iow_wrap_allow_break: } } \cs_new_protected:Npn \iow_indent:n #1 { @@ -11226,12 +11338,12 @@ Type H <return> for immediate help}\def~{\errmessage{% \int_set:Nn \tex_escapechar:D { 92 } \cs_set_eq:NN \\ \iow_newline: \cs_set_eq:NN \ \c_catcode_other_space_tl - \cs_set_eq:NN \iow_allow_break: \__iow_allow_break: + \cs_set_eq:NN \iow_wrap_allow_break: \__iow_wrap_allow_break: \cs_set_eq:NN \iow_indent:n \__iow_indent:n #3 \cs_set_eq:NN \protect \token_to_str:N \__kernel_tl_set:Nx \l__iow_wrap_tl {#1} - \cs_set_eq:NN \iow_allow_break: \__iow_allow_break_error: + \cs_set_eq:NN \iow_wrap_allow_break: \__iow_wrap_allow_break_error: \cs_set_eq:NN \iow_indent:n \__iow_indent_error:n \__kernel_tl_set:Nx \l__iow_newline_tl { \iow_newline: #2 } \__kernel_tl_set:Nx \l__iow_newline_tl { \tl_to_str:N \l__iow_newline_tl } @@ -12646,11 +12758,11 @@ Type H <return> for immediate help}\def~{\errmessage{% \cs_new_eq:NN \dim_show:N \__kernel_register_show:N \cs_generate_variant:Nn \dim_show:N { c } \cs_new_protected:Npn \dim_show:n - { \msg_show_eval:Nn \dim_eval:n } + { \__kernel_msg_show_eval:Nn \dim_eval:n } \cs_new_eq:NN \dim_log:N \__kernel_register_log:N \cs_new_eq:NN \dim_log:c \__kernel_register_log:c \cs_new_protected:Npn \dim_log:n - { \msg_log_eval:Nn \dim_eval:n } + { \__kernel_msg_log_eval:Nn \dim_eval:n } \dim_const:Nn \c_zero_dim { 0 pt } \dim_const:Nn \c_max_dim { 16383.99999 pt } \dim_new:N \l_tmpa_dim @@ -12738,11 +12850,11 @@ Type H <return> for immediate help}\def~{\errmessage{% \cs_new_eq:NN \skip_show:N \__kernel_register_show:N \cs_generate_variant:Nn \skip_show:N { c } \cs_new_protected:Npn \skip_show:n - { \msg_show_eval:Nn \skip_eval:n } + { \__kernel_msg_show_eval:Nn \skip_eval:n } \cs_new_eq:NN \skip_log:N \__kernel_register_log:N \cs_new_eq:NN \skip_log:c \__kernel_register_log:c \cs_new_protected:Npn \skip_log:n - { \msg_log_eval:Nn \skip_eval:n } + { \__kernel_msg_log_eval:Nn \skip_eval:n } \skip_const:Nn \c_zero_skip { \c_zero_dim } \skip_const:Nn \c_max_skip { \c_max_dim } \skip_new:N \l_tmpa_skip @@ -12806,11 +12918,11 @@ Type H <return> for immediate help}\def~{\errmessage{% \cs_new_eq:NN \muskip_show:N \__kernel_register_show:N \cs_generate_variant:Nn \muskip_show:N { c } \cs_new_protected:Npn \muskip_show:n - { \msg_show_eval:Nn \muskip_eval:n } + { \__kernel_msg_show_eval:Nn \muskip_eval:n } \cs_new_eq:NN \muskip_log:N \__kernel_register_log:N \cs_new_eq:NN \muskip_log:c \__kernel_register_log:c \cs_new_protected:Npn \muskip_log:n - { \msg_log_eval:Nn \muskip_eval:n } + { \__kernel_msg_log_eval:Nn \muskip_eval:n } \muskip_const:Nn \c_zero_muskip { 0 mu } \muskip_const:Nn \c_max_muskip { 16383.99999 mu } \muskip_new:N \l_tmpa_muskip @@ -14302,8 +14414,6 @@ Type H <return> for immediate help}\def~{\errmessage{% \__kernel_intarray_gset:Nnn #1 \l__intarray_loop_int { \int_eval:n {##1} } } } \cs_generate_variant:Nn \intarray_const_from_clist:Nn { c } - \cs_new:Npn \intarray_to_clist:N #1 { \__intarray_to_clist:Nn #1 { , } } - \cs_generate_variant:Nn \intarray_to_clist:N { c } \cs_new:Npn \__kernel_intarray_range_to_clist:Nnn #1#2#3 { \__intarray_range_to_clist:w #1 @@ -14451,8 +14561,6 @@ Type H <return> for immediate help}\def~{\errmessage{% \__intarray_gset_overflow_test:nw {#1} \__kernel_intarray_gset:Nnn #2 \l__intarray_loop_int {#1} } - \cs_new:Npn \intarray_to_clist:N #1 { \__intarray_to_clist:Nn #1 { , } } - \cs_generate_variant:Nn \intarray_to_clist:N { c } \cs_new:Npn \__intarray_to_clist:Nn #1#2 { \int_compare:nNnF { \intarray_count:N #1 } = \c_zero_int @@ -14519,73 +14627,6 @@ Type H <return> for immediate help}\def~{\errmessage{% { } } } -\cs_new_protected:Npn \intarray_gset_rand:Nn #1 - { \intarray_gset_rand:Nnn #1 { 1 } } -\cs_generate_variant:Nn \intarray_gset_rand:Nn { c } -\sys_if_rand_exist:TF - { - \cs_new_protected:Npn \intarray_gset_rand:Nnn #1#2#3 - { - \__intarray_gset_rand:Nff #1 - { \int_eval:n {#2} } { \int_eval:n {#3} } - } - \cs_new_protected:Npn \__intarray_gset_rand:Nnn #1#2#3 - { - \int_compare:nNnTF {#2} > {#3} - { - \msg_expandable_error:nnnn - { kernel } { randint-backward-range } {#2} {#3} - \__intarray_gset_rand:Nnn #1 {#3} {#2} - } - { - \__intarray_gset_overflow_test:nw {#2} - \__intarray_gset_rand_auxi:Nnnn #1 { } {#2} {#3} - } - } - \cs_generate_variant:Nn \__intarray_gset_rand:Nnn { Nff } - \cs_new_protected:Npn \__intarray_gset_rand_auxi:Nnnn #1#2#3#4 - { - \__intarray_gset_overflow_test:nw {#4} - \__intarray_gset_rand_auxii:Nnnn #1 { } {#4} {#3} - } - \cs_new_protected:Npn \__intarray_gset_rand_auxii:Nnnn #1#2#3#4 - { - \exp_args:NNf \__intarray_gset_rand_auxiii:Nnnn #1 - { \int_eval:n { #3 - #4 + 1 } } {#4} {#3} - } - \cs_new_protected:Npn \__intarray_gset_rand_auxiii:Nnnn #1#2#3#4 - { - \exp_args:NNf \__intarray_gset_all_same:Nn #1 - { - \int_compare:nNnTF {#2} > \c__kernel_randint_max_int - { - \exp_stop_f: - \int_eval:n { \__kernel_randint:nn {#3} {#4} } - } - { - \exp_stop_f: - \int_eval:n { \__kernel_randint:n {#2} - 1 + #3 } - } - } - } - \cs_new_protected:Npn \__intarray_gset_all_same:Nn #1#2 - { - \int_zero:N \l__intarray_loop_int - \prg_replicate:nn { \intarray_count:N #1 } - { - \int_incr:N \l__intarray_loop_int - \__kernel_intarray_gset:Nnn #1 \l__intarray_loop_int {#2} - } - } - } - { - \cs_new_protected:Npn \intarray_gset_rand:Nnn #1#2#3 - { - \msg_error:nnn { kernel } { fp-no-random } - { \intarray_gset_rand:Nnn #1 {#2} {#3} } - } - } -\cs_generate_variant:Nn \intarray_gset_rand:Nnn { c } %% File: l3fp.dtx %% File: l3fp-aux.dtx \cs_new_eq:NN \__fp_int_eval:w \tex_numexpr:D @@ -15016,7 +15057,7 @@ Type H <return> for immediate help}\def~{\errmessage{% { #1 \__fp_error:nnfn { invalid } {##2} { \fp_to_tl:n { ##3; } } { } - \flag_raise_if_clear:n { fp_invalid_operation } + \flag_ensure_raised:n { fp_invalid_operation } ##1 } \exp_args:Nno \use:n @@ -15025,7 +15066,7 @@ Type H <return> for immediate help}\def~{\errmessage{% #1 \__fp_error:nffn { invalid-ii } { \fp_to_tl:n { ##2; } } { \fp_to_tl:n { ##3; } } {##1} - \flag_raise_if_clear:n { fp_invalid_operation } + \flag_ensure_raised:n { fp_invalid_operation } \exp_after:wN \c_nan_fp } \exp_args:Nno \use:n @@ -15033,7 +15074,7 @@ Type H <return> for immediate help}\def~{\errmessage{% { #1 \__fp_error:nffn { invalid } {##1} {##2} { } - \flag_raise_if_clear:n { fp_invalid_operation } + \flag_ensure_raised:n { fp_invalid_operation } \exp_after:wN \c_nan_fp } } @@ -15050,7 +15091,7 @@ Type H <return> for immediate help}\def~{\errmessage{% { #1 \__fp_error:nnfn { zero-div } {##2} { \fp_to_tl:n { ##3; } } { } - \flag_raise_if_clear:n { fp_division_by_zero } + \flag_ensure_raised:n { fp_division_by_zero } \exp_after:wN ##1 } \exp_args:Nno \use:n @@ -15059,7 +15100,7 @@ Type H <return> for immediate help}\def~{\errmessage{% #1 \__fp_error:nffn { zero-div-ii } { \fp_to_tl:n { ##3; } } { \fp_to_tl:n { ##4; } } {##2} - \flag_raise_if_clear:n { fp_division_by_zero } + \flag_ensure_raised:n { fp_division_by_zero } \exp_after:wN ##1 } } @@ -15090,7 +15131,7 @@ Type H <return> for immediate help}\def~{\errmessage{% { \fp_to_tl:n { \s__fp \__fp_chk:w ##1##2##3; } } { \token_if_eq_meaning:NNF 0 ##2 { - } #4 } {#2} - \flag_raise_if_clear:n { fp_#2 } + \flag_ensure_raised:n { fp_#2 } #3 ##2 } } @@ -16854,9 +16895,9 @@ Type H <return> for immediate help}\def~{\errmessage{% { \s__fp \__fp_chk:w #2 #3 #4 #5 ; } } \cs_new_protected:Npn \fp_show:n - { \msg_show_eval:Nn \fp_to_tl:n } + { \__kernel_msg_show_eval:Nn \fp_to_tl:n } \cs_new_protected:Npn \fp_log:n - { \msg_log_eval:Nn \fp_to_tl:n } + { \__kernel_msg_log_eval:Nn \fp_to_tl:n } \fp_const:Nn \c_e_fp { 2.718 2818 2845 9045 } \fp_const:Nn \c_one_fp { 1 } \fp_const:Nn \c_pi_fp { 3.141 5926 5358 9793 } @@ -20472,292 +20513,265 @@ Type H <return> for immediate help}\def~{\errmessage{% { \__fp_parse_function:NNN \__fp_rand_o:Nw ? } \cs_new:Npn \__fp_parse_word_randint:N { \__fp_parse_function:NNN \__fp_randint_o:Nw ? } -\sys_if_rand_exist:F +\int_const:Nn \c__kernel_randint_max_int { 131071 } +\cs_new:Npn \__kernel_randint:n #1 { - \msg_new:nnn { kernel } { fp-no-random } - { Random~numbers~unavailable~for~#1 } - \cs_new:Npn \__fp_rand_o:Nw ? #1 @ - { - \msg_expandable_error:nnn { kernel } { fp-no-random } - { fp~rand } - \exp_after:wN \c_nan_fp - } - \cs_new_eq:NN \__fp_randint_o:Nw \__fp_rand_o:Nw - \cs_new:Npn \int_rand:nn #1#2 - { - \msg_expandable_error:nnn { kernel } { fp-no-random } - { \int_rand:nn {#1} {#2} } - \int_eval:n {#1} - } - \cs_new:Npn \int_rand:n #1 - { - \msg_expandable_error:nnn { kernel } { fp-no-random } - { \int_rand:n {#1} } - 1 - } + (#1 * \tex_uniformdeviate:D 16384 + + \tex_uniformdeviate:D #1 + 8192 ) / 16384 } -\sys_if_rand_exist:T +\cs_new:Npn \__fp_rand_myriads:n #1 + { \__fp_rand_myriads_loop:w #1 \prg_break: X \prg_break_point: ; } +\cs_new:Npn \__fp_rand_myriads_loop:w #1 X { - \int_const:Nn \c__kernel_randint_max_int { 131071 } - \cs_new:Npn \__kernel_randint:n #1 - { - (#1 * \tex_uniformdeviate:D 16384 - + \tex_uniformdeviate:D #1 + 8192 ) / 16384 - } - \cs_new:Npn \__fp_rand_myriads:n #1 - { \__fp_rand_myriads_loop:w #1 \prg_break: X \prg_break_point: ; } - \cs_new:Npn \__fp_rand_myriads_loop:w #1 X - { - #1 - \exp_after:wN \__fp_rand_myriads_get:w - \int_value:w \__fp_int_eval:w 9999 + - \__kernel_randint:n { 10000 } - \__fp_rand_myriads_loop:w - } - \cs_new:Npn \__fp_rand_myriads_get:w 1 #1 ; { ; {#1} } - \cs_new:Npn \__fp_rand_o:Nw ? #1 @ - { - \tl_if_empty:nTF {#1} - { - \exp_after:wN \__fp_rand_o:w - \exp:w \exp_end_continue_f:w - \__fp_rand_myriads:n { XXXX } { 0000 } { 0000 } ; 0 - } - { - \msg_expandable_error:nnnnn - { fp } { num-args } { rand() } { 0 } { 0 } - \exp_after:wN \c_nan_fp - } - } - \cs_new:Npn \__fp_rand_o:w ; - { - \exp_after:wN \__fp_sanitize:Nw - \exp_after:wN 0 - \int_value:w \__fp_int_eval:w \c_zero_int - \__fp_fixed_to_float_o:wN - } - \cs_new:Npn \__fp_randint_o:Nw ? - { - \__fp_parse_function_one_two:nnw - { randint } - { \__fp_randint_default:w \__fp_randint_o:w } - } - \cs_new:Npn \__fp_randint_default:w #1 { \exp_after:wN #1 \c_one_fp } - \cs_new:Npn \__fp_randint_badarg:w \s__fp \__fp_chk:w #1#2#3; - { - \__fp_int:wTF \s__fp \__fp_chk:w #1#2#3; - { - \if_meaning:w 1 #1 - \if_int_compare:w - \__fp_use_i_until_s:nw #3 ; > \c__fp_prec_int - \c_one_int - \fi: - \fi: - } - { \c_one_int } - } - \cs_new:Npn \__fp_randint_o:w #1; #2; @ - { - \if_case:w - \__fp_randint_badarg:w #1; - \__fp_randint_badarg:w #2; - \if:w 1 \__fp_compare_back:ww #2; #1; \c_one_int \fi: - \c_zero_int - \__fp_randint_auxi_o:ww #1; #2; - \or: - \__fp_invalid_operation_tl_o:ff - { randint } { \__fp_array_to_clist:n { #1; #2; } } - \exp:w - \fi: - \exp_after:wN \exp_end: - } - \cs_new:Npn \__fp_randint_auxi_o:ww #1 ; #2 ; #3 \exp_end: + #1 + \exp_after:wN \__fp_rand_myriads_get:w + \int_value:w \__fp_int_eval:w 9999 + + \__kernel_randint:n { 10000 } + \__fp_rand_myriads_loop:w + } +\cs_new:Npn \__fp_rand_myriads_get:w 1 #1 ; { ; {#1} } +\cs_new:Npn \__fp_rand_o:Nw ? #1 @ + { + \tl_if_empty:nTF {#1} { - \fi: - \__fp_randint_auxii:wn #2 ; - { \__fp_randint_auxii:wn #1 ; \__fp_randint_auxiii_o:ww } + \exp_after:wN \__fp_rand_o:w + \exp:w \exp_end_continue_f:w + \__fp_rand_myriads:n { XXXX } { 0000 } { 0000 } ; 0 } - \cs_new:Npn \__fp_randint_auxii:wn \s__fp \__fp_chk:w #1#2#3#4 ; { - \if_meaning:w 0 #1 - \exp_after:wN \use_i:nn - \else: - \exp_after:wN \use_ii:nn - \fi: - { \exp_after:wN \__fp_fixed_continue:wn \c__fp_one_fixed_tl } - { - \exp_after:wN \__fp_ep_to_fixed:wwn - \int_value:w \__fp_int_eval:w - #3 - \c__fp_prec_int , #4 {0000} {0000} ; - { - \if_meaning:w 0 #2 - \exp_after:wN \use_i:nnnn - \exp_after:wN \__fp_fixed_add_one:wN - \fi: - \exp_after:wN \__fp_fixed_sub:wwn \c__fp_one_fixed_tl - } - \__fp_fixed_continue:wn - } + \msg_expandable_error:nnnnn + { fp } { num-args } { rand() } { 0 } { 0 } + \exp_after:wN \c_nan_fp } - \cs_new:Npn \__fp_randint_auxiii_o:ww #1 ; #2 ; + } +\cs_new:Npn \__fp_rand_o:w ; + { + \exp_after:wN \__fp_sanitize:Nw + \exp_after:wN 0 + \int_value:w \__fp_int_eval:w \c_zero_int + \__fp_fixed_to_float_o:wN + } +\cs_new:Npn \__fp_randint_o:Nw ? + { + \__fp_parse_function_one_two:nnw + { randint } + { \__fp_randint_default:w \__fp_randint_o:w } + } +\cs_new:Npn \__fp_randint_default:w #1 { \exp_after:wN #1 \c_one_fp } +\cs_new:Npn \__fp_randint_badarg:w \s__fp \__fp_chk:w #1#2#3; + { + \__fp_int:wTF \s__fp \__fp_chk:w #1#2#3; { - \__fp_fixed_add:wwn #2 ; - {0000} {0000} {0000} {0001} {0000} {0000} ; - \__fp_fixed_sub:wwn #1 ; - { - \exp_after:wN \use_i:nn - \exp_after:wN \__fp_fixed_mul_add:wwwn - \exp:w \exp_end_continue_f:w \__fp_rand_myriads:n { XXXXXX } ; - } - #1 ; - \__fp_randint_auxiv_o:ww - #2 ; - \__fp_randint_auxv_o:w #1 ; @ - } - \cs_new:Npn \__fp_randint_auxiv_o:ww #1#2#3#4#5 ; #6#7#8#9 - { - \if_int_compare:w - \if_int_compare:w #1#2 > #6#7 \exp_stop_f: 1 \else: - \if_int_compare:w #1#2 < #6#7 \exp_stop_f: - \fi: \fi: - #3#4 > #8#9 \exp_stop_f: - \__fp_use_i_until_s:nw + \if_meaning:w 1 #1 + \if_int_compare:w + \__fp_use_i_until_s:nw #3 ; > \c__fp_prec_int + \c_one_int + \fi: \fi: - \__fp_randint_auxv_o:w {#1}{#2}{#3}{#4}#5 } - \cs_new:Npn \__fp_randint_auxv_o:w #1#2#3#4#5 ; #6 @ + { \c_one_int } + } +\cs_new:Npn \__fp_randint_o:w #1; #2; @ + { + \if_case:w + \__fp_randint_badarg:w #1; + \__fp_randint_badarg:w #2; + \if:w 1 \__fp_compare_back:ww #2; #1; \c_one_int \fi: + \c_zero_int + \__fp_randint_auxi_o:ww #1; #2; + \or: + \__fp_invalid_operation_tl_o:ff + { randint } { \__fp_array_to_clist:n { #1; #2; } } + \exp:w + \fi: + \exp_after:wN \exp_end: + } +\cs_new:Npn \__fp_randint_auxi_o:ww #1 ; #2 ; #3 \exp_end: + { + \fi: + \__fp_randint_auxii:wn #2 ; + { \__fp_randint_auxii:wn #1 ; \__fp_randint_auxiii_o:ww } + } +\cs_new:Npn \__fp_randint_auxii:wn \s__fp \__fp_chk:w #1#2#3#4 ; + { + \if_meaning:w 0 #1 + \exp_after:wN \use_i:nn + \else: + \exp_after:wN \use_ii:nn + \fi: + { \exp_after:wN \__fp_fixed_continue:wn \c__fp_one_fixed_tl } + { + \exp_after:wN \__fp_ep_to_fixed:wwn + \int_value:w \__fp_int_eval:w + #3 - \c__fp_prec_int , #4 {0000} {0000} ; { - \exp_after:wN \__fp_sanitize:Nw - \int_value:w - \if_int_compare:w #1 < 10000 \exp_stop_f: - 2 - \else: - 0 - \exp_after:wN \exp_after:wN - \exp_after:wN \__fp_reverse_args:Nww + \if_meaning:w 0 #2 + \exp_after:wN \use_i:nnnn + \exp_after:wN \__fp_fixed_add_one:wN \fi: \exp_after:wN \__fp_fixed_sub:wwn \c__fp_one_fixed_tl - {#1} {#2} {#3} {#4} {0000} {0000} ; - { - \exp_after:wN \exp_stop_f: - \int_value:w \__fp_int_eval:w \c__fp_prec_int - \__fp_fixed_to_float_o:wN - } - 0 - \exp:w \exp_after:wN \exp_end: } - \cs_new:Npn \int_rand:nn #1#2 + \__fp_fixed_continue:wn + } + } +\cs_new:Npn \__fp_randint_auxiii_o:ww #1 ; #2 ; + { + \__fp_fixed_add:wwn #2 ; + {0000} {0000} {0000} {0001} {0000} {0000} ; + \__fp_fixed_sub:wwn #1 ; + { + \exp_after:wN \use_i:nn + \exp_after:wN \__fp_fixed_mul_add:wwwn + \exp:w \exp_end_continue_f:w \__fp_rand_myriads:n { XXXXXX } ; + } + #1 ; + \__fp_randint_auxiv_o:ww + #2 ; + \__fp_randint_auxv_o:w #1 ; @ + } +\cs_new:Npn \__fp_randint_auxiv_o:ww #1#2#3#4#5 ; #6#7#8#9 + { + \if_int_compare:w + \if_int_compare:w #1#2 > #6#7 \exp_stop_f: 1 \else: + \if_int_compare:w #1#2 < #6#7 \exp_stop_f: - \fi: \fi: + #3#4 > #8#9 \exp_stop_f: + \__fp_use_i_until_s:nw + \fi: + \__fp_randint_auxv_o:w {#1}{#2}{#3}{#4}#5 + } +\cs_new:Npn \__fp_randint_auxv_o:w #1#2#3#4#5 ; #6 @ + { + \exp_after:wN \__fp_sanitize:Nw + \int_value:w + \if_int_compare:w #1 < 10000 \exp_stop_f: + 2 + \else: + 0 + \exp_after:wN \exp_after:wN + \exp_after:wN \__fp_reverse_args:Nww + \fi: + \exp_after:wN \__fp_fixed_sub:wwn \c__fp_one_fixed_tl + {#1} {#2} {#3} {#4} {0000} {0000} ; + { + \exp_after:wN \exp_stop_f: + \int_value:w \__fp_int_eval:w \c__fp_prec_int + \__fp_fixed_to_float_o:wN + } + 0 + \exp:w \exp_after:wN \exp_end: + } +\cs_new:Npn \int_rand:nn #1#2 + { + \int_eval:n { - \int_eval:n - { - \exp_after:wN \__fp_randint:ww - \int_value:w \int_eval:n {#1} \exp_after:wN ; - \int_value:w \int_eval:n {#2} ; - } + \exp_after:wN \__fp_randint:ww + \int_value:w \int_eval:n {#1} \exp_after:wN ; + \int_value:w \int_eval:n {#2} ; } - \cs_new:Npn \__fp_randint:ww #1; #2; - { - \if_int_compare:w #1 > #2 \exp_stop_f: - \msg_expandable_error:nnnn - { kernel } { randint-backward-range } {#1} {#2} - \__fp_randint:ww #2; #1; - \else: - \if_int_compare:w \__fp_int_eval:w #2 - \if_int_compare:w #1 > \c_zero_int - - #1 < \__fp_int_eval:w - \else: - < \__fp_int_eval:w #1 + - \fi: - \c__kernel_randint_max_int - \__fp_int_eval_end: - \__kernel_randint:n - { \__fp_int_eval:w #2 - #1 + 1 \__fp_int_eval_end: } - - 1 + #1 + } +\cs_new:Npn \__fp_randint:ww #1; #2; + { + \if_int_compare:w #1 > #2 \exp_stop_f: + \msg_expandable_error:nnnn + { kernel } { randint-backward-range } {#1} {#2} + \__fp_randint:ww #2; #1; + \else: + \if_int_compare:w \__fp_int_eval:w #2 + \if_int_compare:w #1 > \c_zero_int + - #1 < \__fp_int_eval:w \else: - \__kernel_randint:nn {#1} {#2} + < \__fp_int_eval:w #1 + \fi: - \fi: - } - \cs_new:Npn \__kernel_randint:nn #1#2 - { - #1 - \exp_after:wN \__fp_randint_wide_aux:w - \int_value:w - \exp_after:wN \__fp_randint_split_o:Nw - \tex_uniformdeviate:D 268435456 ; - \int_value:w - \exp_after:wN \__fp_randint_split_o:Nw - \tex_uniformdeviate:D 268435456 ; + \c__kernel_randint_max_int + \__fp_int_eval_end: + \__kernel_randint:n + { \__fp_int_eval:w #2 - #1 + 1 \__fp_int_eval_end: } + - 1 + #1 + \else: + \__kernel_randint:nn {#1} {#2} + \fi: + \fi: + } +\cs_new:Npn \__kernel_randint:nn #1#2 + { + #1 + \exp_after:wN \__fp_randint_wide_aux:w + \int_value:w + \exp_after:wN \__fp_randint_split_o:Nw + \tex_uniformdeviate:D 268435456 ; + \int_value:w + \exp_after:wN \__fp_randint_split_o:Nw + \tex_uniformdeviate:D 268435456 ; + \int_value:w + \exp_after:wN \__fp_randint_split_o:Nw + \int_value:w \__fp_int_eval:w 131072 + + \exp_after:wN \__fp_randint_split_o:Nw \int_value:w - \exp_after:wN \__fp_randint_split_o:Nw - \int_value:w \__fp_int_eval:w 131072 + - \exp_after:wN \__fp_randint_split_o:Nw - \int_value:w - \__kernel_int_add:nnn {#2} { -#1 } { -\c_max_int } ; - . - } - \cs_new:Npn \__fp_randint_split_o:Nw #1#2 ; - { - \if_meaning:w 0 #1 - 0 \exp_after:wN ; \int_value:w 0 - \else: - \exp_after:wN \__fp_randint_split_aux:w - \int_value:w \__fp_int_eval:w (#1#2 - 8192) / 16384 ; - + #1#2 - \fi: - \exp_after:wN ; - } - \cs_new:Npn \__fp_randint_split_aux:w #1 ; - { - #1 \exp_after:wN ; - \int_value:w \__fp_int_eval:w - #1 * 16384 - } - \cs_new:Npn \__fp_randint_wide_aux:w #1;#2; #3;#4; #5;#6;#7; . - { - \exp_after:wN \__fp_randint_wide_auxii:w - \int_value:w \__fp_int_eval:w #5 * #3 + #6 * #1 + - (#5 * #4 + #6 * #3 + #7 * #1 + - (#5 * #2 + #7 * #3 + - (16384 * #6 + #7) * (16384 * #4 + #2) / 268435456) / 16384 - ) / 16384 \exp_after:wN ; - \int_value:w \__fp_int_eval:w (#5 + #6) * 16384 + #7 ; - #1 ; #5 ; - } - \cs_new:Npn \__fp_randint_wide_auxii:w #1; #2; #3; #4; - { - \if_int_odd:w 0 - \if_int_compare:w #1 = #2 \else: \exp_stop_f: \fi: - \if_int_compare:w #4 = \c_zero_int 1 \fi: - \if_int_compare:w #3 = 16383 ~ 1 \fi: - \exp_stop_f: - \exp_after:wN \prg_break: - \fi: - \if_int_compare:w #4 < 8 \exp_stop_f: - + #4 * #3 * 16384 - \else: - + 8 * #3 * 16384 + (#4 - 8) * #3 * 16384 - \fi: - + #1 - \prg_break_point: - } - \cs_new:Npn \int_rand:n #1 - { - \int_eval:n - { \exp_args:Nf \__fp_randint:n { \int_eval:n {#1} } } - } - \cs_new:Npn \__fp_randint:n #1 - { - \if_int_compare:w #1 < \c_one_int - \msg_expandable_error:nnnn - { kernel } { randint-backward-range } { 1 } {#1} - \__fp_randint:ww #1; 1; - \else: - \if_int_compare:w #1 > \c__kernel_randint_max_int - \__kernel_randint:nn { 1 } {#1} - \else: - \__kernel_randint:n {#1} - \fi: - \fi: - } + \__kernel_int_add:nnn {#2} { -#1 } { -\c_max_int } ; + . + } +\cs_new:Npn \__fp_randint_split_o:Nw #1#2 ; + { + \if_meaning:w 0 #1 + 0 \exp_after:wN ; \int_value:w 0 + \else: + \exp_after:wN \__fp_randint_split_aux:w + \int_value:w \__fp_int_eval:w (#1#2 - 8192) / 16384 ; + + #1#2 + \fi: + \exp_after:wN ; + } +\cs_new:Npn \__fp_randint_split_aux:w #1 ; + { + #1 \exp_after:wN ; + \int_value:w \__fp_int_eval:w - #1 * 16384 + } +\cs_new:Npn \__fp_randint_wide_aux:w #1;#2; #3;#4; #5;#6;#7; . + { + \exp_after:wN \__fp_randint_wide_auxii:w + \int_value:w \__fp_int_eval:w #5 * #3 + #6 * #1 + + (#5 * #4 + #6 * #3 + #7 * #1 + + (#5 * #2 + #7 * #3 + + (16384 * #6 + #7) * (16384 * #4 + #2) / 268435456) / 16384 + ) / 16384 \exp_after:wN ; + \int_value:w \__fp_int_eval:w (#5 + #6) * 16384 + #7 ; + #1 ; #5 ; + } +\cs_new:Npn \__fp_randint_wide_auxii:w #1; #2; #3; #4; + { + \if_int_odd:w 0 + \if_int_compare:w #1 = #2 \else: \exp_stop_f: \fi: + \if_int_compare:w #4 = \c_zero_int 1 \fi: + \if_int_compare:w #3 = 16383 ~ 1 \fi: + \exp_stop_f: + \exp_after:wN \prg_break: + \fi: + \if_int_compare:w #4 < 8 \exp_stop_f: + + #4 * #3 * 16384 + \else: + + 8 * #3 * 16384 + (#4 - 8) * #3 * 16384 + \fi: + + #1 + \prg_break_point: + } +\cs_new:Npn \int_rand:n #1 + { + \int_eval:n + { \exp_args:Nf \__fp_randint:n { \int_eval:n {#1} } } + } +\cs_new:Npn \__fp_randint:n #1 + { + \if_int_compare:w #1 < \c_one_int + \msg_expandable_error:nnnn + { kernel } { randint-backward-range } { 1 } {#1} + \__fp_randint:ww #1; 1; + \else: + \if_int_compare:w #1 > \c__kernel_randint_max_int + \__kernel_randint:nn { 1 } {#1} + \else: + \__kernel_randint:n {#1} + \fi: + \fi: } %% File: l3fparray.dtx \int_new:N \g__fp_array_int @@ -21470,12 +21484,13 @@ Type H <return> for immediate help}\def~{\errmessage{% { \group_begin: \__sort_main:NNNn #1 #2 #4 {#5} - \seq_gset_from_inline_x:Nnn \g__sort_internal_seq + \seq_gclear:N \g__sort_internal_seq + \int_step_inline:nnn + \l__sort_min_int { \l__sort_top_int - 1 } { - \int_step_function:nnN - { \l__sort_min_int } { \l__sort_top_int - 1 } + \seq_gput_right:Nx \g__sort_internal_seq + { \tex_the:D \tex_toks:D ##1 } } - { \tex_the:D \tex_toks:D ##1 } \group_end: #3 #4 \g__sort_internal_seq \seq_gclear:N \g__sort_internal_seq @@ -25168,7 +25183,7 @@ Type H <return> for immediate help}\def~{\errmessage{% \__regex_compile_cs_aux:Nn } { - \__regex_quark_if_nil:NF #1 { \flag_raise_if_clear:n { __regex_cs } } + \__regex_quark_if_nil:NF #1 { \flag_ensure_raised:n { __regex_cs } } \__regex_use_none_delimit_by_q_recursion_stop:w } } @@ -25190,7 +25205,7 @@ Type H <return> for immediate help}\def~{\errmessage{% { \__regex_quark_if_nil:NF #1 { - \flag_raise_if_clear:n { __regex_cs } + \flag_ensure_raised:n { __regex_cs } \__regex_use_i_delimit_by_q_recursion_stop:nw } \__regex_use_none_delimit_by_q_recursion_stop:w @@ -27051,9 +27066,22 @@ Type H <return> for immediate help}\def~{\errmessage{% { \int_use:N \l__regex_added_end_int } } \group_end: - \cs_set_eq:NN \__regex_tmp:w \__regex_extract_map_loop:w - \seq_set_from_function:NnN #1 - { \__regex_extract_map:N } \exp_not:n + \__regex_extract_seq:N #1 + } +\cs_gset_protected:Npn \__regex_extract_seq:N #1 + { + \seq_clear:N #1 + \cs_set_eq:NN \__regex_tmp:w \__regex_extract_seq_loop:Nw + \exp_after:wN \__regex_extract_seq:NNn + \exp_after:wN #1 + \g__regex_internal_tl \use_none:nnn + } +\cs_new_protected:Npn \__regex_extract_seq:NNn #1#2#3 + { #3 #2 #1 \prg_do_nothing: } +\cs_new_protected:Npn \__regex_extract_seq_loop:Nw #1#2 \__regex_tmp:w #3 + { + \seq_put_right:No #1 {#2} + #3 \__regex_extract_seq_loop:Nw #1 \prg_do_nothing: } \cs_new:Npn \__regex_extract_seq_aux:n #1 { @@ -27115,19 +27143,6 @@ Type H <return> for immediate help}\def~{\errmessage{% \if_false: { \fi: } \__regex_tmp:w } -\cs_new:Npn \__regex_extract_map:N #1 - { - \exp_after:wN \__regex_extract_map_aux:NNn - \exp_after:wN #1 - \g__regex_internal_tl \use_none:nnn - } -\cs_new:Npn \__regex_extract_map_aux:NNn #1#2#3 - { #3 #2 #1 \prg_do_nothing: } -\cs_new:Npn \__regex_extract_map_loop:w #1#2 \__regex_tmp:w #3 - { - \exp_after:wN #1 \exp_after:wN {#2} - #3 \__regex_extract_map_loop:w #1 \prg_do_nothing: - } \cs_new_protected:Npn \__regex_extract: { \if_meaning:w \c_true_bool \g__regex_success_bool @@ -35540,97 +35555,6 @@ Type H <return> for immediate help}\def~{\errmessage{% \q_recursion_stop \group_end: %% File: l3candidates.dtx -\cs_new:Npn \flag_raise_if_clear:n #1 - { - \if_cs_exist:w flag~#1~0 \cs_end: - \else: - \cs:w flag~#1 \cs_end: 0 ; - \fi: - } -\cs_new_protected:Npn \msg_show_eval:Nn #1#2 - { \exp_args:Nf \__msg_show_eval:nnN { #1 {#2} } {#2} \tl_show:n } -\cs_new_protected:Npn \msg_log_eval:Nn #1#2 - { \exp_args:Nf \__msg_show_eval:nnN { #1 {#2} } {#2} \tl_log:n } -\cs_new_protected:Npn \__msg_show_eval:nnN #1#2#3 { #3 { #2 = #1 } } -\cs_new:Npx \msg_show_item:n #1 - { \iow_newline: > ~ \c_space_tl \exp_not:N \tl_to_str:n { {#1} } } -\cs_new:Npx \msg_show_item_unbraced:n #1 - { \iow_newline: > ~ \c_space_tl \exp_not:N \tl_to_str:n {#1} } -\cs_new:Npx \msg_show_item:nn #1#2 - { - \iow_newline: > \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n { {#1} } - \use:nn { ~ } { ~ } => \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n { {#2} } - } -\cs_new:Npx \msg_show_item_unbraced:nn #1#2 - { - \iow_newline: > \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n {#1} - \use:nn { ~ } { ~ } => \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n {#2} - } -\cs_new_protected:Npn \bool_set_inverse:N #1 - { \bool_if:NTF #1 { \bool_set_false:N } { \bool_set_true:N } #1 } -\cs_generate_variant:Nn \bool_set_inverse:N { c } -\cs_new_protected:Npn \bool_gset_inverse:N #1 - { \bool_if:NTF #1 { \bool_gset_false:N } { \bool_gset_true:N } #1 } -\cs_generate_variant:Nn \bool_gset_inverse:N { c } -\scan_new:N \s__bool_mark -\scan_new:N \s__bool_stop -\cs_new:Npn \bool_case_true:nTF - { \exp:w \__bool_case:NnTF \c_true_bool } -\cs_new:Npn \bool_case_true:nT #1#2 - { \exp:w \__bool_case:NnTF \c_true_bool {#1} {#2} { } } -\cs_new:Npn \bool_case_true:nF #1 - { \exp:w \__bool_case:NnTF \c_true_bool {#1} { } } -\cs_new:Npn \bool_case_true:n #1 - { \exp:w \__bool_case:NnTF \c_true_bool {#1} { } { } } -\cs_new:Npn \bool_case_false:nTF - { \exp:w \__bool_case:NnTF \c_false_bool } -\cs_new:Npn \bool_case_false:nT #1#2 - { \exp:w \__bool_case:NnTF \c_false_bool {#1} {#2} { } } -\cs_new:Npn \bool_case_false:nF #1 - { \exp:w \__bool_case:NnTF \c_false_bool {#1} { } } -\cs_new:Npn \bool_case_false:n #1 - { \exp:w \__bool_case:NnTF \c_false_bool {#1} { } { } } -\cs_new:Npn \__bool_case:NnTF #1#2#3#4 - { - \bool_if:NTF #1 \__bool_case_true:w \__bool_case_false:w - #2 #1 { } \s__bool_mark {#3} \s__bool_mark {#4} \s__bool_stop - } -\cs_new:Npn \__bool_case_true:w #1#2 - { - \bool_if:nTF {#1} - { \__bool_case_end:nw {#2} } - { \__bool_case_true:w } - } -\cs_new:Npn \__bool_case_false:w #1#2 - { - \bool_if:nTF {#1} - { \__bool_case_false:w } - { \__bool_case_end:nw {#2} } - } -\cs_new:Npn \__bool_case_end:nw #1#2#3 \s__bool_mark #4#5 \s__bool_stop - { \exp_end: #1 #4 } -\cs_new:Npn \__prop_use_i_delimit_by_s_stop:nw #1 #2 \s__prop_stop {#1} -\cs_new:Npn \prop_rand_key_value:N #1 - { - \prop_if_empty:NF #1 - { - \exp_after:wN \__prop_rand_item:w - \int_value:w \int_rand:nn { 1 } { \prop_count:N #1 } - #1 \s__prop_stop - } - } -\cs_generate_variant:Nn \prop_rand_key_value:N { c } -\cs_new:Npn \__prop_rand_item:w #1 \s__prop \__prop_pair:wn #2 \s__prop #3 - { - \int_compare:nNnF {#1} > 1 - { \__prop_use_i_delimit_by_s_stop:nw { \exp_not:n { {#2} {#3} } } } - \exp_after:wN \__prop_rand_item:w - \int_value:w \int_eval:n { #1 - 1 } \s__prop - } \cs_new:Npn \seq_mapthread_function:NNN #1#2#3 { \exp_after:wN \__seq_mapthread_function:wNN #2 \s__seq_stop #1 #3 } \cs_new:Npn \__seq_mapthread_function:wNN \s__seq #1 \s__seq_stop #2#3 @@ -35663,20 +35587,6 @@ Type H <return> for immediate help}\def~{\errmessage{% #1 #2 { #3 } \__seq_pop_item_def: } -\cs_new_protected:Npn \seq_set_from_inline_x:Nnn - { \__seq_set_from_inline_x:NNnn \__kernel_tl_set:Nx } -\cs_new_protected:Npn \seq_gset_from_inline_x:Nnn - { \__seq_set_from_inline_x:NNnn \__kernel_tl_gset:Nx } -\cs_new_protected:Npn \__seq_set_from_inline_x:NNnn #1#2#3#4 - { - \__seq_push_item_def:n { \exp_not:N \__seq_item:n {#4} } - #1 #2 { \s__seq #3 \__seq_item:n } - \__seq_pop_item_def: - } -\cs_new_protected:Npn \seq_set_from_function:NnN #1#2#3 - { \seq_set_from_inline_x:Nnn #1 {#2} { #3 {##1} } } -\cs_new_protected:Npn \seq_gset_from_function:NnN #1#2#3 - { \seq_gset_from_inline_x:Nnn #1 {#2} { #3 {##1} } } \cs_new_eq:NN \__seq_int_eval:w \tex_numexpr:D \cs_new_protected:Npn \seq_set_item:Nnn #1#2#3 { \__seq_set_item:NnnNN #1 {#2} {#3} \__kernel_tl_set:Nx \use_i:nn } @@ -35784,84 +35694,6 @@ Type H <return> for immediate help}\def~{\errmessage{% \if_false: { \fi: } \l__seq_internal_b_tl { \if_false: } \fi: \exp_not:n {#1} } -\str_const:Nx \c_sys_engine_version_str - { - \str_case:on \c_sys_engine_str - { - { pdftex } - { - \int_div_truncate:nn { \tex_pdftexversion:D } { 100 } - . - \int_mod:nn { \tex_pdftexversion:D } { 100 } - . - \tex_pdftexrevision:D - } - { ptex } - { - \cs_if_exist:NT \tex_ptexversion:D - { - p - \int_use:N \tex_ptexversion:D - . - \int_use:N \tex_ptexminorversion:D - \tex_ptexrevision:D - - - \int_use:N \tex_epTeXversion:D - } - } - { luatex } - { - \int_div_truncate:nn { \tex_luatexversion:D } { 100 } - . - \int_mod:nn { \tex_luatexversion:D } { 100 } - . - \tex_luatexrevision:D - } - { uptex } - { - \cs_if_exist:NT \tex_ptexversion:D - { - p - \int_use:N \tex_ptexversion:D - . - \int_use:N \tex_ptexminorversion:D - \tex_ptexrevision:D - - - u - \int_use:N \tex_uptexversion:D - \tex_uptexrevision:D - - - \int_use:N \tex_epTeXversion:D - } - } - { xetex } - { - \int_use:N \tex_XeTeXversion:D - \tex_XeTeXrevision:D - } - } - } -\cs_new_protected:Npn \ior_shell_open:Nn #1#2 - { - \sys_if_shell:TF - { \exp_args:No \__ior_shell_open:nN { \tl_to_str:n {#2} } #1 } - { \msg_error:nn { ior } { pipe-failed } } - } -\cs_new_protected:Npn \__ior_shell_open:nN #1#2 - { - \tl_if_in:nnTF {#1} { " } - { - \msg_error:nnx - { kernel } { quote-in-shell } {#1} - } - { \__kernel_ior_open:Nn #2 { |#1 } } - } -\msg_new:nnnn { ior } { pipe-failed } - { Cannot~run~piped~system~commands. } - { - LaTeX~tried~to~call~a~system~process~but~this~was~not~possible.\\ - Try~the~"--shell-escape"~(or~"--enable-pipes")~option. - } \cs_new_protected:Npn \tl_build_begin:N #1 { \__tl_build_begin:NN \cs_set_nopar:Npx #1 } \cs_new_protected:Npn \tl_build_gbegin:N #1 @@ -35968,86 +35800,6 @@ Type H <return> for immediate help}\def~{\errmessage{% #2 #1 \exp_args:Nc \__tl_build_end_loop:NN { \cs_to_str:N #1 ' } #2 } -\cs_new:Npn \tl_range_braced:Nnn { \exp_args:No \tl_range_braced:nnn } -\cs_generate_variant:Nn \tl_range_braced:Nnn { c } -\cs_new:Npn \tl_range_braced:nnn { \__tl_range:Nnnn \__tl_range_braced:w } -\cs_new:Npn \tl_range_unbraced:Nnn - { \exp_args:No \tl_range_unbraced:nnn } -\cs_generate_variant:Nn \tl_range_unbraced:Nnn { c } -\cs_new:Npn \tl_range_unbraced:nnn - { \__tl_range:Nnnn \__tl_range_unbraced:w } -\cs_new:Npn \__tl_range_braced:w #1 ; #2 - { \__tl_range_collect_braced:w #1 ; { } #2 } -\cs_new:Npn \__tl_range_unbraced:w #1 ; #2 - { \__tl_range_collect_unbraced:w #1 ; { } #2 } -\cs_new:Npn \__tl_range_collect_braced:w #1 ; #2#3 - { - \if_int_compare:w #1 > \c_one_int - \exp_after:wN \__tl_range_collect_braced:w - \int_value:w \int_eval:n { #1 - 1 } \exp_after:wN ; - \fi: - { #2 {#3} } - } -\cs_new:Npn \__tl_range_collect_unbraced:w #1 ; #2#3 - { - \if_int_compare:w #1 > \c_one_int - \exp_after:wN \__tl_range_collect_unbraced:w - \int_value:w \int_eval:n { #1 - 1 } \exp_after:wN ; - \fi: - { #2 #3 } - } -\group_begin: - \char_set_catcode_active:N * - \char_set_lccode:nn { `* } { `\ } - \tex_lowercase:D { \tl_const:Nn \c_catcode_active_space_tl { * } } -\group_end: -\tl_new:N \l__peek_collect_tl -\cs_new_protected:Npn \peek_catcode_collect_inline:Nn - { \__peek_collect:NNn \__peek_execute_branches_catcode: } -\cs_new_protected:Npn \peek_charcode_collect_inline:Nn - { \__peek_collect:NNn \__peek_execute_branches_charcode: } -\cs_new_protected:Npn \peek_meaning_collect_inline:Nn - { \__peek_collect:NNn \__peek_execute_branches_meaning: } -\cs_new_protected:Npn \__peek_collect:NNn #1#2#3 - { - \group_align_safe_begin: - \cs_set_eq:NN \l__peek_search_token #2 - \tl_set:Nn \l__peek_search_tl {#2} - \tl_clear:N \l__peek_collect_tl - \cs_set:Npn \__peek_false:w - { \exp_args:No \__peek_false_aux:n \l__peek_collect_tl } - \cs_set:Npn \__peek_false_aux:n ##1 - { - \group_align_safe_end: - #3 - } - \cs_set_eq:NN \__peek_true:w \__peek_collect_true:w - \cs_set:Npn \__peek_true_aux:w { \peek_after:Nw #1 } - \__peek_true_aux:w - } -\cs_new_protected:Npn \__peek_collect_true:w - { - \if_case:w - \if_catcode:w \exp_not:N \l_peek_token { 1 \exp_stop_f: \fi: - \if_catcode:w \exp_not:N \l_peek_token } 2 \exp_stop_f: \fi: - \if_meaning:w \l_peek_token \c_space_token 3 \exp_stop_f: \fi: - 0 \exp_stop_f: - \exp_after:wN \__peek_collect:N - \or: \__peek_collect_remove:nw { \c_group_begin_token } - \or: \__peek_collect_remove:nw { \c_group_end_token } - \or: \__peek_collect_remove:nw { ~ } - \fi: - } -\cs_new_protected:Npn \__peek_collect:N #1 - { - \tl_put_right:Nn \l__peek_collect_tl {#1} - \__peek_true_aux:w - } -\cs_new_protected:Npn \__peek_collect_remove:nw #1 - { - \tl_put_right:Nn \l__peek_collect_tl {#1} - \exp_after:wN \__peek_true_remove:w - } %% File: l3legacy.dtx \prg_new_conditional:Npnn \legacy_if:n #1 { p , T , F , TF } { @@ -36349,6 +36101,14 @@ Type H <return> for immediate help}\def~{\errmessage{% \__deprecation_old:Nnn \xetex_if_engine:TF { \sys_if_engine_xetex:TF } { 2017-01-01 } \cs_gset:Npn \cs_argument_spec:N { \cs_parameter_spec:N } +\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case_true:n } +\cs_gset:Npn \bool_case_true:n { \bool_case:n } +\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case_true:nT } +\cs_gset:Npn \bool_case_true:nT { \bool_case:nT } +\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case_true:nF } +\cs_gset:Npn \bool_case_true:nF { \bool_case:nF } +\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case_true:nTF } +\cs_gset:Npn \bool_case_true:nTF { \bool_case:nTF } \__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_lowercase:n } \cs_gset:Npn \str_lower_case:n { \str_lowercase:n } \__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_lowercase:f } diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex index c5d46cd9c8a..99c584404de 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2023-04-20}% +\def\ExplFileDate{2023-05-05}% \let\ExplLoaderFileDate\ExplFileDate \begingroup \catcode`\_=11 diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx b/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx index 16e04c16a7f..b95a6bf2479 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2023-04-20}% +\def\ExplFileDate{2023-05-05}% \let\ExplLoaderFileDate\ExplFileDate \begingroup \catcode`\_=11 diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 1dae09998d8..be1ef27a9b6 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2023-04-20}% +\def\ExplFileDate{2023-05-05}% \let\ExplLoaderFileDate\ExplFileDate \ProvidesPackage{expl3} [% diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3debug.def b/Master/texmf-dist/tex/latex/l3kernel/l3debug.def index 7177bac2ea9..af741efb155 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3debug.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3debug.def @@ -575,7 +575,7 @@ \flag_if_raised:nTF \flag_if_raised_p:n \flag_height:n - \flag_raise_if_clear:n + \flag_ensure_raised:n \flag_clear:n } \__kernel_patch:nnn |