[latex3-commits] [l3svn] r7414 - Provide check-expressions debugging tool

noreply at latex-project.org noreply at latex-project.org
Thu Aug 3 04:14:58 CEST 2017


Author: bruno
Date: 2017-08-03 04:14:58 +0200 (Thu, 03 Aug 2017)
New Revision: 7414

Modified:
   trunk/l3kernel/l3basics.dtx
   trunk/l3kernel/l3candidates.dtx
   trunk/l3kernel/l3int.dtx
   trunk/l3kernel/l3msg.dtx
   trunk/l3kernel/l3skip.dtx
   trunk/l3kernel/testfiles/m3compare001.tlg
   trunk/l3kernel/testfiles/m3expl001.luatex.tlg
   trunk/l3kernel/testfiles/m3expl001.ptex.tlg
   trunk/l3kernel/testfiles/m3expl001.tlg
   trunk/l3kernel/testfiles/m3expl001.uptex.tlg
   trunk/l3kernel/testfiles/m3expl001.xetex.tlg
   trunk/l3kernel/testfiles/m3expl003.luatex.tlg
   trunk/l3kernel/testfiles/m3expl003.ptex.tlg
   trunk/l3kernel/testfiles/m3expl003.tlg
   trunk/l3kernel/testfiles/m3expl003.uptex.tlg
   trunk/l3kernel/testfiles/m3expl003.xetex.tlg
   trunk/l3kernel/testfiles/m3int001.luatex.tlg
   trunk/l3kernel/testfiles/m3int001.ptex.tlg
   trunk/l3kernel/testfiles/m3int001.tlg
   trunk/l3kernel/testfiles/m3int001.uptex.tlg
   trunk/l3kernel/testfiles/m3int001.xetex.tlg
   trunk/l3kernel/testfiles/m3int002.luatex.tlg
   trunk/l3kernel/testfiles/m3int002.ptex.tlg
   trunk/l3kernel/testfiles/m3int002.tlg
   trunk/l3kernel/testfiles/m3int002.uptex.tlg
   trunk/l3kernel/testfiles/m3int002.xetex.tlg
   trunk/l3kernel/testfiles/m3skip001.tlg
   trunk/l3kernel/testfiles/m3skip002.tlg
   trunk/l3kernel/testfiles/m3skip004.tlg
   trunk/l3kernel/testfiles/m3skip005.lvt
   trunk/l3kernel/testfiles/m3skip005.tlg
Log:
Provide check-expressions debugging tool

With \debug_on:n { check-expressions }, all expressions are wrapped
with some code that checks for bad input such as "1 ~ 2" which with
eTeX's \numexpr would terminate the expression early without warning.


Modified: trunk/l3kernel/l3basics.dtx
===================================================================
--- trunk/l3kernel/l3basics.dtx	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/l3basics.dtx	2017-08-03 02:14:58 UTC (rev 7414)
@@ -1233,6 +1233,23 @@
 %   \cs{cs_if_exist_p:N}, and if not raises a kernel-level error.
 % \end{function}
 %
+% \begin{function}{\__debug_chk_expr:nNnN}
+%   \begin{syntax}
+%     \cs{__debug_chk_expr:nNnN} \Arg{expr} \meta{eval} \Arg{convert} \meta{caller}
+%   \end{syntax}
+%   This function is only created if debugging is enabled.  By default
+%   it is equivalent to \cs{use_i:nnnn}.  When expression checking is
+%   enabled, it leaves in the input stream the result of \cs{tex_the:D}
+%   \meta{eval} \meta{expr} \cs{tex_relax:D} after checking that no
+%   token was left over.  If any token was not taken as part of the
+%   expression, there is an error message displaying the result of the
+%   evaluation as well as the \meta{caller}.  For instance \meta{eval}
+%   can be \cs{__int_eval:w} and \meta{caller} can be \cs{int_eval:n} or
+%   \cs{int_set:Nn}.  The argument \meta{convert} is empty except for mu
+%   expressions where it is \cs{etex_mutoglue:D}, used for internal
+%   purposes.
+% \end{function}
+%
 % \begin{function}{\__debug_chk_var_exist:N}
 %   \begin{syntax}
 %     \cs{__debug_chk_var_exist:N} \meta{var}
