Skip to content

Commit

Permalink
chk box, int, skip
Browse files Browse the repository at this point in the history
  • Loading branch information
wspr committed Jan 14, 2019
1 parent d2d51e1 commit d50fb1d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 9 deletions.
19 changes: 17 additions & 2 deletions l3kernel/l3box.dtx
Expand Up @@ -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}
Expand Down
13 changes: 11 additions & 2 deletions l3kernel/l3int.dtx
Expand Up @@ -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}
%
Expand Down
39 changes: 34 additions & 5 deletions l3kernel/l3skip.dtx
Expand Up @@ -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}
%
Expand Down Expand Up @@ -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}
%
Expand Down Expand Up @@ -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}
%
Expand Down

0 comments on commit d50fb1d

Please sign in to comment.