diff options
author | Karl Berry <karl@freefriends.org> | 2019-08-26 21:05:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-08-26 21:05:47 +0000 |
commit | bfd55e1fa306b0e1c0db5fc689fb45b81d5da0c8 (patch) | |
tree | 7abd27cdb5a328a0ba00c48698439588ec5edab8 /Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex | |
parent | 69257bb16c7433813887ca515263e76c85c6c0e9 (diff) |
l3 (26aug19)
git-svn-id: svn://tug.org/texlive/trunk@51962 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex | 136 |
1 files changed, 88 insertions, 48 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex index 3f68d30e8b9..85d7a37dc7f 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex @@ -65,7 +65,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2019-08-14}% +\def\ExplFileDate{2019-08-25}% \begingroup \def\next{\endgroup}% \expandafter\ifx\csname PackageError\endcsname\relax @@ -4264,22 +4264,21 @@ \cs_generate_variant:Nn \tl_gput_right:No { c } \cs_generate_variant:Nn \tl_gput_right:Nx { c } \tl_const:Nx \c__tl_rescan_marker_tl { : \token_to_str:N : } -\cs_new_protected:Npn \tl_set_rescan:Nnn - { \__tl_set_rescan:NNnn \tl_set:No } -\cs_new_protected:Npn \tl_gset_rescan:Nnn - { \__tl_set_rescan:NNnn \tl_gset:No } \cs_new_protected:Npn \tl_rescan:nn #1#2 { \tl_set_rescan:Nnn \l__tl_internal_a_tl {#1} {#2} \exp_after:wN \tl_clear:N \exp_after:wN \l__tl_internal_a_tl \l__tl_internal_a_tl } +\cs_new_protected:Npn \tl_set_rescan:Nnn + { \__tl_set_rescan:NNnn \tl_set:No } +\cs_new_protected:Npn \tl_gset_rescan:Nnn + { \__tl_set_rescan:NNnn \tl_gset:No } \cs_new_protected:Npn \__tl_set_rescan:NNnn #1#2#3#4 { \group_begin: \if_false: { \fi: \int_set_eq:NN \tex_tracingnesting:D \c_zero_int - \exp_args:No \tex_everyeof:D { \c__tl_rescan_marker_tl } \int_compare:nNnT \tex_endlinechar:D = { 32 } { \int_set:Nn \tex_endlinechar:D { -1 } } \int_set_eq:NN \tex_newlinechar:D \tex_endlinechar:D @@ -4289,6 +4288,7 @@ } \cs_new_protected:Npn \__tl_set_rescan_multi:nNN #1#2#3 { + \exp_args:No \tex_everyeof:D { \c__tl_rescan_marker_tl } \exp_after:wN \__tl_rescan:NNw \exp_after:wN #2 \exp_after:wN #3 @@ -4325,7 +4325,8 @@ \int_compare:nNnTF { \char_value_catcode:n {#1} / 2 } = 6 { - \exp_args:Nf \__tl_set_rescan_single_aux:nnNN + \exp_args:Nof \__tl_set_rescan_single_aux:nnnNN + \c__tl_rescan_marker_tl { \char_generate:nn {#1} { \char_value_catcode:n {#1} } } } { @@ -4337,20 +4338,28 @@ { \__tl_set_rescan_multi:nNN } } } -\cs_new_protected:Npn \__tl_set_rescan_single_aux:nnNN #1#2#3#4 +\cs_new_protected:Npn \__tl_set_rescan_single_aux:nnnNN #1#2#3#4#5 { - \exp_args:Nno \use:nn - { \cs_set:Npn \__tl_rescan:NNw ##1##2##3 #1 } - \c__tl_rescan_marker_tl + \tex_everyeof:D + { + #1 \use_none:n + #2 #1 { \exp:w \__tl_set_rescan_single_aux:w } + \q_stop + } + \cs_set:Npn \__tl_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \q_stop { \group_end: - ##1 ##2 { \use_none:n ##3 } + ##1 ##2 { ##4 ##3 } } \exp_after:wN \__tl_rescan:NNw - \exp_after:wN #3 \exp_after:wN #4 - \tex_scantokens:D { #1 #2 #1 } + \exp_after:wN #5 + \tex_scantokens:D { #2 #3 #2 } } +\exp_args:Nno \use:nn + { \cs_new:Npn \__tl_set_rescan_single_aux:w #1 } + \c__tl_rescan_marker_tl #2 + { \use_i:nn \exp_end: #1 } \cs_new_protected:Npn \tl_replace_once:Nnn { \__tl_replace:NnNNNnn \q_mark ? \__tl_replace_wrap:w \tl_set:Nx } \cs_new_protected:Npn \tl_greplace_once:Nnn @@ -4631,8 +4640,8 @@ { \exp_args:No \tl_map_variable:nNn } \cs_new_protected:Npn \__tl_map_variable:Nnn #1#2#3 { + \quark_if_recursion_tail_break:nN {#3} \tl_map_break: \tl_set:Nn #1 {#3} - \quark_if_recursion_tail_break:NN #1 \tl_map_break: \use:n {#2} \__tl_map_variable:Nnn #1 {#2} } @@ -8166,8 +8175,8 @@ } \cs_new_protected:Npn \__clist_map_variable:Nnw #1#2#3, { + \quark_if_recursion_tail_stop:n {#3} \tl_set:Nn #1 {#3} - \quark_if_recursion_tail_stop:N #1 \use:n {#2} \__clist_map_variable:Nnw #1 {#2} } @@ -9062,55 +9071,63 @@ \prop_new:N \l_tmpb_prop \prop_new:N \g_tmpa_prop \prop_new:N \g_tmpb_prop +\prop_new:N \l__prop_internal_prop \cs_new_protected:Npn \prop_set_from_keyval:Nn #1#2 - { \tl_set:Nx #1 { \__prop_from_keyval:n {#2} } } + { + \prop_clear:N \l__prop_internal_prop + \__prop_from_keyval:n {#2} + \prop_set_eq:NN #1 \l__prop_internal_prop + \prop_clear:N \l__prop_internal_prop + } \cs_generate_variant:Nn \prop_set_from_keyval:Nn { c } \cs_new_protected:Npn \prop_gset_from_keyval:Nn #1#2 - { \tl_gset:Nx #1 { \__prop_from_keyval:n {#2} } } + { + \prop_clear:N \l__prop_internal_prop + \__prop_from_keyval:n {#2} + \prop_gset_eq:NN #1 \l__prop_internal_prop + \prop_clear:N \l__prop_internal_prop + } \cs_generate_variant:Nn \prop_gset_from_keyval:Nn { c } \cs_new_protected:Npn \prop_const_from_keyval:Nn #1#2 - { \tl_const:Nx #1 { \__prop_from_keyval:n {#2} } } + { + \prop_clear:N \l__prop_internal_prop + \__prop_from_keyval:n {#2} + \tl_const:Nx #1 { \exp_not:o \l__prop_internal_prop } + \prop_clear:N \l__prop_internal_prop + } \cs_generate_variant:Nn \prop_const_from_keyval:Nn { c } -\cs_new:Npn \__prop_from_keyval:n #1 +\cs_new_protected:Npn \__prop_from_keyval:n #1 { - \s__prop - \__prop_from_keyval_loop:w \q_mark #1 , + \__prop_from_keyval_loop:w \prg_do_nothing: #1 , \q_recursion_tail , \q_recursion_stop } -\cs_new:Npn \__prop_from_keyval_loop:w #1 , +\cs_new_protected:Npn \__prop_from_keyval_loop:w #1 , { - \quark_if_recursion_tail_stop:o { \use_none:n #1 } + \quark_if_recursion_tail_stop:o {#1} \__prop_from_keyval_split:Nw \__prop_from_keyval_key:n - #1 = = \q_stop { \use_none:n #1 } - \__prop_from_keyval_loop:w \q_mark + #1 = = \q_stop {#1} + \__prop_from_keyval_loop:w \prg_do_nothing: } -\cs_new:Npn \__prop_from_keyval_split:Nw #1#2 = - { - \tl_trim_spaces_apply:oN { \use_none:n #2 } #1 - \q_nil - } -\cs_new:Npn \__prop_from_keyval_key:n #1 - { \__prop_from_keyval_key:w #1 } -\cs_new:Npn \__prop_from_keyval_key:w #1 \q_nil #2 \q_stop +\cs_new_protected:Npn \__prop_from_keyval_split:Nw #1#2 = + { \tl_trim_spaces_apply:oN {#2} #1 } +\cs_new_protected:Npn \__prop_from_keyval_key:n #1 + { \__prop_from_keyval_key:w #1 \q_nil } +\cs_new_protected:Npn \__prop_from_keyval_key:w #1 \q_nil #2 \q_stop { \__prop_from_keyval_split:Nw \__prop_from_keyval_value:n - \q_mark #2 \q_stop {#1} + \prg_do_nothing: #2 \q_stop {#1} } -\cs_new:Npn \__prop_from_keyval_value:n #1 - { \__prop_from_keyval_value:w #1 } -\cs_new:Npn \__prop_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4 +\cs_new_protected:Npn \__prop_from_keyval_value:n #1 + { \__prop_from_keyval_value:w #1 \q_nil } +\cs_new_protected:Npn \__prop_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4 { \tl_if_empty:nF { #3 #1 #2 } { \str_if_eq:nnTF {#2} { = } + { \prop_put:Nnn \l__prop_internal_prop {#3} {#1} } { - \exp_not:N \__prop_pair:wn \tl_to_str:n {#3} - \s__prop { \exp_not:n {#1} } - } - { - \__kernel_msg_expandable_error:nnf - { kernel } { prop-keyval } - { \exp_after:wN \exp_stop_f: #4 } + \__kernel_msg_error:nnx { kernel } { prop-keyval } + { \exp_not:o {#4} } } } } @@ -13393,6 +13410,13 @@ } \cs_new:Npn \__fp_neg_sign:N #1 { \__fp_int_eval:w 2 - #1 \__fp_int_eval_end: } +\cs_new:Npn \__fp_kind:w #1 + { + \__fp_if_type_fp:NTwFw + #1 \__fp_use_ii_until_s:nnw + \s__fp { \__fp_use_i_until_s:nw 4 } + \q_stop + } \cs_new:Npn \__fp_sanitize:Nw #1 #2; { \if_case:w @@ -14102,9 +14126,17 @@ { \__fp_small_int:wTF #3; { \__fp_round:Nwn #1#2; } { - \__fp_invalid_operation_tl_o:ff - { \__fp_round_name_from_cs:N #1 } - { \__fp_array_to_clist:n { #2; #3; } } + \if:w 3 \__fp_kind:w #3 ; + \exp_after:wN \use_i:nn + \else: + \exp_after:wN \use_ii:nn + \fi: + { \exp_after:wN \c_nan_fp } + { + \__fp_invalid_operation_tl_o:ff + { \__fp_round_name_from_cs:N #1 } + { \__fp_array_to_clist:n { #2; #3; } } + } } } \cs_new:Npn \__fp_round:Nwn #1 \s__fp \__fp_chk:w #2#3#4; #5 @@ -15606,6 +15638,14 @@ { \__fp_parse_function:NNN \__fp_minmax_o:Nw 0 } \prg_new_eq_conditional:NNn \fp_if_exist:N \cs_if_exist:N { TF , T , F , p } \prg_new_eq_conditional:NNn \fp_if_exist:c \cs_if_exist:c { TF , T , F , p } +\prg_new_conditional:Npnn \fp_if_nan:n #1 { TF , T , F , p } + { + \if:w 3 \exp_last_unbraced:Nf \__fp_kind:w { \__fp_parse:n {#1} } + \prg_return_true: + \else: + \prg_return_false: + \fi: + } \prg_new_conditional:Npnn \fp_compare:n #1 { p , T , F , TF } { \exp_after:wN \__fp_compare_return:w |