[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk box, int, skip (8f84488)

Will Robertson wspr81 at gmail.com
Wed Jan 16 05:37:39 CET 2019


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

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

commit 8f844885772b4bf8a2953d742bec94752abd0fc2
Author: Will Robertson <wspr81 at gmail.com>
Date:   Mon Jan 14 12:41:01 2019 +0800

    chk box, int, skip


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

8f844885772b4bf8a2953d742bec94752abd0fc2
 l3kernel/l3box.dtx  |   19 +++++++++++++++++--
 l3kernel/l3int.dtx  |   13 +++++++++++--
 l3kernel/l3skip.dtx |   39 ++++++++++++++++++++++++++++++++++-----
 3 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/l3kernel/l3box.dtx b/l3kernel/l3box.dtx
index 7118b9e..90ce6e9 100644
--- a/l3kernel/l3box.dtx
+++ b/l3kernel/l3box.dtx
@@ -1026,8 +1026,23 @@
 %   Using a \meta{box}. These are just \TeX{} primitives with meaningful
 %   names.
 %    \begin{macrocode}
-\cs_new_eq:NN \box_use_drop:N \tex_box:D
-\cs_new_eq:NN \box_use:N \tex_copy:D
+\__kernel_if_debug:TF
+  {
+    \cs_new_protected:Npn \box_use_drop:N #1
+      {
+        \__kernel_chk_var_exist:N #1
+        \tex_box:D #1
+      }
+    \cs_new_protected:Npn \box_use:N #1
+      {
+        \__kernel_chk_var_exist:N #1
+        \tex_copy:D #1
+      }
+  }
+  {
+    \cs_new_eq:NN \box_use_drop:N \tex_box:D
+    \cs_new_eq:NN \box_use:N \tex_copy:D
+  }
 \cs_generate_variant:Nn \box_use_drop:N { c }
 \cs_generate_variant:Nn \box_use:N { c }
 %    \end{macrocode}
diff --git a/l3kernel/l3int.dtx b/l3kernel/l3int.dtx
index 14458e6..6e5a05d 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -1435,8 +1435,17 @@
 %    \end{macrocode}
 %    We hand-code this for some speed gain:
 %    \begin{macrocode}
-%\cs_generate_variant:Nn \int_use:N { c }
-\cs_new:Npn \int_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
+\__kernel_if_debug:TF
+  {
+    \cs_new:Npn \int_use:c #1
+      {
+        \__kernel_chk_var_exist:c {#1}
+        \tex_the:D \cs:w #1 \cs_end:
+      }
+  }
+  {
+    \cs_new:Npn \int_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/l3skip.dtx b/l3kernel/l3skip.dtx
index bc0290d..4f6fc7e 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -1655,8 +1655,17 @@
 %    \end{macrocode}
 %    We hand-code this for some speed gain:
 %    \begin{macrocode}
-%\cs_generate_variant:Nn \dim_use:N { c }
-\cs_new:Npn \dim_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
+\__kernel_if_debug:TF
+  {
+    \cs_new:Npn \dim_use:c #1
+      {
+        \__kernel_chk_var_exist:c {#1}
+        \tex_the:D \cs:w #1 \cs_end:
+      }
+  }
+  {
+    \cs_new:Npn \dim_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2001,8 +2010,18 @@
 %   Accessing a \meta{skip}.
 %    \begin{macrocode}
 \cs_new_eq:NN \skip_use:N \tex_the:D
-%\cs_generate_variant:Nn \skip_use:N { c }
-\cs_new:Npn \skip_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
+\__kernel_if_debug:TF
+  {
+    \cs_new:Npn \skip_use:c #1
+      {
+        \__kernel_chk_var_exist:c {#1}
+        \tex_the:D \cs:w #1 \cs_end:
+      }
+  }
+  {
+    \cs_new:Npn \skip_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
+  }
+
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2271,7 +2290,17 @@
 %   Accessing a \meta{muskip}.
 %    \begin{macrocode}
 \cs_new_eq:NN \muskip_use:N \tex_the:D
-\cs_generate_variant:Nn \muskip_use:N { c }
+\__kernel_if_debug:TF
+  {
+    \cs_new:Npn \muskip_use:c #1
+      {
+        \__kernel_chk_var_exist:c {#1}
+        \tex_the:D \cs:w #1 \cs_end:
+      }
+  }
+  {
+    \cs_new:Npn \muskip_use:c #1 { \tex_the:D \cs:w #1 \cs_end: }
+  }
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list