@@ -1307,7 +1324,7 @@
 %     \cs{cs_new:Npn} \cs{int_eval:n} |#1| \\
 %     ~~|{ \__int_value:w \__int_eval:w #1 \__int_eval_end: }|
 %   \end{quote}
-%   replaces |#1| by |(#1)| in the definition of \cs{int_eval:n} when
+%   would replace |#1| by |(#1)| in the definition of \cs{int_eval:n} when
 %   debugging is enabled.  This fails if the \meta{code} contains~|##|.
 %   The \cs{__debug_patch_conditional_args:nNNpnn} function is for use
 %   before \cs{prg_new_conditional:Npnn} or its \texttt{_protected}
@@ -1773,8 +1790,8 @@
 %   {\__debug_check-declarations_on:, \__debug_check-declarations_off:}
 % \begin{macro}[int]{\__debug_chk_var_exist:N}
 % \begin{macro}[int]{\__debug_chk_cs_exist:N, \__debug_chk_cs_exist:c}
-%   When debugging is not active these two functions produce an
-%   error.  Otherwise they set up \cs{__debug_chk_var_exist:N} and
+%   When debugging is enabled these two functions
+%   set up \cs{__debug_chk_var_exist:N} and
 %   \cs{__debug_chk_cs_exist:N}, two functions that test (when
 %   \texttt{check-declarations} is active) that their argument is
 %   defined.
@@ -1819,6 +1836,64 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}[aux]
+%   {\__debug_check-expressions_on:, \__debug_check-expressions_off:}
+% \begin{macro}[int]{\__debug_chk_expr:nNnN}
+% \begin{macro}[aux]{\__debug_chk_expr_aux:nNnN}
+%   When debugging is enabled these two functions set
+%   \cs{__debug_chk_expr:nNnN} to test or not whether the given
+%   expression is valid.  The idea is to evaluate the expression within
+%   a brace group (to catch trailing \cs{use_none:nn} or similar), then
+%   test that the result is what we expect.  This is done by turning it
+%   to an integer and hitting that with \cs{tex_romannumeral:D} after
+%   replacing the first character by |-0|.  If all goes well, that
+%   primitive finds a non-positive integer and gives an empty output.
+%   If the original expression evaluation stopped early it leaves a
+%   trailing \cs{tex_relax:D}, which stops the second evaluation (used
+%   to convert to integer) before it encounters the final
+%   \cs{tex_relax:D}.  Since \cs{tex_romannumeral:D} does not absorb
+%   \cs{tex_relax:D} the output will be nonempty.  Note that |#3| is
+%   empty except for mu expressions for which it is \cs{etex_mutoglue:D}
+%   to avoid an \enquote{incompatible glue units} error.  Note also that
+%   if we had omitted the first \cs{tex_relax:D} then for instance
+%   |1+2\relax+3| would incorrectly be accepted as a valid integer
+%   expression.
+%    \begin{macrocode}
+\__debug:TF
+  {
+    \exp_args:Nc \cs_set_protected:Npn { __debug_check-expressions_on: }
+      {
+        \cs_set:Npn \__debug_chk_expr:nNnN ##1##2
+          {
+            \exp_after:wN \__debug_chk_expr_aux:nNnN
+            \exp_after:wN { \tex_the:D ##2 ##1 \tex_relax:D }
+            ##2
+          }
+      }
+    \exp_args:Nc \cs_set_protected:Npn { __debug_check-expressions_off: }
+      { \cs_set:Npn \__debug_chk_expr:nNnN ##1##2##3##4 {##1} }
+    \use:c { __debug_check-expressions_off: }
+    \cs_set:Npn \__debug_chk_expr_aux:nNnN #1#2#3#4
+      {
+        \tl_if_empty:oF
+          {
+            \tex_romannumeral:D - 0
+            \exp_after:wN \use_none:n
+            \__int_value:w #3 #2 #1 \tex_relax:D
+          }
+          {
+            \__msg_kernel_expandable_error:nnnn
+              { kernel } { expr } {#4} {#1}
+          }
+        #1
+      }
+  }
+  { }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}[aux]{\__debug_log-functions_on:, \__debug_log-functions_off:}
 % \begin{macro}[int]{\__debug_log:x, \__debug_suspend_log:, \__debug_resume_log:}
 %   These two functions

Modified: trunk/l3kernel/l3candidates.dtx
===================================================================
--- trunk/l3kernel/l3candidates.dtx	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/l3candidates.dtx	2017-08-03 02:14:58 UTC (rev 7414)
@@ -84,7 +84,7 @@
 %
 % \section{Additions to \pkg{l3basics}}
 %
-% \begin{function}[added = 2017-07-16]{\debug_on:n, \debug_off:n}
+% \begin{function}[added = 2017-07-16, updated = 2017-08-02]{\debug_on:n, \debug_off:n}
 %   \begin{syntax}
 %     \cs{debug_on:n} |{| \meta{comma-separated list} |}|
 %     \cs{debug_off:n} |{| \meta{comma-separated list} |}|
@@ -95,6 +95,8 @@
 %   \begin{itemize}
 %     \item \texttt{check-declarations} that checks all \pkg{expl3}
 %       variables used were previously declared;
+%     \item \texttt{check-expressions} that checks integer, dimension,
+%       skip, and muskip expressions are not terminated prematurely;
 %     \item \texttt{deprecation} that makes soon-to-be-deprecated commands produce errors;
 %     \item \texttt{log-functions} that logs function definitions;
 %   \end{itemize}

Modified: trunk/l3kernel/l3int.dtx
===================================================================
--- trunk/l3kernel/l3int.dtx	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/l3int.dtx	2017-08-03 02:14:58 UTC (rev 7414)
@@ -1010,7 +1010,8 @@
 %   or directly in the input stream.
 %   When debugging, use parentheses to catch early termination.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } }
