[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk box, int, skip (2aeda5d)
Will Robertson
wspr81 at gmail.com
Mon Feb 4 11:23:19 CET 2019
Repository : https://github.com/latex3/latex3
On branch : morechk
Link : https://github.com/latex3/latex3/commit/2aeda5dfcacf05d838eb91c2dd58ef8bdba79dc8
>---------------------------------------------------------------
commit 2aeda5dfcacf05d838eb91c2dd58ef8bdba79dc8
Author: Will Robertson <wspr81 at gmail.com>
Date: Mon Jan 14 12:41:01 2019 +0800
chk box, int, skip
>---------------------------------------------------------------
2aeda5dfcacf05d838eb91c2dd58ef8bdba79dc8
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 747d32f..6f3b790 100644
--- a/l3kernel/l3box.dtx
+++ b/l3kernel/l3box.dtx
@@ -1085,8 +1085,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 7814b27..ac127fc 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 31a92b5..319c9b0 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