[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: fix up use registers when expanding (c5f4957)

Will Robertson wspr81 at gmail.com
Mon Apr 15 15:34:43 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : morechk
Link       : https://github.com/latex3/latex3/commit/c5f4957f1faf09cc9bf7340ad3bd30b99b8be967

>---------------------------------------------------------------

commit c5f4957f1faf09cc9bf7340ad3bd30b99b8be967
Author: Will Robertson <wspr81 at gmail.com>
Date:   Mon Apr 15 23:04:43 2019 +0930

    fix up use registers when expanding


>---------------------------------------------------------------

c5f4957f1faf09cc9bf7340ad3bd30b99b8be967
 l3kernel/l3basics.dtx |    2 +-
 l3kernel/l3int.dtx    |   14 +++++++++-----
 l3kernel/l3skip.dtx   |   25 +++++++++++++++++++++----
 3 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/l3kernel/l3basics.dtx b/l3kernel/l3basics.dtx
index c9f22ff..acf50b3 100644
--- a/l3kernel/l3basics.dtx
+++ b/l3kernel/l3basics.dtx
@@ -2888,7 +2888,7 @@
     \cs_set:Npn \cs_use:N #1
       {
         \exp:w \__kernel_chk_exp_cs_exist:NTF #1 { \exp_after:wN \exp_end: #1 }
-                                                 { \exp_after:wN \exp_end:    }
+                                                 { \exp_end: }
       }
     \cs_set:Npn \cs_use:c #1
       {
diff --git a/l3kernel/l3int.dtx b/l3kernel/l3int.dtx
index 91fdbad..0c41112 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -1470,14 +1470,17 @@
 %
 % \begin{macro}{\int_use:N, \int_use:c}
 % \UnitTested
-%    Here is how counters are accessed:
-%    \begin{macrocode}
-\cs_new_eq:NN \int_use:N \tex_the:D
-%    \end{macrocode}
-%    We hand-code this for some speed gain:
+%    Here is how counters are accessed.
+%    We hand-code this for some speed gain.
 %    \begin{macrocode}
 \__kernel_if_debug:TF
   {
+    \cs_set:Npn \int_use:N #1
+      {
+        \tex_the:D
+        \__kernel_chk_exp_var_exist:NF #1 { \c_zero_int \use_none:n }
+        #1
+      }
     \cs_new:Npn \int_use:c #1
       {
         \tex_the:D
@@ -1486,6 +1489,7 @@
       }
   }
   {
+    \cs_new_eq:NN \int_use:N \tex_the:D
     \cs_new:Npn \int_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
   }
 %    \end{macrocode}
diff --git a/l3kernel/l3skip.dtx b/l3kernel/l3skip.dtx
index 9a2b1b2..55b7f36 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -1667,12 +1667,16 @@
 % \begin{macro}{\dim_use:N, \dim_use:c}
 %   Accessing a \meta{dim}.
 %    \begin{macrocode}
-\cs_new_eq:NN \dim_use:N \tex_the:D
 %    \end{macrocode}
-%    We hand-code this for some speed gain:
 %    \begin{macrocode}
 \__kernel_if_debug:TF
   {
+    \cs_set:Npn \dim_use:N #1
+      {
+        \tex_the:D
+        \__kernel_chk_exp_var_exist:NF #1 { \c_zero_dim \use_none:n }
+        #1
+      }
     \cs_new:Npn \dim_use:c #1
       {
         \tex_the:D
@@ -1681,6 +1685,7 @@
       }
   }
   {
+    \cs_new_eq:NN \dim_use:N \tex_the:D
     \cs_new:Npn \dim_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
   }
 %    \end{macrocode}
@@ -2026,9 +2031,14 @@
 % \begin{macro}{\skip_use:N, \skip_use:c}
 %   Accessing a \meta{skip}.
 %    \begin{macrocode}
-\cs_new_eq:NN \skip_use:N \tex_the:D
 \__kernel_if_debug:TF
   {
+    \cs_set:Npn \skip_use:N #1
+      {
+        \tex_the:D
+        \__kernel_chk_exp_var_exist:NF #1 { \c_zero_skip \use_none:n }
+        #1
+      }
     \cs_new:Npn \skip_use:c #1
       {
         \tex_the:D
@@ -2037,6 +2047,7 @@
       }
   }
   {
+    \cs_new_eq:NN \skip_use:N \tex_the:D
     \cs_new:Npn \skip_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
   }
 
@@ -2307,9 +2318,14 @@
 % \begin{macro}{\muskip_use:N, \muskip_use:c}
 %   Accessing a \meta{muskip}.
 %    \begin{macrocode}
-\cs_new_eq:NN \muskip_use:N \tex_the:D
 \__kernel_if_debug:TF
   {
+    \cs_set:Npn \muskip_use:N #1
+      {
+        \tex_the:D
+        \__kernel_chk_exp_var_exist:NF #1 { \c_zero_muskip \use_none:n }
+        #1
+      }
     \cs_new:Npn \muskip_use:c #1
       {
         \tex_the:D
@@ -2318,6 +2334,7 @@
       }
   }
   {
+    \cs_new_eq:NN \muskip_use:N \tex_the:D
     \cs_new:Npn \muskip_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
   }
 %    \end{macrocode}





More information about the latex3-commits mailing list