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.dtx103
1 files changed, 81 insertions, 22 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index 044aba65b3e..9d810aa9872 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2017/07/19}
+% \date{Released 2017/09/18}
%
% \maketitle
%
@@ -1110,7 +1110,8 @@
% \begin{macro}{\dim_gset:Nn, \dim_gset:cn}
% Setting dimensions is easy enough.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_set:Nn } }
\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 }
@@ -1141,13 +1142,15 @@
% \begin{macro}{\dim_gsub:Nn, \dim_gsub:cn}
% Using |by| here deals with the (incorrect) case |\dimen123|.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_add:Nn } }
\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 }
\cs_generate_variant:Nn \dim_add:Nn { c }
\cs_generate_variant:Nn \dim_gadd:Nn { c }
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_sub:Nn } }
\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 }
@@ -1172,7 +1175,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 { { (#1) } }
+\__debug_patch_args:nNNpn
+ { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_abs:n } }
\cs_new:Npn \dim_abs:n #1
{
\exp_after:wN \@@_abs:N
@@ -1180,7 +1184,11 @@
}
\cs_new:Npn \@@_abs:N #1
{ \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
+\__debug_patch_args:nNNpn
+ {
+ { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_max:nn }
+ { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_max:nn }
+ }
\cs_new:Npn \dim_max:nn #1#2
{
\dim_use:N \@@_eval:w \exp_after:wN \@@_maxmin:wwN
@@ -1189,7 +1197,11 @@
>
\@@_eval_end:
}
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
+\__debug_patch_args:nNNpn
+ {
+ { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_min:nn }
+ { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_min:nn }
+ }
\cs_new:Npn \dim_min:nn #1#2
{
\dim_use:N \@@_eval:w \exp_after:wN \@@_maxmin:wwN
@@ -1233,7 +1245,12 @@
% \begin{macro}[pTF, EXP]{\dim_compare:nNn}
% Simple comparison.
% \begin{macrocode}
-\__debug_patch_conditional_args:nNNpnn { { (#1) \@@_eval_end: } {#2} { (#3) } }
+\__debug_patch_conditional_args:nNNpnn
+ {
+ { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_compare:nNn }
+ { \@@_eval_end: #2 }
+ { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \dim_compare:nNn }
+ }
\prg_new_conditional:Npnn \dim_compare:nNn #1#2#3 { p , T , F , TF }
{
\if_dim:w \@@_eval:w #1 #2 \@@_eval:w #3 \@@_eval_end:
@@ -1433,7 +1450,8 @@
% \begin{macro}{\dim_eval:n}
% Evaluating a dimension expression expandably.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
+\__debug_patch_args:nNNpn
+ { { \__debug_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}
@@ -1460,7 +1478,8 @@
% terminating early and leaving extra tokens lying around. This is
% used a lot by low-level manipulations.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
+\__debug_patch_args:nNNpn
+ { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal:n } }
\cs_new:Npn \dim_to_decimal:n #1
{
\exp_after:wN
@@ -1495,7 +1514,8 @@
% Another hard-coded conversion: this one is necessary to avoid things going
% off-scale.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
+\__debug_patch_args:nNNpn
+ { { \__debug_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}
@@ -1645,7 +1665,8 @@
% \begin{macro}{\skip_gset:Nn, \skip_gset:cn}
% Much the same as for dimensions.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ { {#1} { \__debug_chk_expr:nNnN {#2} \etex_glueexpr:D { } \skip_set:Nn } }
\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 }
@@ -1677,13 +1698,15 @@
% \begin{macro}{\skip_gsub:Nn, \skip_gsub:cn}
% Using |by| here deals with the (incorrect) case |\skip123|.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ { {#1} { \__debug_chk_expr:nNnN {#2} \etex_glueexpr:D { } \skip_add:Nn } }
\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 }
\cs_generate_variant:Nn \skip_add:Nn { c }
\cs_generate_variant:Nn \skip_gadd:Nn { c }
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ { {#1} { \__debug_chk_expr:nNnN {#2} \etex_glueexpr:D { } \skip_sub:Nn } }
\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 }
@@ -1726,7 +1749,13 @@
% \begin{macrocode}
\cs_set_protected:Npn \__cs_tmp:w #1
{
- \__debug_patch_conditional_args:nNNpnn { { (##1) } }
+ \__debug_patch_conditional_args:nNNpnn
+ {
+ {
+ \__debug_chk_expr:nNnN
+ {##1} \etex_glueexpr:D { } \skip_if_finite:n
+ }
+ }
\prg_new_conditional:Npnn \skip_if_finite:n ##1 { p , T , F , TF }
{
\exp_after:wN \__skip_if_finite:wwNw
@@ -1745,7 +1774,8 @@
% \begin{macro}{\skip_eval:n}
% Evaluating a skip expression expandably.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
+\__debug_patch_args:nNNpn
+ { { \__debug_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}
@@ -1767,11 +1797,13 @@
% Inserting skips.
% \begin{macrocode}
\cs_new_eq:NN \skip_horizontal:N \tex_hskip:D
-\__debug_patch_args:nNNpn { { (#1) } }
+\__debug_patch_args:nNNpn
+ { { \__debug_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 { { (#1) } }
+\__debug_patch_args:nNNpn
+ { { \__debug_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 }
@@ -1909,7 +1941,14 @@
% \begin{macro}{\muskip_gset:Nn, \muskip_gset:cn}
% This should be pretty familiar.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ {
+ {#1}
+ {
+ \__debug_chk_expr:nNnN {#2} \etex_muexpr:D
+ { \etex_mutoglue:D } \muskip_set:Nn
+ }
+ }
\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 }
@@ -1947,13 +1986,27 @@
% \begin{macro}{\muskip_gsub:Nn, \muskip_gsub:cn}
% Using |by| here deals with the (incorrect) case |\muskip123|.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ {
+ {#1}
+ {
+ \__debug_chk_expr:nNnN {#2} \etex_muexpr:D
+ { \etex_mutoglue:D } \muskip_add:Nn
+ }
+ }
\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 }
\cs_generate_variant:Nn \muskip_add:Nn { c }
\cs_generate_variant:Nn \muskip_gadd:Nn { c }
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+ {
+ {#1}
+ {
+ \__debug_chk_expr:nNnN {#2} \etex_muexpr:D
+ { \etex_mutoglue:D } \muskip_sub:Nn
+ }
+ }
\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 }
@@ -1970,7 +2023,13 @@
% \begin{macro}{\muskip_eval:n}
% Evaluating a muskip expression expandably.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
+\__debug_patch_args:nNNpn
+ {
+ {
+ \__debug_chk_expr:nNnN {#1} \etex_muexpr:D
+ { \etex_mutoglue:D } \muskip_eval:n
+ }
+ }
\cs_new:Npn \muskip_eval:n #1
{ \muskip_use:N \etex_muexpr:D #1 \scan_stop: }
% \end{macrocode}