diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3skip.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3skip.dtx | 277 |
1 files changed, 209 insertions, 68 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index be237db6c17..ed740f3a2f0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % %% File: l3skip.dtx Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX3 Project -%% (C) 2012-2017 The LaTeX3 Project +%% (C) 2012-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 @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -386,6 +386,54 @@ % \texttt{false}. % \end{function} % +% \section{Dimension step functions} +% +% \begin{function}[added = 2018-02-18, rEXP] +% {\dim_step_function:nnnN} +% \begin{syntax} +% \cs{dim_step_function:nnnN} \Arg{initial value} \Arg{step} \Arg{final value} \meta{function} +% \end{syntax} +% This function first evaluates the \meta{initial value}, \meta{step} +% and \meta{final value}, all of which should be dimension expressions. +% The \meta{function} is then placed in front of each \meta{value} +% from the \meta{initial value} to the \meta{final value} in turn +% (using \meta{step} between each \meta{value}). The \meta{step} must +% be non-zero. If the \meta{step} is positive, the loop stops when +% the \meta{value} becomes larger than the \meta{final value}. If the +% \meta{step} is negative, the loop stops when the \meta{value} +% becomes smaller than the \meta{final value}. The \meta{function} +% should absorb one argument. +% \end{function} +% +% \begin{function}[added = 2018-02-18] +% {\dim_step_inline:nnnn} +% \begin{syntax} +% \cs{dim_step_inline:nnnn} \Arg{initial value} \Arg{step} \Arg{final value} \Arg{code} +% \end{syntax} +% This function first evaluates the \meta{initial value}, \meta{step} +% and \meta{final value}, all of which should be dimension expressions. +% Then for each \meta{value} from the \meta{initial value} to the +% \meta{final value} in turn (using \meta{step} between each +% \meta{value}), the \meta{code} is inserted into the input stream +% with |#1| replaced by the current \meta{value}. Thus the +% \meta{code} should define a function of one argument~(|#1|). +% \end{function} +% +% \begin{function}[added = 2018-02-18] +% {\dim_step_variable:nnnNn} +% \begin{syntax} +% \cs{dim_step_variable:nnnNn} \\ +% ~~\Arg{initial value} \Arg{step} \Arg{final value} \meta{tl~var} \Arg{code} +% \end{syntax} +% This function first evaluates the \meta{initial value}, \meta{step} +% and \meta{final value}, all of which should be dimension expressions. +% Then for each \meta{value} from the \meta{initial value} to the +% \meta{final value} in turn (using \meta{step} between each +% \meta{value}), the \meta{code} is inserted into the input stream, +% with the \meta{tl~var} defined as the current \meta{value}. Thus +% the \meta{code} should make use of the \meta{tl~var}. +% \end{function} +% % \section{Using \texttt{dim} expressions and variables} % % \begin{function}[updated = 2011-10-22, EXP]{\dim_eval:n} @@ -1074,7 +1122,7 @@ % \cs{dim_eval:n} to avoid needing a debugging patch that wraps the % expression in checking code. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \dim_const:Nn #1#2 { \dim_new:N #1 @@ -1090,9 +1138,9 @@ % case where the variable passed is incorrectly a skip (for example a % \LaTeXe{} length). % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \dim_zero:N #1 { #1 \c_zero_skip } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \dim_gzero:N #1 { \tex_global:D #1 \c_zero_skip } \cs_generate_variant:Nn \dim_zero:N { c } @@ -1134,10 +1182,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} @@ -1150,10 +1198,10 @@ % where the variable passed is a skip (for example a \LaTeXe{} % length). % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \dim_set:Nn #1#2 { #1 ~ \@@_eval:w #2 \@@_eval_end: \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \dim_gset:Nn #1#2 { \tex_global:D #1 ~ \@@_eval:w #2 \@@_eval_end: \scan_stop: } \cs_generate_variant:Nn \dim_set:Nn { c } @@ -1168,11 +1216,11 @@ % All straightforward, with a \cs{scan_stop:} to deal with the case % where |#1| is (incorrectly) a skip. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \dim_set_eq:NN #1#2 { #1 = #2 \scan_stop: } \cs_generate_variant:Nn \dim_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 \dim_gset_eq:NN #1#2 { \tex_global:D #1 = #2 \scan_stop: } \cs_generate_variant:Nn \dim_gset_eq:NN { c , Nc , cc } @@ -1191,18 +1239,18 @@ % the local versions. The debugging code is inserted by % \cs{@@_tmp:w}. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \dim_add:Nn #1#2 { \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \dim_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: \scan_stop: } \cs_generate_variant:Nn \dim_add:Nn { c } \cs_generate_variant:Nn \dim_gadd:Nn { c } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \dim_sub:Nn #1#2 { \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \dim_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: \scan_stop: } \cs_generate_variant:Nn \dim_sub:Nn { c } @@ -1226,8 +1274,8 @@ % Functions for $\min$, $\max$, and absolute value with only one evaluation. % The absolute value is evaluated by removing a leading~|-| if present. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_abs:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_abs:n } } \cs_new:Npn \dim_abs:n #1 { \exp_after:wN \@@_abs:N @@ -1235,10 +1283,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 { } \dim_max:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_max:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_max:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \dim_max:nn } } \cs_new:Npn \dim_max:nn #1#2 { @@ -1248,10 +1296,10 @@ > \@@_eval_end: } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_min:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_min:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_min:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \dim_min:nn } } \cs_new:Npn \dim_min:nn #1#2 { @@ -1296,11 +1344,11 @@ % \begin{macro}[pTF, EXP]{\dim_compare:nNn} % Simple comparison. % \begin{macrocode} -\__debug_patch_conditional_args:nNNpnn +\__kernel_patch_conditional_args:nNNpnn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_compare:nNn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_compare:nNn } { \@@_eval_end: #2 } - { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \dim_compare:nNn } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \dim_compare:nNn } } \prg_new_conditional:Npnn \dim_compare:nNn #1#2#3 { p , T , F , TF } { @@ -1494,13 +1542,106 @@ % \end{macro} % \end{macro} % +% \subsection{Dimension step functions} +% +% \begin{macro}{\dim_step_function:nnnN} +% \begin{macro}{\@@_step:wwwN, \@@_step:NnnnN} +% Before all else, evaluate the initial value, step, and final value. +% Repeating a function by steps first needs a check on the direction +% of the steps. After that, do the function for the start value then +% step and loop around. It would be more symmetrical to test for a +% step size of zero before checking the sign, but we optimize for the +% most frequent case (positive step). +% \begin{macrocode} +\__kernel_patch_args:nNNpn + { + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \dim_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \dim_step_function:nnnN } + } +\cs_new:Npn \dim_step_function:nnnN #1#2#3 + { + \exp_after:wN \@@_step:wwwN + \tex_the:D \@@_eval:w #1 \exp_after:wN ; + \tex_the:D \@@_eval:w #2 \exp_after:wN ; + \tex_the:D \@@_eval:w #3 ; + } +\cs_new:Npn \@@_step:wwwN #1; #2; #3; #4 + { + \dim_compare:nNnTF {#2} > \c_zero_dim + { \@@_step:NnnnN > } + { + \dim_compare:nNnTF {#2} = \c_zero_dim + { + \__kernel_msg_expandable_error:nnn { kernel } { zero-step } {#4} + \use_none:nnnn + } + { \@@_step:NnnnN < } + } + {#1} {#2} {#3} #4 + } +\cs_new:Npn \@@_step:NnnnN #1#2#3#4#5 + { + \dim_compare:nNnF {#2} #1 {#4} + { + #5 {#2} + \exp_args:NNf \@@_step:NnnnN + #1 { \dim_eval:n { #2 + #3 } } {#3} {#4} #5 + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\dim_step_inline:nnnn} +% \begin{macro}{\dim_step_variable:nnnNn} +% \begin{macro}{\@@_step:NNnnnn} +% The approach here is to build a function, with a global integer +% required to make the nesting safe (as seen in other in line +% functions), and map that function using \cs{dim_step_function:nnnN}. +% We put a \cs{__prg_break_point:Nn} so that \texttt{map_break} +% functions from other modules correctly decrement \cs{g__prg_map_int} +% before looking for their own break point. The first argument is +% \cs{scan_stop:}, so that no breaking function recognizes this break +% point as its own. +% \begin{macrocode} +\cs_new_protected:Npn \dim_step_inline:nnnn + { + \int_gincr:N \g__prg_map_int + \exp_args:NNc \@@_step:NNnnnn + \cs_gset_protected:Npn + { __prg_map_ \int_use:N \g__prg_map_int :w } + } +\cs_new_protected:Npn \dim_step_variable:nnnNn #1#2#3#4#5 + { + \int_gincr:N \g__prg_map_int + \exp_args:NNc \@@_step:NNnnnn + \cs_gset_protected:Npx + { __prg_map_ \int_use:N \g__prg_map_int :w } + {#1}{#2}{#3} + { + \tl_set:Nn \exp_not:N #4 {##1} + \exp_not:n {#5} + } + } +\cs_new_protected:Npn \@@_step:NNnnnn #1#2#3#4#5#6 + { + #1 #2 ##1 {#6} + \dim_step_function:nnnN {#3} {#4} {#5} #2 + \__prg_break_point:Nn \scan_stop: { \int_gdecr:N \g__prg_map_int } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \subsection{Using \texttt{dim} expressions and variables} % % \begin{macro}{\dim_eval:n} % Evaluating a dimension expression expandably. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_eval:n } } \cs_new:Npn \dim_eval:n #1 { \dim_use:N \@@_eval:w #1 \@@_eval_end: } % \end{macrocode} @@ -1512,8 +1653,8 @@ % difference with \cs{dim_eval:n} is the lack of \cs{dim_use:N}, to % produce an internal dimension rather than expand it into characters. % \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} @@ -1539,8 +1680,8 @@ % terminating early and leaving extra tokens lying around. This is % used a lot by low-level manipulations. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal:n } } \cs_new:Npn \dim_to_decimal:n #1 { \exp_after:wN @@ -1575,8 +1716,8 @@ % Another hard-coded conversion: this one is necessary to avoid things going % off-scale. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal_in_sp:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal_in_sp:n } } \cs_new:Npn \dim_to_decimal_in_sp:n #1 { \int_eval:n { \@@_eval:w #1 \@@_eval_end: } } % \end{macrocode} @@ -1677,7 +1818,7 @@ % even for constants. See \cs{dim_const:Nn} for why we cannot use % \cs{skip_gset:Nn}. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \skip_const:Nn #1#2 { \skip_new:N #1 @@ -1691,9 +1832,9 @@ % \begin{macro}{\skip_gzero:N, \skip_gzero:c} % Reset the 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 \skip_zero:N #1 { #1 \c_zero_skip } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \skip_gzero:N #1 { \tex_global:D #1 \c_zero_skip } \cs_generate_variant:Nn \skip_zero:N { c } \cs_generate_variant:Nn \skip_gzero:N { c } @@ -1733,10 +1874,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} \etex_glueexpr:D { } #3 } } + { {##1} { \__kernel_chk_expr:nNnN {##2} \etex_glueexpr:D { } #3 } } #2 #3 } % \end{macrocode} @@ -1745,10 +1886,10 @@ % \begin{macro}{\skip_gset:Nn, \skip_gset:cn} % Much the same as for dimensions. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_set:Nn #1#2 { #1 ~ \etex_glueexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gset:Nn #1#2 { \tex_global:D #1 ~ \etex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_set:Nn { c } @@ -1777,18 +1918,18 @@ % \begin{macro}{\skip_gsub:Nn, \skip_gsub:cn} % Using |by| here deals with the (incorrect) case |\skip123|. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_add:Nn #1#2 { \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_add:Nn { c } \cs_generate_variant:Nn \skip_gadd:Nn { c } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_sub:Nn #1#2 { \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_sub:Nn { c } @@ -1830,10 +1971,10 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1 { - \__debug_patch_conditional_args:nNNpnn + \__kernel_patch_conditional_args:nNNpnn { { - \__debug_chk_expr:nNnN + \__kernel_chk_expr:nNnN {##1} \etex_glueexpr:D { } \skip_if_finite:n } } @@ -1855,8 +1996,8 @@ % \begin{macro}{\skip_eval:n} % Evaluating a skip expression expandably. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_eval:n } } \cs_new:Npn \skip_eval:n #1 { \skip_use:N \etex_glueexpr:D #1 \scan_stop: } % \end{macrocode} @@ -1878,13 +2019,13 @@ % Inserting skips. % \begin{macrocode} \cs_new_eq:NN \skip_horizontal:N \tex_hskip:D -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_horizontal:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_horizontal:n } } \cs_new:Npn \skip_horizontal:n #1 { \skip_horizontal:N \etex_glueexpr:D #1 \scan_stop: } \cs_new_eq:NN \skip_vertical:N \tex_vskip:D -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_vertical:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_vertical:n } } \cs_new:Npn \skip_vertical:n #1 { \skip_vertical:N \etex_glueexpr:D #1 \scan_stop: } \cs_generate_variant:Nn \skip_horizontal:N { c } @@ -1967,7 +2108,7 @@ % \begin{macro}{\muskip_const:Nn, \muskip_const:cn} % See \cs{skip_const:Nn}. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \muskip_const:Nn #1#2 { \muskip_new:N #1 @@ -1981,10 +2122,10 @@ % \begin{macro}{\muskip_gzero:N, \muskip_gzero:c} % Reset the 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 \muskip_zero:N #1 { #1 \c_zero_muskip } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \muskip_gzero:N #1 { \tex_global:D #1 \c_zero_muskip } \cs_generate_variant:Nn \muskip_zero:N { c } @@ -2025,13 +2166,13 @@ % \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} + \__kernel_chk_expr:nNnN {##2} \etex_muexpr:D { \etex_mutoglue:D } #3 } } @@ -2043,10 +2184,10 @@ % \begin{macro}{\muskip_gset:Nn, \muskip_gset:cn} % This should be pretty familiar. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_set:Nn #1#2 { #1 ~ \etex_muexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gset:Nn #1#2 { \tex_global:D #1 ~ \etex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_set:Nn { c } @@ -2067,10 +2208,10 @@ % } % All straightforward. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \muskip_set_eq:NN #1#2 { #1 = #2 } \cs_generate_variant:Nn \muskip_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 \muskip_gset_eq:NN #1#2 { \tex_global:D #1 = #2 } \cs_generate_variant:Nn \muskip_gset_eq:NN { c , Nc , cc } % \end{macrocode} @@ -2083,18 +2224,18 @@ % \begin{macro}{\muskip_gsub:Nn, \muskip_gsub:cn} % Using |by| here deals with the (incorrect) case |\muskip123|. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_add:Nn #1#2 { \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_add:Nn { c } \cs_generate_variant:Nn \muskip_gadd:Nn { c } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_sub:Nn #1#2 { \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_sub:Nn { c } @@ -2110,10 +2251,10 @@ % \begin{macro}{\muskip_eval:n} % Evaluating a muskip expression expandably. % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { { - \__debug_chk_expr:nNnN {#1} \etex_muexpr:D + \__kernel_chk_expr:nNnN {#1} \etex_muexpr:D { \etex_mutoglue:D } \muskip_eval:n } } |