summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3debug.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3debug.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3debug.dtx75
1 files changed, 45 insertions, 30 deletions
diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx
index 423ffd5577..e8f577a4bb 100644
--- a/macros/latex/contrib/l3kernel/l3debug.dtx
+++ b/macros/latex/contrib/l3kernel/l3debug.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-01-04}
+% \date{Released 2024-01-22}
%
% \maketitle
%
@@ -99,13 +99,16 @@
% different.
% \end{function}
%
-% \begin{function}[EXP]{\__kernel_chk_flag_exist:n}
+% \begin{function}[EXP]{\__kernel_chk_flag_exist:NN}
% \begin{syntax}
-% \cs{__kernel_chk_flag_exist:n} \Arg{flag}
+% \cs{__kernel_chk_flag_exist:NN}
+% \meta{function} \meta{flag}
% \end{syntax}
% This function is only created if debugging is enabled. It checks
% that the \meta{flag} is defined according to the criterion for
-% \cs{flag_if_exist_p:n}, and if not raises a kernel-level error.
+% \cs{flag_if_exist_p:N}, and if not raises a kernel-level error and
+% calls the function with the argument \cs{l_tmpa_flag} to proceed
+% somehow without producing too many errors.
% \end{function}
%
% \begin{function}{\__kernel_debug_log:e}
@@ -128,7 +131,7 @@
%
% Standard file identification.
% \begin{macrocode}
-\ProvidesExplFile{l3debug.def}{2024-01-04}{}{L3 Debugging support}
+\ProvidesExplFile{l3debug.def}{2024-01-22}{}{L3 Debugging support}
% \end{macrocode}
%
% \begin{variable}{\s_@@_stop}
@@ -220,7 +223,7 @@
}
\cs_set_protected:Npn \debug_resume:
{
- \__kernel_tl_set:Ne \l_@@_suspended_tl
+ \__kernel_tl_set:Nx \l_@@_suspended_tl
{ \tl_tail:N \l_@@_suspended_tl }
\tl_if_empty:NT \l_@@_suspended_tl
{
@@ -241,7 +244,7 @@
% \__kernel_chk_cs_exist:N,
% \__kernel_chk_cs_exist:c
% }
-% \begin{macro}[EXP]{\__kernel_chk_flag_exist:n}
+% \begin{macro}[EXP]{\__kernel_chk_flag_exist:NN}
% \begin{macro}{\__kernel_chk_var_local:N, \__kernel_chk_var_global:N}
% \begin{macro}{\__kernel_chk_var_scope:NN}
% When debugging is enabled these two functions set up functions that
@@ -258,7 +261,7 @@
\cs_new_protected:Npn \__kernel_chk_var_exist:N #1 { }
\cs_new_protected:Npn \__kernel_chk_cs_exist:N #1 { }
\cs_generate_variant:Nn \__kernel_chk_cs_exist:N { c }
-\cs_new:Npn \__kernel_chk_flag_exist:n #1 { }
+\cs_new:Npn \__kernel_chk_flag_exist:NN { }
\cs_new_protected:Npn \__kernel_chk_var_local:N #1 { }
\cs_new_protected:Npn \__kernel_chk_var_global:N #1 { }
\cs_new_protected:Npn \__kernel_chk_var_scope:NN #1#2 { }
@@ -282,13 +285,14 @@
{ \token_to_str:N ##1 }
}
}
- \cs_set:Npn \__kernel_chk_flag_exist:n ##1
+ \cs_set:Npn \__kernel_chk_flag_exist:NN ##1##2
{
- \@@_suspended:T \use_none:nnn
- \flag_if_exist:nF {##1}
+ \@@_suspended:T \use_iii:nnnn
+ \flag_if_exist:NTF ##2
+ { ##1 ##2 }
{
- \msg_expandable_error:nnn
- { kernel } { bad-variable } { flag~##1~ }
+ \msg_expandable_error:nnn { kernel } { bad-variable } {##2}
+ ##1 \l_tmpa_flag
}
}
\cs_set_protected:Npn \__kernel_chk_var_scope:NN
@@ -313,7 +317,7 @@
{
\cs_set_protected:Npn \__kernel_chk_var_exist:N ##1 { }
\cs_set_protected:Npn \__kernel_chk_cs_exist:N ##1 { }
- \cs_set:Npn \__kernel_chk_flag_exist:N ##1 { }
+ \cs_set:Npn \__kernel_chk_flag_exist:NN { }
\cs_set_protected:Npn \__kernel_chk_var_local:N ##1 { }
\cs_set_protected:Npn \__kernel_chk_var_global:N ##1 { }
\cs_set_protected:Npn \__kernel_chk_var_scope:NN ##1##2 { }
@@ -510,11 +514,11 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_generate_parameter_list:NNN #1#2#3
{
- \__kernel_tl_set:Ne \l_@@_internal_tl
+ \__kernel_tl_set:Nx \l_@@_internal_tl
{ \exp_last_unbraced:Nf \use_ii:nnn \cs_split_function:N #1 }
- \__kernel_tl_set:Ne #2
+ \__kernel_tl_set:Nx #2
{ \exp_args:NV \@@_build_parm_text:n \l_@@_internal_tl }
- \__kernel_tl_set:Ne #3
+ \__kernel_tl_set:Nx #3
{ \exp_args:NV \@@_build_arg_list:n \l_@@_internal_tl }
}
\cs_new:Npn \@@_build_parm_text:n #1
@@ -790,8 +794,8 @@
%
%
% \begin{macrocode}
-\cs_gset_protected:Npn \__kernel_tl_set:Ne { \cs_set_nopar:Npe }
-\cs_gset_protected:Npn \__kernel_tl_gset:Ne { \cs_gset_nopar:Npe }
+\cs_gset_protected:Npn \__kernel_tl_set:Nx { \cs_set_nopar:Npe }
+\cs_gset_protected:Npn \__kernel_tl_gset:Nx { \cs_gset_nopar:Npe }
% \end{macrocode}
%
% Patching where the first argument to a function needs scope-checking:
@@ -842,7 +846,7 @@
\str_set_eq:NN
\str_put_left:Nn
\str_put_right:Nn
- \__kernel_tl_set:Ne
+ \__kernel_tl_set:Nx
\tl_clear:N
\tl_set_eq:NN
\tl_put_left:Nn
@@ -911,7 +915,7 @@
\str_gset_eq:NN
\str_gput_left:Nn
\str_gput_right:Nn
- \__kernel_tl_gset:Ne
+ \__kernel_tl_gset:Nx
\tl_gclear:N
\tl_gset_eq:NN
\tl_gput_left:Nn
@@ -957,16 +961,16 @@
% Flag functions.
% \begin{macrocode}
\__kernel_patch:nnn
- { \__kernel_chk_flag_exist:n {#1} }
+ { \__kernel_chk_flag_exist:NN }
{ }
{
- \flag_if_raised:nT
- \flag_if_raised:nF
- \flag_if_raised:nTF
- \flag_if_raised_p:n
- \flag_height:n
- \flag_ensure_raised:n
- \flag_clear:n
+ \flag_ensure_raised:N
+ \flag_height:N
+ \flag_if_raised:NT
+ \flag_if_raised:NF
+ \flag_if_raised:NTF
+ \flag_if_raised_p:N
+ \flag_raise:N
}
% \end{macrocode}
%
@@ -981,6 +985,17 @@
{ }
{ \cctab_new:N }
\__kernel_patch:nnn
+ { \__kernel_chk_var_scope:NN l #1 }
+ { }
+ { \flag_new:N }
+ \__kernel_patch:nnn
+ {
+ \__kernel_chk_var_scope:NN l #1
+ \__kernel_chk_flag_exist:NN
+ }
+ { }
+ { \flag_clear:N }
+ \__kernel_patch:nnn
{ \__kernel_chk_var_scope:NN g #1 }
{ }
{ \intarray_new:Nn }
@@ -1069,7 +1084,7 @@
{
\@@_trace_push:nnN { regex } { 1 } \@@_escape_use:nnnn
\group_begin:
- \__kernel_tl_set:Ne \l_@@_internal_a_tl
+ \__kernel_tl_set:Nx \l_@@_internal_a_tl
{ \@@_trace_pop:nnN { regex } { 1 } \@@_escape_use:nnnn }
\use_none:nnn
}