summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3skip.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx277
1 files changed, 185 insertions, 92 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index bc7f26ed868..a20a48ccc66 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -8,7 +8,7 @@
% license or (at your option) any later version. The latest version
% of this license is in the file
%
-% http://www.latex-project.org/lppl.txt
+% https://www.latex-project.org/lppl.txt
%
% This file is part of the "l3kernel bundle" (The Work in LPPL)
% and all files in that bundle must be distributed together.
@@ -22,7 +22,7 @@
% for those people who are interested.
%
%<*driver>
-\documentclass[full]{l3doc}
+\documentclass[full,kernel]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2017/11/14}
+% \date{Released 2017/12/05}
%
% \maketitle
%
@@ -1011,6 +1011,16 @@
% \end{texnote}
% \end{function}
%
+% \begin{function}[EXP]{\__dim_eval:n}
+% \begin{syntax}
+% \cs{__dim_eval:n} \Arg{dimexpr}
+% \end{syntax}
+% By default this expands to \cs{__dim_eval:w} \meta{dimexpr}
+% \cs{__dim_eval_end:} but when debugging is enabled this expands to a
+% more complicated construction that evaluates \meta{dimexpr} with
+% parentheses and within a brace group to detect early termination.
+% \end{function}
+%
% \end{documentation}
%
% \begin{implementation}
@@ -1058,12 +1068,17 @@
%
% \begin{macro}{\dim_const:Nn, \dim_const:cn}
% Contrarily to integer constants, we cannot avoid using a register,
-% even for constants.
-% \begin{macrocode}
-\cs_new_protected:Npn \dim_const:Nn #1
+% even for constants. We cannot use \cs{dim_gset:Nn} because
+% debugging code would complain that the constant is not a global
+% variable. Since \cs{dim_const:Nn} does not need to be fast, use
+% \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 } { }
+\cs_new_protected:Npn \dim_const:Nn #1#2
{
\dim_new:N #1
- \dim_gset:Nn #1
+ \tex_global:D #1 ~ \dim_eval:n {#2} \scan_stop:
}
\cs_generate_variant:Nn \dim_const:Nn { c }
% \end{macrocode}
@@ -1071,10 +1086,15 @@
%
% \begin{macro}{\dim_zero:N, \dim_zero:c}
% \begin{macro}{\dim_gzero:N, \dim_gzero:c}
-% Reset the register to zero.
-% \begin{macrocode}
-\cs_new_protected:Npn \dim_zero:N #1 { #1 \c_zero_dim }
-\cs_new_protected:Npn \dim_gzero:N { \tex_global:D \dim_zero:N }
+% Reset the register to zero. Using \cs{c_zero_skip} deals with the
+% 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 } { }
+\cs_new_protected:Npn \dim_zero:N #1 { #1 \c_zero_skip }
+\__debug_patch:nnNNpn { \__debug_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 }
\cs_generate_variant:Nn \dim_gzero:N { c }
% \end{macrocode}
@@ -1106,15 +1126,36 @@
%
% \subsection{Setting \texttt{dim} variables}
%
+% Several functions here have a signature |:Nn| and are such that when
+% debugging, the first argument should be checked to be a local/global
+% variable and the second should be wrapped in code for an expression.
+% The temporary function \cs{@@_tmp:w} finds the name |#3| of the
+% function being redefined and writes the appropriate patch.
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_tmp:w #1#2#3
+ {
+ \__debug_patch_args:nnnNNpn
+ { #1 ##1 }
+ { }
+ { {##1} { \__debug_chk_expr:nNnN {##2} \@@_eval:w { } #3 } }
+ #2 #3
+ }
+% \end{macrocode}
+%
% \begin{macro}{\dim_set:Nn, \dim_set:cn}
% \begin{macro}{\dim_gset:Nn, \dim_gset:cn}
-% Setting dimensions is easy enough.
+% Setting dimensions is easy enough but when debugging we want both to
+% check that the variable is correctly local/global and to wrap the
+% expression in some code. The \cs{scan_stop:} deals with the case
+% where the variable passed is a skip (for example a \LaTeXe{}
+% length).
% \begin{macrocode}
-\__debug_patch_args:nNNpn
- { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_set:Nn } }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \dim_set:Nn #1#2
- { #1 ~ \@@_eval:w #2 \@@_eval_end: }
-\cs_new_protected:Npn \dim_gset:Nn { \tex_global:D \dim_set:Nn }
+ { #1 ~ \@@_eval:w #2 \@@_eval_end: \scan_stop: }
+\@@_tmp:w \__debug_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 }
\cs_generate_variant:Nn \dim_gset:Nn { c }
% \end{macrocode}
@@ -1124,12 +1165,17 @@
% \begin{macro}{\dim_set_eq:NN, \dim_set_eq:cN, \dim_set_eq:Nc, \dim_set_eq:cc}
% \begin{macro}
% {\dim_gset_eq:NN, \dim_gset_eq:cN, \dim_gset_eq:Nc, \dim_gset_eq:cc}
-% All straightforward.
+% All straightforward, with a \cs{scan_stop:} to deal with the case
+% where |#1| is (incorrectly) a skip.
% \begin{macrocode}
-\cs_new_protected:Npn \dim_set_eq:NN #1#2 { #1 = #2 }
+\__debug_patch:nnNNpn { \__debug_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 }
\cs_generate_variant:Nn \dim_set_eq:NN { Nc , cc }
-\cs_new_protected:Npn \dim_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
+\__debug_patch:nnNNpn { \__debug_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 }
\cs_generate_variant:Nn \dim_gset_eq:NN { Nc , cc }
% \end{macrocode}
@@ -1141,19 +1187,26 @@
% \begin{macro}{\dim_sub:Nn, \dim_sub:cn}
% \begin{macro}{\dim_gsub:Nn, \dim_gsub:cn}
% Using |by| here deals with the (incorrect) case |\dimen123|.
+% Using \cs{scan_stop:} deals with skip variables. Since
+% debugging checks that the variable is correctly local/global, the
+% global versions cannot be defined as \cs{tex_global:D} followed by
+% the local versions. The debugging code is inserted by
+% \cs{@@_tmp:w}.
% \begin{macrocode}
-\__debug_patch_args:nNNpn
- { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_add:Nn } }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \dim_add:Nn #1#2
- { \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: }
-\cs_new_protected:Npn \dim_gadd:Nn { \tex_global:D \dim_add:Nn }
+ { \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: \scan_stop: }
+\@@_tmp:w \__debug_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 }
-\__debug_patch_args:nNNpn
- { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_sub:Nn } }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \dim_sub:Nn #1#2
- { \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: }
-\cs_new_protected:Npn \dim_gsub:Nn { \tex_global:D \dim_sub:Nn }
+ { \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: \scan_stop: }
+\@@_tmp:w \__debug_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 }
\cs_generate_variant:Nn \dim_gsub:Nn { c }
% \end{macrocode}
@@ -1165,11 +1218,11 @@
% \subsection{Utilities for dimension calculations}
%
% \begin{macro}[EXP]{\dim_abs:n}
-% \begin{macro}[aux, EXP]{\@@_abs:N}
+% \begin{macro}[EXP]{\@@_abs:N}
% \UnitTested
% \begin{macro}[EXP]{\dim_max:nn}
% \begin{macro}[EXP]{\dim_min:nn}
-% \begin{macro}[aux, EXP]{\@@_maxmin:wwN}
+% \begin{macro}[EXP]{\@@_maxmin:wwN}
% \UnitTested
% \UnitTested
% Functions for $\min$, $\max$, and absolute value with only one evaluation.
@@ -1226,7 +1279,7 @@
% \end{macro}
%
% \begin{macro}{\dim_ratio:nn}
-% \begin{macro}[aux]{\@@_ratio:n}
+% \begin{macro}{\@@_ratio:n}
% With dimension expressions, something like |10 pt * ( 5 pt / 10 pt )| does
% not work. Instead, the ratio part needs to be converted to an integer
% expression. Using \cs{__int_value:w} forces everything into |sp|, avoiding
@@ -1260,8 +1313,8 @@
% \end{macro}
%
% \begin{macro}[pTF, EXP]{\dim_compare:n}
-% \begin{macro}[aux, EXP]{\@@_compare:w, \@@_compare:wNN}
-% \begin{macro}[aux, EXP]
+% \begin{macro}[EXP]{\@@_compare:w, \@@_compare:wNN}
+% \begin{macro}[EXP]
% {
% \@@_compare_=:w,
% \@@_compare_!:w,
@@ -1290,9 +1343,7 @@
\@@_compare:wNN #1 ? { = \@@_compare_end:w \else: } \q_stop
}
\exp_args:Nno \use:nn
- { \cs_new:Npn \@@_compare:wNN #1 }
- { \tl_to_str:n {pt} }
- #2#3
+ { \cs_new:Npn \@@_compare:wNN #1 } { \tl_to_str:n {pt} #2#3 }
{
\if_meaning:w = #3
\use:c { @@_compare_#2:w }
@@ -1321,8 +1372,8 @@
% \end{macro}
%
% \begin{macro}[EXP, noTF]{\dim_case:nn}
-% \begin{macro}[aux]{\@@_case:nnTF}
-% \begin{macro}[aux]{\@@_case:nw, \@@_case_end:nw}
+% \begin{macro}{\@@_case:nnTF}
+% \begin{macro}{\@@_case:nw, \@@_case_end:nw}
% For dimension cases, the first task to fully expand the check
% condition. The over all idea is then much the same as for
% \cs[index=str_case:nnTF]{str_case:nn(TF)} as described in \pkg{l3basics}.
@@ -1457,6 +1508,18 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_eval:n}
+% Evaluating a dimension expression expandably. This is for use in
+% other modules, to avoid having to patch many commands. The only
+% 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 } }
+\cs_new:Npn \@@_eval:n #1 { \@@_eval:w #1 \@@_eval_end: }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\dim_use:N, \dim_use:c}
% Accessing a \meta{dim}.
% \begin{macrocode}
@@ -1470,7 +1533,7 @@
% \end{macro}
%
% \begin{macro}[EXP]{\dim_to_decimal:n}
-% \begin{macro}[EXP, aux]{\@@_to_decimal:w}
+% \begin{macro}[EXP]{\@@_to_decimal:w}
% A function which comes up often enough to deserve a place in the
% kernel. Evaluate the dimension expression~|#1| then remove the
% trailing \texttt{pt}. When debugging is enabled, the argument is
@@ -1556,7 +1619,7 @@
% dimension expressions: this gives a more unified output.
% \begin{macrocode}
\cs_new_protected:Npn \dim_show:n
- { \__msg_show_wrap:Nn \dim_eval:n }
+ { \msg_show_eval:Nn \dim_eval:n }
% \end{macrocode}
% \end{macro}
%
@@ -1566,7 +1629,7 @@
\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_next: \dim_show:n }
+ { \msg_log_eval:Nn \dim_eval:n }
% \end{macrocode}
% \end{macro}
%
@@ -1613,12 +1676,14 @@
%
% \begin{macro}{\skip_const:Nn, \skip_const:cn}
% Contrarily to integer constants, we cannot avoid using a register,
-% even for constants.
+% even for constants. See \cs{dim_const:Nn} for why we cannot use
+% \cs{skip_gset:Nn}.
% \begin{macrocode}
-\cs_new_protected:Npn \skip_const:Nn #1
+\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { }
+\cs_new_protected:Npn \skip_const:Nn #1#2
{
\skip_new:N #1
- \skip_gset:Nn #1
+ \tex_global:D #1 ~ \skip_eval:n {#2} \scan_stop:
}
\cs_generate_variant:Nn \skip_const:Nn { c }
% \end{macrocode}
@@ -1628,8 +1693,10 @@
% \begin{macro}{\skip_gzero:N, \skip_gzero:c}
% Reset the register to zero.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \skip_zero:N #1 { #1 \c_zero_skip }
-\cs_new_protected:Npn \skip_gzero:N { \tex_global:D \skip_zero:N }
+\__debug_patch:nnNNpn { \__debug_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 }
% \end{macrocode}
@@ -1661,15 +1728,31 @@
%
% \subsection{Setting \texttt{skip} variables}
%
+% Much as for \texttt{dim} variables, \cs{@@_tmp:w} prepares a patch
+% for |:Nn| function definitions in which the first argument should be
+% checked to be a local/global variable and the second should be wrapped
+% in code for an expression.
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_tmp:w #1#2#3
+ {
+ \__debug_patch_args:nnnNNpn
+ { #1 ##1 }
+ { }
+ { {##1} { \__debug_chk_expr:nNnN {##2} \etex_glueexpr:D { } #3 } }
+ #2 #3
+ }
+% \end{macrocode}
+%
% \begin{macro}{\skip_set:Nn, \skip_set:cn}
% \begin{macro}{\skip_gset:Nn, \skip_gset:cn}
% Much the same as for dimensions.
% \begin{macrocode}
-\__debug_patch_args:nNNpn
- { {#1} { \__debug_chk_expr:nNnN {#2} \etex_glueexpr:D { } \skip_set:Nn } }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \skip_set:Nn #1#2
{ #1 ~ \etex_glueexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \skip_gset:Nn { \tex_global:D \skip_set:Nn }
+\@@_tmp:w \__debug_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 }
\cs_generate_variant:Nn \skip_gset:Nn { c }
% \end{macrocode}
@@ -1698,18 +1781,20 @@
% \begin{macro}{\skip_gsub:Nn, \skip_gsub:cn}
% Using |by| here deals with the (incorrect) case |\skip123|.
% \begin{macrocode}
-\__debug_patch_args:nNNpn
- { {#1} { \__debug_chk_expr:nNnN {#2} \etex_glueexpr:D { } \skip_add:Nn } }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \skip_add:Nn #1#2
{ \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \skip_gadd:Nn { \tex_global:D \skip_add:Nn }
+\@@_tmp:w \__debug_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 }
-\__debug_patch_args:nNNpn
- { {#1} { \__debug_chk_expr:nNnN {#2} \etex_glueexpr:D { } \skip_sub:Nn } }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \skip_sub:Nn #1#2
{ \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \skip_gsub:Nn { \tex_global:D \skip_sub:Nn }
+\@@_tmp:w \__debug_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 }
\cs_generate_variant:Nn \skip_gsub:Nn { c }
% \end{macrocode}
@@ -1738,7 +1823,7 @@
% \end{macro}
%
% \begin{macro}[EXP,pTF]{\skip_if_finite:n}
-% \begin{macro}[EXP,aux]{\__skip_if_finite:wwNw}
+% \begin{macro}[EXP]{\__skip_if_finite:wwNw}
% With \eTeX{}, we have an easy access to the order of infinities of
% the stretch and shrink components of a skip. However, to access
% both, we either need to evaluate the expression twice, or evaluate
@@ -1747,7 +1832,7 @@
% it is quicker to make it search for the string \texttt{fil} which
% characterizes infinite glue.
% \begin{macrocode}
-\cs_set_protected:Npn \__cs_tmp:w #1
+\cs_set_protected:Npn \@@_tmp:w #1
{
\__debug_patch_conditional_args:nNNpnn
{
@@ -1764,7 +1849,7 @@
}
\cs_new:Npn \__skip_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \q_stop {##3}
}
-\exp_args:No \__cs_tmp:w { \tl_to_str:n { fil } }
+\exp_args:No \@@_tmp:w { \tl_to_str:n { fil } }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1827,7 +1912,7 @@
% skip expressions: this gives a more unified output.
% \begin{macrocode}
\cs_new_protected:Npn \skip_show:n
- { \__msg_show_wrap:Nn \skip_eval:n }
+ { \msg_show_eval:Nn \skip_eval:n }
% \end{macrocode}
% \end{macro}
%
@@ -1837,7 +1922,7 @@
\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_next: \skip_show:n }
+ { \msg_log_eval:Nn \skip_eval:n }
% \end{macrocode}
% \end{macro}
%
@@ -1884,13 +1969,13 @@
% \end{macro}
%
% \begin{macro}{\muskip_const:Nn, \muskip_const:cn}
-% Contrarily to integer constants, we cannot avoid using a register,
-% even for constants.
+% See \cs{skip_const:Nn}.
% \begin{macrocode}
-\cs_new_protected:Npn \muskip_const:Nn #1
+\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { }
+\cs_new_protected:Npn \muskip_const:Nn #1#2
{
\muskip_new:N #1
- \muskip_gset:Nn #1
+ \tex_global:D #1 ~ \muskip_eval:n {#2} \scan_stop:
}
\cs_generate_variant:Nn \muskip_const:Nn { c }
% \end{macrocode}
@@ -1900,9 +1985,12 @@
% \begin{macro}{\muskip_gzero:N, \muskip_gzero:c}
% Reset the register to zero.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \muskip_zero:N #1
{ #1 \c_zero_muskip }
-\cs_new_protected:Npn \muskip_gzero:N { \tex_global:D \muskip_zero:N }
+\__debug_patch:nnNNpn { \__debug_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 }
\cs_generate_variant:Nn \muskip_gzero:N { c }
% \end{macrocode}
@@ -1937,21 +2025,34 @@
%
% \subsection{Setting \texttt{muskip} variables}
%
+% See \texttt{skip} case.
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_tmp:w #1#2#3
+ {
+ \__debug_patch_args:nnnNNpn
+ { #1 ##1 }
+ { }
+ {
+ {##1}
+ {
+ \__debug_chk_expr:nNnN {##2}
+ \etex_muexpr:D { \etex_mutoglue:D } #3
+ }
+ }
+ #2 #3
+ }
+% \end{macrocode}
+%
% \begin{macro}{\muskip_set:Nn, \muskip_set:cn}
% \begin{macro}{\muskip_gset:Nn, \muskip_gset:cn}
% This should be pretty familiar.
% \begin{macrocode}
-\__debug_patch_args:nNNpn
- {
- {#1}
- {
- \__debug_chk_expr:nNnN {#2} \etex_muexpr:D
- { \etex_mutoglue:D } \muskip_set:Nn
- }
- }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \muskip_set:Nn #1#2
{ #1 ~ \etex_muexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \muskip_gset:Nn { \tex_global:D \muskip_set:Nn }
+\@@_tmp:w \__debug_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 }
\cs_generate_variant:Nn \muskip_gset:Nn { c }
% \end{macrocode}
@@ -1970,9 +2071,11 @@
% }
% All straightforward.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_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 }
\cs_generate_variant:Nn \muskip_set_eq:NN { Nc , cc }
+\__debug_patch:nnNNpn { \__debug_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 }
\cs_generate_variant:Nn \muskip_gset_eq:NN { Nc , cc }
@@ -1986,30 +2089,20 @@
% \begin{macro}{\muskip_gsub:Nn, \muskip_gsub:cn}
% Using |by| here deals with the (incorrect) case |\muskip123|.
% \begin{macrocode}
-\__debug_patch_args:nNNpn
- {
- {#1}
- {
- \__debug_chk_expr:nNnN {#2} \etex_muexpr:D
- { \etex_mutoglue:D } \muskip_add:Nn
- }
- }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \muskip_add:Nn #1#2
{ \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \muskip_gadd:Nn { \tex_global:D \muskip_add:Nn }
+\@@_tmp:w \__debug_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 }
-\__debug_patch_args:nNNpn
- {
- {#1}
- {
- \__debug_chk_expr:nNnN {#2} \etex_muexpr:D
- { \etex_mutoglue:D } \muskip_sub:Nn
- }
- }
+\@@_tmp:w \__debug_chk_var_local:N
\cs_new_protected:Npn \muskip_sub:Nn #1#2
{ \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \muskip_gsub:Nn { \tex_global:D \muskip_sub:Nn }
+\@@_tmp:w \__debug_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 }
\cs_generate_variant:Nn \muskip_gsub:Nn { c }
% \end{macrocode}
@@ -2058,7 +2151,7 @@
% muskip expressions: this gives a more unified output.
% \begin{macrocode}
\cs_new_protected:Npn \muskip_show:n
- { \__msg_show_wrap:Nn \muskip_eval:n }
+ { \msg_show_eval:Nn \muskip_eval:n }
% \end{macrocode}
% \end{macro}
%
@@ -2068,7 +2161,7 @@
\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_next: \muskip_show:n }
+ { \msg_log_eval:Nn \muskip_eval:n }
% \end{macrocode}
% \end{macro}
%