[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk box, int, skip (d50fb1d)
Will Robertson
wspr81 at gmail.com
Mon Jan 14 08:16:54 CET 2019
Repository : https://github.com/latex3/latex3
On branch : morechk
Link : https://github.com/latex3/latex3/commit/d50fb1d1ed70dc9aacc196f3efaeb9bf2be5b997
>---------------------------------------------------------------
commit d50fb1d1ed70dc9aacc196f3efaeb9bf2be5b997
Author: Will Robertson <wspr81 at gmail.com>
Date: Mon Jan 14 12:41:01 2019 +0800
chk box, int, skip
>---------------------------------------------------------------
d50fb1d1ed70dc9aacc196f3efaeb9bf2be5b997
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 281c910..2af7deb 100644
--- a/l3kernel/l3box.dtx
+++ b/l3kernel/l3box.dtx
@@ -1024,8 +1024,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 cf43163..7ff9f01 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -1433,8 +1433,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 ba43b34..37b8020 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -1653,8 +1653,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}
%
@@ -1999,8 +2008,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}
%
@@ -2269,7 +2288,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