[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use @@ notation for debug code (0e1c77b)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sun Mar 25 22:45:10 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/0e1c77b318c169924d4c4178d736ff849b34484a
>---------------------------------------------------------------
commit 0e1c77b318c169924d4c4178d736ff849b34484a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sun Mar 25 19:57:25 2018 +0100
Use @@ notation for debug code
This makes tracking down cross-module \__ use a bit easier!
>---------------------------------------------------------------
0e1c77b318c169924d4c4178d736ff849b34484a
l3kernel/l3basics.dtx | 176 ++++++++++++++++++++++++-------------------------
1 file changed, 88 insertions(+), 88 deletions(-)
diff --git a/l3kernel/l3basics.dtx b/l3kernel/l3basics.dtx
index c2544ad..7e119b0 100644
--- a/l3kernel/l3basics.dtx
+++ b/l3kernel/l3basics.dtx
@@ -1797,7 +1797,7 @@
{
\exp_args:No \clist_map_inline:nn { \tl_to_str:n {#1} }
{
- \cs_if_exist_use:cF { __debug_##1_on: }
+ \cs_if_exist_use:cF { @@_ ##1 _on: }
{ \__kernel_msg_error:nnn { kernel } { debug } {##1} }
}
}
@@ -1805,7 +1805,7 @@
{
\exp_args:No \clist_map_inline:nn { \tl_to_str:n {#1} }
{
- \cs_if_exist_use:cF { __debug_##1_off: }
+ \cs_if_exist_use:cF { @@_ ##1 _off: }
{ \__kernel_msg_error:nnn { kernel } { debug } {##1} }
}
}
@@ -1826,32 +1826,32 @@
% \end{macro}
%
% \begin{macro}{\debug_suspend:, \debug_resume:}
-% \begin{macro}{\__debug_suspended:T}
-% \begin{macro}{\l__debug_suspended_tl}
+% \begin{macro}{\@@_suspended:T}
+% \begin{macro}{\l_@@_suspended_tl}
% Suspend and resume locally all debug-related errors and logging
% except deprecation errors. The \cs{debug_suspend:} and \cs{debug_resume:}
% pairs can be nested. We keep track of nesting in a token list
% containing a number of periods. At first begin with the
-% \enquote{non-suspended} version of \cs{__debug_suspended:T}.
+% \enquote{non-suspended} version of \cs{@@_suspended:T}.
% \begin{macrocode}
\__kernel_debug:TF
{
- \cs_set_nopar:Npn \l__debug_suspended_tl { }
+ \cs_set_nopar:Npn \l_@@_suspended_tl { }
\cs_set_protected:Npn \debug_suspend:
{
- \tl_put_right:Nn \l__debug_suspended_tl { . }
- \cs_set_eq:NN \__debug_suspended:T \use:n
+ \tl_put_right:Nn \l_@@_suspended_tl { . }
+ \cs_set_eq:NN \@@_suspended:T \use:n
}
\cs_set_protected:Npn \debug_resume:
{
- \tl_set:Nx \l__debug_suspended_tl
- { \tl_tail:N \l__debug_suspended_tl }
- \tl_if_empty:NT \l__debug_suspended_tl
+ \tl_set:Nx \l_@@_suspended_tl
+ { \tl_tail:N \l_@@_suspended_tl }
+ \tl_if_empty:NT \l_@@_suspended_tl
{
- \cs_set_eq:NN \__debug_suspended:T \use_none:n
+ \cs_set_eq:NN \@@_suspended:T \use_none:n
}
}
- \cs_set:Npn \__debug_suspended:T #1 { }
+ \cs_set:Npn \@@_suspended:T #1 { }
}
{
\cs_set_protected:Npn \debug_suspend: { }
@@ -1863,7 +1863,7 @@
% \end{macro}
%
% \begin{macro}
-% {\__debug_check-declarations_on:, \__debug_check-declarations_off:}
+% {\@@_check-declarations_on:, \@@_check-declarations_off:}
% \begin{macro}{\__kernel_chk_var_exist:N}
% \begin{macro}{\__kernel_chk_cs_exist:N, \__kernel_chk_cs_exist:c}
% \begin{macro}{\__kernel_chk_var_local:N, \__kernel_chk_var_global:N}
@@ -1881,11 +1881,11 @@
% \begin{macrocode}
\__kernel_debug:TF
{
- \exp_args:Nc \cs_set_protected:Npn { __debug_check-declarations_on: }
+ \exp_args:Nc \cs_set_protected:Npn { @@_check-declarations_on: }
{
\cs_set_protected:Npn \__kernel_chk_var_exist:N ##1
{
- \__debug_suspended:T \use_none:nnn
+ \@@_suspended:T \use_none:nnn
\cs_if_exist:NF ##1
{
\__kernel_msg_error:nnx { kernel } { non-declared-variable }
@@ -1894,7 +1894,7 @@
}
\cs_set_protected:Npn \__kernel_chk_cs_exist:N ##1
{
- \__debug_suspended:T \use_none:nnn
+ \@@_suspended:T \use_none:nnn
\cs_if_exist:NF ##1
{
\__kernel_msg_error:nnx { kernel } { command-not-defined }
@@ -1903,23 +1903,23 @@
}
\cs_set_protected:Npn \__kernel_chk_var_scope:NN
{
- \__debug_suspended:T \use_none:nnn
- \__debug_chk_var_scope_aux:NN
+ \@@_suspended:T \use_none:nnn
+ \@@_chk_var_scope_aux:NN
}
\cs_set_protected:Npn \__kernel_chk_var_local:N ##1
{
- \__debug_suspended:T \use_none:nnnnn
+ \@@_suspended:T \use_none:nnnnn
\__kernel_chk_var_exist:N ##1
- \__debug_chk_var_scope_aux:NN l ##1
+ \@@_chk_var_scope_aux:NN l ##1
}
\cs_set_protected:Npn \__kernel_chk_var_global:N ##1
{
- \__debug_suspended:T \use_none:nnnnn
+ \@@_suspended:T \use_none:nnnnn
\__kernel_chk_var_exist:N ##1
- \__debug_chk_var_scope_aux:NN g ##1
+ \@@_chk_var_scope_aux:NN g ##1
}
}
- \exp_args:Nc \cs_set_protected:Npn { __debug_check-declarations_off: }
+ \exp_args:Nc \cs_set_protected:Npn { @@_check-declarations_off: }
{
\cs_set_protected:Npn \__kernel_chk_var_exist:N ##1 { }
\cs_set_protected:Npn \__kernel_chk_cs_exist:N ##1 { }
@@ -1930,9 +1930,9 @@
\cs_set_protected:Npn \__kernel_chk_cs_exist:c
{ \exp_args:Nc \__kernel_chk_cs_exist:N }
\tex_ifodd:D \l at expl@check at declarations@bool
- \use:c { __debug_check-declarations_on: }
+ \use:c { @@_check-declarations_on: }
\else:
- \use:c { __debug_check-declarations_off: }
+ \use:c { @@_check-declarations_off: }
\fi:
}
{ }
@@ -1943,13 +1943,13 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\__debug_chk_var_scope_aux:NN}
-% \begin{macro}{\__debug_chk_var_scope_aux:Nn}
-% \begin{macro}{\__debug_chk_var_scope_aux:NNn}
+% \begin{macro}{\@@_chk_var_scope_aux:NN}
+% \begin{macro}{\@@_chk_var_scope_aux:Nn}
+% \begin{macro}{\@@_chk_var_scope_aux:NNn}
% First check whether the name of the variable |#2| starts with
% \meta{letter}|_|. If it does then pass that letter, the
% \meta{scope}, and the variable name to
-% \cs{__debug_chk_var_scope_aux:NNn}. That function compares the two
+% \cs{@@_chk_var_scope_aux:NNn}. That function compares the two
% letters and triggers an error if they differ (the \cs{scan_stop:}
% case is not reachable here). If the second character was not |_|
% then pass the same data to the same auxiliary, except for its first
@@ -1961,21 +1961,21 @@
% \begin{macrocode}
\__kernel_debug:TF
{
- \cs_set_protected:Npn \__debug_chk_var_scope_aux:NN #1#2
- { \exp_args:NNf \__debug_chk_var_scope_aux:Nn #1 { \cs_to_str:N #2 } }
- \cs_set_protected:Npn \__debug_chk_var_scope_aux:Nn #1#2
+ \cs_set_protected:Npn \@@_chk_var_scope_aux:NN #1#2
+ { \exp_args:NNf \@@_chk_var_scope_aux:Nn #1 { \cs_to_str:N #2 } }
+ \cs_set_protected:Npn \@@_chk_var_scope_aux:Nn #1#2
{
\if:w _ \use_i:nn \use_i_delimit_by_q_stop:nw #2 ? ? \q_stop
- \exp_after:wN \__debug_chk_var_scope_aux:NNn
+ \exp_after:wN \@@_chk_var_scope_aux:NNn
\use_i_delimit_by_q_stop:nw #2 ? \q_stop
#1 {#2}
\else:
- \exp_args:Nc \__debug_chk_var_scope_aux:NNn
- { __debug_chk_/ #2 }
+ \exp_args:Nc \@@_chk_var_scope_aux:NNn
+ { @@_chk_/ #2 }
#1 {#2}
\fi:
}
- \cs_set_protected:Npn \__debug_chk_var_scope_aux:NNn #1#2#3
+ \cs_set_protected:Npn \@@_chk_var_scope_aux:NNn #1#2#3
{
\if:w #1 #2
\else:
@@ -1995,9 +1995,9 @@
% \end{macro}
%
% \begin{macro}
-% {\__debug_check-expressions_on:, \__debug_check-expressions_off:}
+% {\@@_check-expressions_on:, \@@_check-expressions_off:}
% \begin{macro}{\__kernel_chk_expr:nNnN}
-% \begin{macro}{\__debug_chk_expr_aux:nNnN}
+% \begin{macro}{\@@_chk_expr_aux:nNnN}
% When debugging is enabled these two functions set
% \cs{__kernel_chk_expr:nNnN} to test or not whether the given
% expression is valid. The idea is to evaluate the expression within
@@ -2019,20 +2019,20 @@
% \begin{macrocode}
\__kernel_debug:TF
{
- \exp_args:Nc \cs_set_protected:Npn { __debug_check-expressions_on: }
+ \exp_args:Nc \cs_set_protected:Npn { @@_check-expressions_on: }
{
\cs_set:Npn \__kernel_chk_expr:nNnN ##1##2
{
- \__debug_suspended:T { ##1 \use_none:nnnnnnn }
- \exp_after:wN \__debug_chk_expr_aux:nNnN
+ \@@_suspended:T { ##1 \use_none:nnnnnnn }
+ \exp_after:wN \@@_chk_expr_aux:nNnN
\exp_after:wN { \tex_the:D ##2 ##1 \tex_relax:D }
##2
}
}
- \exp_args:Nc \cs_set_protected:Npn { __debug_check-expressions_off: }
+ \exp_args:Nc \cs_set_protected:Npn { @@_check-expressions_off: }
{ \cs_set:Npn \__kernel_chk_expr:nNnN ##1##2##3##4 {##1} }
- \use:c { __debug_check-expressions_off: }
- \cs_set:Npn \__debug_chk_expr_aux:nNnN #1#2#3#4
+ \use:c { @@_check-expressions_off: }
+ \cs_set:Npn \@@_chk_expr_aux:nNnN #1#2#3#4
{
\tl_if_empty:oF
{
@@ -2053,7 +2053,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\__debug_log-functions_on:, \__debug_log-functions_off:}
+% \begin{macro}{\@@_log-functions_on:, \@@_log-functions_off:}
% \begin{macro}{\__kernel_debug_log:x}
% These two functions (corresponding to the \pkg{expl3} option
% \texttt{log-functions}) control whether \cs{__kernel_debug_log:x} writes to the
@@ -2065,17 +2065,17 @@
% \begin{macrocode}
\__kernel_debug:TF
{
- \exp_args:Nc \cs_set_protected:Npn { __debug_log-functions_on: }
+ \exp_args:Nc \cs_set_protected:Npn { @@_log-functions_on: }
{
\cs_set_protected:Npn \__kernel_debug_log:x
- { \__debug_suspended:T \use_none:nn \iow_log:x }
+ { \@@_suspended:T \use_none:nn \iow_log:x }
}
- \exp_args:Nc \cs_set_protected:Npn { __debug_log-functions_off: }
+ \exp_args:Nc \cs_set_protected:Npn { @@_log-functions_off: }
{ \cs_set_protected:Npn \__kernel_debug_log:x { \use_none:n } }
\tex_ifodd:D \l at expl@log at functions@bool
- \use:c { __debug_log-functions_on: }
+ \use:c { @@_log-functions_on: }
\else:
- \use:c { __debug_log-functions_off: }
+ \use:c { @@_log-functions_off: }
\fi:
}
{ }
@@ -2083,9 +2083,9 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\__debug_deprecation_on:, \__debug_deprecation_off:}
+% \begin{macro}{\@@_deprecation_on:, \@@_deprecation_off:}
% \begin{macro}{\__kernel_deprecation_code:nn}
-% \begin{variable}{\g__debug_deprecation_on_tl, \g__debug_deprecation_off_tl}
+% \begin{variable}{\g_@@_deprecation_on_tl, \g_@@_deprecation_off_tl}
% Some commands were more recently deprecated and not yet removed;
% only make these into errors if the user requests it. This relies on
% two token lists, mostly filled up by calls to
@@ -2093,16 +2093,16 @@
% \begin{macrocode}
\__kernel_debug:TF
{
- \cs_set_protected:Npn \__debug_deprecation_on:
- { \g__debug_deprecation_on_tl }
- \cs_set_protected:Npn \__debug_deprecation_off:
- { \g__debug_deprecation_off_tl }
- \cs_set_nopar:Npn \g__debug_deprecation_on_tl { }
- \cs_set_nopar:Npn \g__debug_deprecation_off_tl { }
+ \cs_set_protected:Npn \@@_deprecation_on:
+ { \g_@@_deprecation_on_tl }
+ \cs_set_protected:Npn \@@_deprecation_off:
+ { \g_@@_deprecation_off_tl }
+ \cs_set_nopar:Npn \g_@@_deprecation_on_tl { }
+ \cs_set_nopar:Npn \g_@@_deprecation_off_tl { }
\cs_set_protected:Npn \__kernel_deprecation_code:nn #1#2
{
- \tl_gput_right:Nn \g__debug_deprecation_on_tl {#1}
- \tl_gput_right:Nn \g__debug_deprecation_off_tl {#2}
+ \tl_gput_right:Nn \g_@@_deprecation_on_tl {#1}
+ \tl_gput_right:Nn \g_@@_deprecation_off_tl {#2}
}
}
{
@@ -2114,11 +2114,11 @@
% \end{macro}
%
% \begin{macro}{\__kernel_patch_deprecation:nnNNpn}
-% \begin{macro}{\__debug_deprecation_aux:nnNnn}
+% \begin{macro}{\@@_deprecation_aux:nnNnn}
% Grab a definition (at present, must be \cs{cs_new_protected:Npn}).
-% Add to \cs{g__debug_deprecation_on_tl} some code that makes the
+% Add to \cs{g_@@_deprecation_on_tl} some code that makes the
% defined macro |#3| outer (and defines it as an error). Add to
-% \cs{g__debug_deprecation_off_tl} the definition itself. In both
+% \cs{g_@@_deprecation_off_tl} the definition itself. In both
% cases we undefine the token with \cs{tex_let:D} to avoid taking a
% potentially outer macro as the argument of some \pkg{expl3}
% function. Finally define the macro itself to produce a warning then
@@ -2138,16 +2138,16 @@
\__kernel_msg_error:nnx { kernel } { debug-unpatchable }
{ \token_to_str:N #3 ~(for~deprecation) }
\fi:
- \__debug_deprecation_aux:nnNnn {#1} {#2} #4 {#5}
+ \@@_deprecation_aux:nnNnn {#1} {#2} #4 {#5}
}
- \cs_set_protected:Npn \__debug_deprecation_aux:nnNnn #1#2#3#4#5
+ \cs_set_protected:Npn \@@_deprecation_aux:nnNnn #1#2#3#4#5
{
- \tl_gput_right:Nn \g__debug_deprecation_on_tl
+ \tl_gput_right:Nn \g_@@_deprecation_on_tl
{
\tex_let:D #3 \scan_stop:
\__deprecation_error:Nnn #3 {#2} {#1}
}
- \tl_gput_right:Nn \g__debug_deprecation_off_tl
+ \tl_gput_right:Nn \g_@@_deprecation_off_tl
{
\tex_let:D #3 \scan_stop:
\cs_set_protected:Npn #3 #4 {#5}
@@ -2170,7 +2170,7 @@
% \begin{macro}
% {\__kernel_patch:nnNNpn, \__kernel_patch_conditional:nNNpnn}
% \begin{macro}
-% {\__debug_patch_aux:nnnn, \__debug_patch_auxii:nnnn}
+% {\@@_patch_aux:nnnn, \@@_patch_auxii:nnnn}
% When debugging is not enabled, \cs{__kernel_patch:nnNNpn} and
% \cs{__kernel_patch_conditional:nNNpnn} throw the patch away.
% Otherwise they can be followed by \cs{cs_new:Npn} (or similar), and
@@ -2181,12 +2181,12 @@
\__kernel_debug:TF
{
\cs_set_protected:Npn \__kernel_patch:nnNNpn #1#2#3#4#5#
- { \__debug_patch_aux:nnnn {#1} {#2} { #3 #4 #5 } }
+ { \@@_patch_aux:nnnn {#1} {#2} { #3 #4 #5 } }
\cs_set_protected:Npn \__kernel_patch_conditional:nNNpnn #1#2#3#4#
- { \__debug_patch_auxii:nnnn {#1} { #2 #3 #4 } }
- \cs_set_protected:Npn \__debug_patch_aux:nnnn #1#2#3#4
+ { \@@_patch_auxii:nnnn {#1} { #2 #3 #4 } }
+ \cs_set_protected:Npn \@@_patch_aux:nnnn #1#2#3#4
{ #3 { #1 #4 #2 } }
- \cs_set_protected:Npn \__debug_patch_auxii:nnnn #1#2#3#4
+ \cs_set_protected:Npn \@@_patch_auxii:nnnn #1#2#3#4
{ #2 {#3} { #1 #4 } }
}
{
@@ -2203,10 +2203,10 @@
% {\__kernel_patch_args:nnnNNpn, \__kernel_patch_conditional_args:nnnNNpnn}
% \begin{macro}
% {
-% \__debug_tmp:w,
-% \__debug_patch_args_aux:nnnNNnn,
-% \__debug_patch_args_aux:nnnNNnnn,
-% \__debug_patch_args_aux:nnnn
+% \@@_tmp:w,
+% \@@_patch_args_aux:nnnNNnn,
+% \@@_patch_args_aux:nnnNNnnn,
+% \@@_patch_args_aux:nnnn
% }
% See \cs{__kernel_patch:nnNNpn}. The first argument is something like
% |{#1}{(#2)}|. Define a temporary macro using the \meta{parameters}
@@ -2222,22 +2222,22 @@
\__kernel_debug:TF
{
\cs_set_protected:Npn \__kernel_patch_args:nnnNNpn #1#2#3#4#5#6#
- { \__debug_patch_args_aux:nnnNNnn {#1} {#2} {#3} #4 #5 {#6} }
+ { \@@_patch_args_aux:nnnNNnn {#1} {#2} {#3} #4 #5 {#6} }
\cs_set_protected:Npn \__kernel_patch_conditional_args:nnnNNpnn #1#2#3#4#5#6#
- { \__debug_patch_args_aux:nnnNNnnn {#1} {#2} {#3} #4 #5 {#6} }
- \cs_set_protected:Npn \__debug_patch_args_aux:nnnNNnn #1#2#3#4#5#6#7
+ { \@@_patch_args_aux:nnnNNnnn {#1} {#2} {#3} #4 #5 {#6} }
+ \cs_set_protected:Npn \@@_patch_args_aux:nnnNNnn #1#2#3#4#5#6#7
{
- \cs_set:Npn \__debug_tmp:w #6 {#7}
- \exp_after:wN \__debug_patch_args_aux:nnnn \exp_after:wN
- { \__debug_tmp:w #3 } { #4 #5 #6 } {#1} {#2}
+ \cs_set:Npn \@@_tmp:w #6 {#7}
+ \exp_after:wN \@@_patch_args_aux:nnnn \exp_after:wN
+ { \@@_tmp:w #3 } { #4 #5 #6 } {#1} {#2}
}
- \cs_set_protected:Npn \__debug_patch_args_aux:nnnNNnnn #1#2#3#4#5#6#7#8
+ \cs_set_protected:Npn \@@_patch_args_aux:nnnNNnnn #1#2#3#4#5#6#7#8
{
- \cs_set:Npn \__debug_tmp:w #6 {#8}
- \exp_after:wN \__debug_patch_args_aux:nnnn \exp_after:wN
- { \__debug_tmp:w #3 } { #4 #5 #6 {#7} } {#1} {#2}
+ \cs_set:Npn \@@_tmp:w #6 {#8}
+ \exp_after:wN \@@_patch_args_aux:nnnn \exp_after:wN
+ { \@@_tmp:w #3 } { #4 #5 #6 {#7} } {#1} {#2}
}
- \cs_set_protected:Npn \__debug_patch_args_aux:nnnn #1#2#3#4
+ \cs_set_protected:Npn \@@_patch_args_aux:nnnn #1#2#3#4
{ #2 { #3 #1 #4 } }
}
{
More information about the latex3-commits
mailing list