+\__debug_patch_args:nNNpn
+  { { \__debug_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}
@@ -1028,7 +1029,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 { { (#1) } }
+\__debug_patch_args:nNNpn
+  { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_abs:n } }
 \cs_new:Npn \int_abs:n #1
   {
     \@@_value:w \exp_after:wN \@@_abs:N
@@ -1037,7 +1039,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 { } \int_max:nn }
+    { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_max:nn }
+  }
 \cs_set:Npn \int_max:nn #1#2
   {
     \@@_value:w \exp_after:wN \@@_maxmin:wwN
@@ -1046,7 +1052,11 @@
       >
     \exp_stop_f:
   }
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
+\__debug_patch_args:nNNpn
+  {
+    { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_min:nn }
+    { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_min:nn }
+  }
 \cs_set:Npn \int_min:nn #1#2
   {
     \@@_value:w \exp_after:wN \@@_maxmin:wwN
@@ -1091,7 +1101,11 @@
 %   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 { { (#1) } { (#2) } }
+\__debug_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 }
+  }
 \cs_new:Npn \int_div_truncate:nn #1#2
   {
     \@@_value:w \@@_eval:w
@@ -1121,7 +1135,11 @@
 %    \end{macrocode}
 %   Finally there's the modulus operation.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } }
+\__debug_patch_args:nNNpn
+  {
+    { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_mod:nn }
+    { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_mod:nn }
+  }
 \cs_new:Npn \int_mod:nn #1#2
   {
     \@@_value:w \@@_eval:w \exp_after:wN \@@_mod:ww
@@ -1168,6 +1186,8 @@
 %   set up code to determine what can be done. No full engine testing just yet
 %   so everything is a little awkward.
 %    \begin{macrocode}
+\__debug_patch_args:nNNpn
+  { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_const:Nn } }
 \cs_new_protected:Npn \int_const:Nn #1#2
   {
     \int_compare:nNnTF {#2} < \c_zero
@@ -1184,7 +1204,7 @@
           {
             \__chk_if_free_cs:N #1
             \tex_global:D \@@_constdef:Nw #1 =
-              \@@_eval:w (#2) \@@_eval_end:
+              \@@_eval:w #2 \@@_eval_end:
           }
       }
   }
@@ -1274,10 +1294,12 @@
 % \UnitTested
 %    Adding and subtracting to and from a counter \ldots
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+  { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_add:Nn } }
 \cs_new_protected:Npn \int_add:Nn #1#2
   { \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: }
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+  { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_sub:Nn } }
 \cs_new_protected:Npn \int_sub:Nn #1#2
   { \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: }
 \cs_new_protected:Npn \int_gadd:Nn
@@ -1331,7 +1353,8 @@
 %   if they are not defined. Thus there is no need for the checking
 %   code seen with token list variables.
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch_args:nNNpn
+  { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_set:Nn } }
 \cs_new_protected:Npn \int_set:Nn #1#2
   { #1 ~ \@@_eval:w #2 \@@_eval_end: }
 \cs_new_protected:Npn \int_gset:Nn { \tex_global:D \int_set:Nn }
@@ -1536,7 +1559,12 @@
 % \UnitTested
 % More efficient but less natural in typing.
 %    \begin{macrocode}
-\__debug_patch_conditional_args:nNNpnn { { (#1) \@@_eval_end: } {#2} { (#3) } }
+\__debug_patch_conditional_args:nNNpnn
+  {
+    { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_compare:nNn }
+    { \@@_eval_end: #2 }
+    { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \int_compare:nNn }
+  }
 \prg_new_conditional:Npnn \int_compare:nNn #1#2#3 { p , T , F , TF }
   {
     \if_int_compare:w \@@_eval:w #1 #2 \@@_eval:w #3 \@@_eval_end:
@@ -1595,7 +1623,8 @@
 % \UnitTested
 %   A predicate function.
 %    \begin{macrocode}
-\__debug_patch_conditional_args:nNNpnn { { (#1) } }
+\__debug_patch_conditional_args:nNNpnn
+  { { \__debug_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:
@@ -1604,7 +1633,8 @@
       \prg_return_false:
     \fi:
   }
-\__debug_patch_conditional_args:nNNpnn { { (#1) } }
+\__debug_patch_conditional_args:nNNpnn
+  { { \__debug_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:
@@ -1720,7 +1750,12 @@
 %   step size of zero before checking the sign, but we optimize for the
 %   most frequent case (positive step).
 %    \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } { (#2) } { (#3) } }
+\__debug_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 }
+  }
 \cs_new:Npn \int_step_function:nnnN #1#2#3
   {
     \exp_after:wN \@@_step:wwwN

Modified: trunk/l3kernel/l3msg.dtx
===================================================================
--- trunk/l3kernel/l3msg.dtx	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/l3msg.dtx	2017-08-03 02:14:58 UTC (rev 7414)
@@ -1959,6 +1959,7 @@
         '\iow_char:N\\debug_off:n'~only~accept~the~arguments~
         'check-declarations',~'deprecation',~'log-functions',~not~'#1'.
       }
+    \@@_kernel_new:nnn { kernel } { expr } { '#2'~in~#1 }
     \@@_kernel_new:nnnn { kernel } { non-declared-variable }
       { The~variable~#1~has~not~been~declared~\msg_line_context:. }
       {

Modified: trunk/l3kernel/l3skip.dtx
===================================================================
--- trunk/l3kernel/l3skip.dtx	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/l3skip.dtx	2017-08-03 02:14:58 UTC (rev 7414)
@@ -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}

Modified: trunk/l3kernel/testfiles/m3compare001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3compare001.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3compare001.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -195,7 +195,7 @@
 I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 ! Missing number, treated as zero.
 <to be read again> 
-                   )
+                   \__int_eval_end: 
 l. ...  }
 A number should have been here; I inserted `0'.
 (If you can't figure out why I needed to see a number,

Modified: trunk/l3kernel/testfiles/m3expl001.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.luatex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl001.luatex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2801,6 +2801,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.ptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl001.ptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2789,6 +2789,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl001.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2789,6 +2789,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.uptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl001.uptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2789,6 +2789,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.xetex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl001.xetex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2799,6 +2799,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.luatex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl003.luatex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2801,6 +2801,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.ptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl003.ptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2789,6 +2789,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl003.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2789,6 +2789,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.uptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl003.uptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2789,6 +2789,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.xetex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3expl003.xetex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -2799,6 +2799,7 @@
 Defining message LaTeX/kernel/variant-too-long on line ...
 Defining message LaTeX/kernel/invalid-variant on line ...
 Defining message LaTeX/kernel/debug on line ...
+Defining message LaTeX/kernel/expr on line ...
 Defining message LaTeX/kernel/non-declared-variable on line ...
 Defining message LaTeX/kernel/bad-variable on line ...
 Defining message LaTeX/kernel/misused-sequence on line ...

Modified: trunk/l3kernel/testfiles/m3int001.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int001.luatex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int001.luatex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -108,7 +108,7 @@
 24
 -30
 ! Arithmetic overflow.
-\int_set:Nn ...\__int_eval:w (#2)\__int_eval_end: 
+\int_set:Nn ...l:w {}\int_set:Nn \__int_eval_end: 
 l. ...  }
 I can't evaluate this expression,
 since the result is out of range.

Modified: trunk/l3kernel/testfiles/m3int001.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int001.ptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int001.ptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -127,7 +127,7 @@
 24
 -30
 ! Arithmetic overflow.
-\int_set:Nn ...\__int_eval:w (#2)\__int_eval_end: 
+\int_set:Nn ...l:w {}\int_set:Nn \__int_eval_end: 
 l. ...  }
 I can't evaluate this expression,
 since the result is out of range.

Modified: trunk/l3kernel/testfiles/m3int001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int001.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int001.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -127,7 +127,7 @@
 24
 -30
 ! Arithmetic overflow.
-\int_set:Nn ...\__int_eval:w (#2)\__int_eval_end: 
+\int_set:Nn ...l:w {}\int_set:Nn \__int_eval_end: 
 l. ...  }
 I can't evaluate this expression,
 since the result is out of range.

Modified: trunk/l3kernel/testfiles/m3int001.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int001.uptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int001.uptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -108,7 +108,7 @@
 24
 -30
 ! Arithmetic overflow.
-\int_set:Nn ...\__int_eval:w (#2)\__int_eval_end: 
+\int_set:Nn ...l:w {}\int_set:Nn \__int_eval_end: 
 l. ...  }
 I can't evaluate this expression,
 since the result is out of range.

Modified: trunk/l3kernel/testfiles/m3int001.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int001.xetex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int001.xetex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -108,7 +108,7 @@
 24
 -30
 ! Arithmetic overflow.
-\int_set:Nn ...\__int_eval:w (#2)\__int_eval_end: 
+\int_set:Nn ...l:w {}\int_set:Nn \__int_eval_end: 
 l. ...  }
 I can't evaluate this expression,
 since the result is out of range.

Modified: trunk/l3kernel/testfiles/m3int002.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int002.luatex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int002.luatex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -513,16 +513,11 @@
 A number should have been here; I inserted `0'.
 (If you can't figure out why I needed to see a number,
 look up `weird error' in the index to The TeXbook.)
-! Missing ) inserted for expression.
-<to be read again> 
-a
-l. ...}
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 0
 2
 12
 3
-[0a)\__int_eval_end: ]
+[0a\__int_eval_end: ]
 ============================================================
 ============================================================
 TEST 36: Integer conversion to alph

Modified: trunk/l3kernel/testfiles/m3int002.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int002.ptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int002.ptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -513,16 +513,11 @@
 A number should have been here; I inserted `0'.
 (If you can't figure out why I needed to see a number,
 look up `weird error' in the index to The TeXbook.)
-! Missing ) inserted for expression.
-<to be read again> 
-                   a
-l. ...}
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 0
 2
 12
 3
-[0a)\__int_eval_end: ]
+[0a\__int_eval_end: ]
 ============================================================
 ============================================================
 TEST 36: Integer conversion to alph

Modified: trunk/l3kernel/testfiles/m3int002.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int002.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int002.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -513,16 +513,11 @@
 A number should have been here; I inserted `0'.
 (If you can't figure out why I needed to see a number,
 look up `weird error' in the index to The TeXbook.)
-! Missing ) inserted for expression.
-<to be read again> 
-                   a
-l. ...}
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 0
 2
 12
 3
-[0a)\__int_eval_end: ]
+[0a\__int_eval_end: ]
 ============================================================
 ============================================================
 TEST 36: Integer conversion to alph

Modified: trunk/l3kernel/testfiles/m3int002.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int002.uptex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int002.uptex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -513,16 +513,11 @@
 A number should have been here; I inserted `0'.
 (If you can't figure out why I needed to see a number,
 look up `weird error' in the index to The TeXbook.)
-! Missing ) inserted for expression.
-<to be read again> 
-                   a
-l. ...}
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 0
 2
 12
 3
-[0a)\__int_eval_end: ]
+[0a\__int_eval_end: ]
 ============================================================
 ============================================================
 TEST 36: Integer conversion to alph

Modified: trunk/l3kernel/testfiles/m3int002.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3int002.xetex.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3int002.xetex.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -513,16 +513,11 @@
 A number should have been here; I inserted `0'.
 (If you can't figure out why I needed to see a number,
 look up `weird error' in the index to The TeXbook.)
-! Missing ) inserted for expression.
-<to be read again> 
-                   a
-l. ...}
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 0
 2
 12
 3
-[0a)\__int_eval_end: ]
+[0a\__int_eval_end: ]
 ============================================================
 ============================================================
 TEST 36: Integer conversion to alph

Modified: trunk/l3kernel/testfiles/m3skip001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3skip001.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3skip001.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -154,7 +154,7 @@
 Continue and I'll use the largest value I can.
 ! Dimension too large.
 <to be read again> 
-                   )
+                   \scan_stop: 
 l. ...}
 I can't work with sizes bigger than about 19 feet.
 Continue and I'll use the largest value I can.
@@ -181,7 +181,7 @@
 Continue and I'll use the largest value I can.
 ! Dimension too large.
 <to be read again> 
-                   )
+                   \scan_stop: 
 l. ...}
 I can't work with sizes bigger than about 19 feet.
 Continue and I'll use the largest value I can.
@@ -196,7 +196,7 @@
 -32767.00003pt (overflow by 1pt)
 ! Dimension too large.
 <to be read again> 
-                   )
+                   \__dim_eval_end: 
 l. ...}
 I can't work with sizes bigger than about 19 feet.
 Continue and I'll use the largest value I can.
@@ -211,7 +211,7 @@
 32767.00003pt (overflow by 1pt)
 ! Dimension too large.
 <to be read again> 
-                   )
+                   \__dim_eval_end: 
 l. ...}
 I can't work with sizes bigger than about 19 feet.
 Continue and I'll use the largest value I can.

Modified: trunk/l3kernel/testfiles/m3skip002.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3skip002.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3skip002.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -99,16 +99,11 @@
 ============================================================
 TEST 10: Dimension in points
 ============================================================
-! Missing ) inserted for expression.
-<to be read again> 
-                   p
-l. ...}
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 142.26378
 -28.45274
 0.50186
 21.68121
-1.00374pt)\__dim_eval_end: 
+1.00374pt\__dim_eval_end: 
 ============================================================
 ============================================================
 TEST 11: Dimension in a unit
@@ -118,11 +113,6 @@
                    p
 l. ...}
 I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
-! Missing ) inserted for expression.
-<to be read again> 
-                   p
-l. ...}
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 ! Arithmetic overflow.
 <to be read again> 
                    p
@@ -133,5 +123,5 @@
 2
 0.05
 -0.75002
-0pt)\__dim_eval_end: /186467)\__dim_eval_end: 
+0pt)\__dim_eval_end: /186467\__dim_eval_end: 
 ============================================================

Modified: trunk/l3kernel/testfiles/m3skip004.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3skip004.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3skip004.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -50,26 +50,6 @@
                    p
 l. ...  }
 I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
-! Missing ) inserted for expression.
-<to be read again> 
-                   p
-l. ...  }
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
-! Missing ) inserted for expression.
-<to be read again> 
-                   p
-l. ...  }
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
-! Missing ) inserted for expression.
-<to be read again> 
-                   p
-l. ...  }
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
-! Missing ) inserted for expression.
-<to be read again> 
-                   p
-l. ...  }
-I was expecting to see `+', `-', `*', `/', or `)'. Didn't.
 ! Arithmetic overflow.
 <to be read again> 
                    p

Modified: trunk/l3kernel/testfiles/m3skip005.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3skip005.lvt	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3skip005.lvt	2017-08-03 02:14:58 UTC (rev 7414)
@@ -1,5 +1,5 @@
 %
-% Copyright (C) 2012,2015 The LaTeX3 Project
+% Copyright (C) 2012,2015,2017 The LaTeX3 Project
 %
 
 \documentclass{minimal}
@@ -36,6 +36,19 @@
     \muskip_log:N \c_my_muskip
   }
 
+\debug_on:n { check-expressions }
+
+\TEST { Errors }
+  {
+    \dim_log:n { 1 pt 2 pt }
+    \dim_set:Nn \l_tmpa_dim { 3pt * 0pt ) }
+    \dim_compare:nNnTF { 1 cm / 3 pt } < { 2 in } { } { }
+    \skip_log:n { 1 mu }
+    \skip_add:Nn \l_tmpa_skip { 2 inches }
+    \muskip_log:n { 1 mu 2 }
+    \muskip_add:Nn \l_tmpa_muskip { 2 mu ) }
+  }
+
 \END
 
 

Modified: trunk/l3kernel/testfiles/m3skip005.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3skip005.tlg	2017-08-02 16:59:51 UTC (rev 7413)
+++ trunk/l3kernel/testfiles/m3skip005.tlg	2017-08-03 02:14:58 UTC (rev 7414)
@@ -87,3 +87,95 @@
 > \c_my_skip=0.0pt.
 > \c_my_muskip=0.0mu.
 ============================================================
+============================================================
+TEST 3: Errors
+============================================================
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           '1.0pt2pt\tex_relax:D ' in \dim_eval:n 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> 1pt2pt=1.0pt2pt\tex_relax:D \__dim_eval_end: .
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           '0.0ptpt)\tex_relax:D ' in \dim_set:Nn 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           '9.48425ptpt\tex_relax:D ' in \dim_compare:nNn 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Missing = inserted for \ifdim.
+<to be read again> 
+                   p
+l. ...  }
+I was expecting to see `<', `=', or `>'. Didn't.
+! Missing number, treated as zero.
+<to be read again> 
+                   p
+l. ...  }
+A number should have been here; I inserted `0'.
+(If you can't figure out why I needed to see a number,
+look up `weird error' in the index to The TeXbook.)
+! Illegal unit of measure (pt inserted).
+<to be read again> 
+                   m
+l. ...  }
+Dimensions can be in units of em, ex, in, pt, pc,
+cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
+I'll assume that you meant to say pt, for printer's points.
+To recover gracefully from this error, it's best to
+delete the erroneous units; e.g., type `2' to delete
+two letters. (See Chapter 27 of The TeXbook.)
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           '1.0ptmu\tex_relax:D ' in \skip_eval:n 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> 1mu=1.0ptmu\tex_relax:D \scan_stop: .
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           '144.54ptches\tex_relax:D ' in \skip_add:Nn 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           '1.0mu2\tex_relax:D ' in \muskip_eval:n 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> 1mu2=1.0mu2\tex_relax:D \scan_stop: .
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           '2.0mu)\tex_relax:D ' in \muskip_add:Nn 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+============================================================



More information about the latex3-commits mailing list