diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3int.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3int.dtx | 115 |
1 files changed, 55 insertions, 60 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index 53945625ced..732c2b7b968 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3int.dtx Copyright (C) 1990-2017 The LaTeX3 Project +%% File: l3int.dtx Copyright (C) 1990-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1035,8 +1035,8 @@ % or directly in the input stream. % When debugging, use parentheses to catch early termination. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_eval:n } } \cs_new:Npn \int_eval:n #1 { \@@_value:w \@@_eval:w #1 \@@_eval_end: } % \end{macrocode} @@ -1047,8 +1047,8 @@ % so as to produce an internal integer rather than expanding into % characters. This is for use in other modules. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } } \cs_new:Npn \@@_eval:n #1 { \@@_eval:w #1 \@@_eval_end: } % \end{macrocode} % \end{macro} @@ -1065,8 +1065,8 @@ % evaluation. The absolute value is obtained by removing a leading % sign if any. All three functions expand in two steps. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_abs:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_abs:n } } \cs_new:Npn \int_abs:n #1 { \@@_value:w \exp_after:wN \@@_abs:N @@ -1075,10 +1075,10 @@ } \cs_new:Npn \@@_abs:N #1 { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_max:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_max:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_max:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_max:nn } } \cs_set:Npn \int_max:nn #1#2 { @@ -1088,10 +1088,10 @@ > \exp_stop_f: } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_min:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_min:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_min:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_min:nn } } \cs_set:Npn \int_min:nn #1#2 { @@ -1137,10 +1137,10 @@ % truncating behaviour that we want. The details are thanks to Heiko % Oberdiek: getting things right in all cases is not so easy. % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_div_truncate:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_div_truncate:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_div_truncate:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_div_truncate:nn } } \cs_new:Npn \int_div_truncate:nn #1#2 { @@ -1171,10 +1171,10 @@ % \end{macrocode} % Finally there's the modulus operation. % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_mod:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_mod:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_mod:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_mod:nn } } \cs_new:Npn \int_mod:nn #1#2 { @@ -1224,10 +1224,10 @@ % We cannot use \cs{int_gset:Nn} because (when |check-declarations| is % enabled) this runs some checks that constants would fail. % \begin{macrocode} -\__debug_patch_args:nnnNNpn - { \__debug_chk_var_scope:NN c #1 } +\__kernel_patch_args:nnnNNpn + { \__kernel_chk_var_scope:NN c #1 } { } - { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_const:Nn } } + { {#1} { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_const:Nn } } \cs_new_protected:Npn \int_const:Nn #1#2 { \int_compare:nNnTF {#2} < \c_zero @@ -1273,9 +1273,9 @@ % \UnitTested % Functions that reset an \meta{integer} register to zero. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_zero:N #1 { #1 = \c_zero } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gzero:N #1 { \tex_global:D #1 = \c_zero } \cs_generate_variant:Nn \int_zero:N { c } \cs_generate_variant:Nn \int_gzero:N { c } @@ -1305,10 +1305,10 @@ % another. Check that assigned integer is local/global. No need to % check that the other one is defined as \TeX{} does it for us. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_set_eq:NN #1#2 { #1 = #2 } \cs_generate_variant:Nn \int_set_eq:NN { c , Nc , cc } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gset_eq:NN #1#2 { \tex_global:D #1 = #2 } \cs_generate_variant:Nn \int_gset_eq:NN { c , Nc , cc } % \end{macrocode} @@ -1335,10 +1335,10 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1#2#3 { - \__debug_patch_args:nnnNNpn + \__kernel_patch_args:nnnNNpn { #1 ##1 } { } - { {##1} { \__debug_chk_expr:nNnN {##2} \@@_eval:w { } #3 } } + { {##1} { \__kernel_chk_expr:nNnN {##2} \@@_eval:w { } #3 } } #2 #3 } % \end{macrocode} @@ -1356,16 +1356,16 @@ % assigned variable is correctly local/global and wraps the % expression in some checking code. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \int_add:Nn #1#2 { \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \int_sub:Nn #1#2 { \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \int_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \int_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: } \cs_generate_variant:Nn \int_add:Nn { c } @@ -1389,16 +1389,16 @@ % Incrementing and decrementing of integer registers is done with % the following functions. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_incr:N #1 { \tex_advance:D #1 \c_one } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_decr:N #1 { \tex_advance:D #1 - \c_one } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gincr:N #1 { \tex_global:D \tex_advance:D #1 \c_one } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gdecr:N #1 { \tex_global:D \tex_advance:D #1 - \c_one } \cs_generate_variant:Nn \int_incr:N { c } @@ -1420,10 +1420,10 @@ % existence as for token list variables. However, the code that % checks whether the assignment is local or global is still needed. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \int_set:Nn #1#2 { #1 ~ \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \int_gset:Nn #1#2 { \tex_global:D #1 ~ \@@_eval:w #2 \@@_eval_end: } \cs_generate_variant:Nn \int_set:Nn { c } @@ -1474,7 +1474,7 @@ { { } \c_zero \fi: - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { unknown-comparison } {#1} \prg_return_false: } @@ -1627,11 +1627,11 @@ % \UnitTested % More efficient but less natural in typing. % \begin{macrocode} -\__debug_patch_conditional_args:nNNpnn +\__kernel_patch_conditional_args:nNNpnn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_compare:nNn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_compare:nNn } { \@@_eval_end: #2 } - { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \int_compare:nNn } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \int_compare:nNn } } \prg_new_conditional:Npnn \int_compare:nNn #1#2#3 { p , T , F , TF } { @@ -1691,8 +1691,8 @@ % \UnitTested % A predicate function. % \begin{macrocode} -\__debug_patch_conditional_args:nNNpnn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_odd:n } } +\__kernel_patch_conditional_args:nNNpnn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_odd:n } } \prg_new_conditional:Npnn \int_if_odd:n #1 { p , T , F , TF} { \if_int_odd:w \@@_eval:w #1 \@@_eval_end: @@ -1701,8 +1701,8 @@ \prg_return_false: \fi: } -\__debug_patch_conditional_args:nNNpnn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_even:n } } +\__kernel_patch_conditional_args:nNNpnn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_even:n } } \prg_new_conditional:Npnn \int_if_even:n #1 { p , T , F , TF} { \if_int_odd:w \@@_eval:w #1 \@@_eval_end: @@ -1818,11 +1818,11 @@ % step size of zero before checking the sign, but we optimize for the % most frequent case (positive step). % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_step_function:nnnN } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_step_function:nnnN } - { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \int_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \int_step_function:nnnN } } \cs_new:Npn \int_step_function:nnnN #1#2#3 { @@ -1838,7 +1838,7 @@ { \int_compare:nNnTF {#2} = \c_zero { - \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#4} + \__kernel_msg_expandable_error:nnn { kernel } { zero-step } {#4} \use_none:nnnn } { \@@_step:NnnnN < } @@ -2593,14 +2593,9 @@ %<package>\cs_gset_eq:NN \c__deprecation_minus_one \m@ne %<initex>\int_const:Nn \c__deprecation_minus_one { -1 } \cs_new_eq:NN \c_minus_one \c__deprecation_minus_one -\__debug:TF - { - \tl_gput_right:Nn \g__debug_deprecation_on_tl - { \__deprecation_error:Nnn \c_minus_one { -1 } { 2018-12-31 } } - \tl_gput_right:Nn \g__debug_deprecation_off_tl - { \tex_let:D \c_minus_one \c__deprecation_minus_one } - } - { } +\__kernel_deprecation_code:nn + { \__deprecation_error:Nnn \c_minus_one { -1 } { 2018-12-31 } } + { \tex_let:D \c_minus_one \c__deprecation_minus_one } % \end{macrocode} % \end{variable} % |