[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk box, int, skip (6c48657)
Will Robertson
wspr81 at gmail.com
Mon Apr 15 13:44:45 CEST 2019
Repository : https://github.com/latex3/latex3
On branch : morechk
Link : https://github.com/latex3/latex3/commit/6c48657fbf8c068dcbd535f927511f4c9c1d9154
>---------------------------------------------------------------
commit 6c48657fbf8c068dcbd535f927511f4c9c1d9154
Author: Will Robertson <wspr81 at gmail.com>
Date: Mon Jan 14 12:41:01 2019 +0800
chk box, int, skip
>---------------------------------------------------------------
6c48657fbf8c068dcbd535f927511f4c9c1d9154
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 f65f9e4..4a45989 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 79cbc1f..b68e3a9 100644
--- a/l3kernel/l3int.dtx
+++ b/l3kernel/l3int.dtx
@@ -1472,8 +1472,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 9b6c49c..0f8329a 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -1659,8 +1659,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}
%
@@ -2005,8 +2014,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}
%
@@ -2275,7 +2294,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