diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index 05f32c25fe5..3580c370f19 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-05-11} +% \date{Released 2021-05-25} % % \maketitle % @@ -75,11 +75,16 @@ % In addition, there is a debugging function \cs{tl_analysis_show:n}, % very similar to the \cs[no-index]{ShowTokens} macro from the \pkg{ted} package. % -% \begin{function}[added = 2018-04-09]{\tl_analysis_show:N, \tl_analysis_show:n} +% \begin{function}[added = 2021-05-11] +% { +% \tl_analysis_show:N, \tl_analysis_show:n, +% \tl_analysis_log:N, \tl_analysis_log:n +% } % \begin{syntax} % \cs{tl_analysis_show:n} \Arg{token list} +% \cs{tl_analysis_log:n} \Arg{token list} % \end{syntax} -% Displays to the terminal the detailed decomposition of the +% Displays to the terminal (or log) the detailed decomposition of the % \meta{token list} into tokens, showing the category code of each % character token, the meaning of control sequences and active % characters, and the value of registers. @@ -687,7 +692,7 @@ plus \l_@@_analysis_type_int sp \scan_stop: \int_incr:N \l_@@_analysis_index_int \int_zero:N \l_@@_analysis_normal_int - \if_int_compare:w \l_@@_analysis_nesting_int = -1 \exp_stop_f: + \if_int_compare:w \l_@@_analysis_nesting_int = - \c_one_int \cs_set_eq:NN \@@_analysis_a_loop:w \scan_stop: \fi: } @@ -733,7 +738,7 @@ } \cs_new_protected:Npn \@@_analysis_a_cs:ww #1; #2; { - \if_int_compare:w #1 > 0 \exp_stop_f: + \if_int_compare:w #1 > \c_zero_int \tex_skip:D \l_@@_analysis_index_int = \int_eval:n { \l_@@_analysis_normal_int + 1 } sp \exp_stop_f: \tex_advance:D \l_@@_analysis_index_int #1 \exp_stop_f: @@ -792,7 +797,7 @@ % \begin{macrocode} \cs_new:Npn \@@_analysis_b_normals:ww #1; { - \if_int_compare:w #1 = 0 \exp_stop_f: + \if_int_compare:w #1 = \c_zero_int \@@_analysis_b_special:w \fi: \@@_analysis_b_normal:wwN #1; @@ -863,7 +868,7 @@ { \exp_after:wN \@@_analysis_b_normals:ww \int_value:w \int_eval:w - \if_int_compare:w #1 = 0 \exp_stop_f: + \if_int_compare:w #1 = \c_zero_int #3 \else: \tex_skip:D \int_eval:n { #4 + #1 } \exp_stop_f: @@ -978,26 +983,39 @@ % % \subsection{Showing the results} % -% \begin{macro}{\tl_analysis_show:N, \tl_analysis_show:n} +% \begin{macro}{\tl_analysis_show:N, \tl_analysis_log:N, \@@_analysis_show:NNN} % Add to \cs{@@_analysis:n} a third pass to display tokens to the terminal. % If the token list variable is not defined, throw the same error % as \cs{tl_show:N} by simply calling that function. % \begin{macrocode} -\cs_new_protected:Npn \tl_analysis_show:N #1 +\cs_new_protected:Npn \tl_analysis_show:N + { \@@_analysis_show:NNN \__kernel_msg_show:nnxxxx \tl_show:N } +\cs_new_protected:Npn \tl_analysis_log:N + { \@@_analysis_show:NNN \__kernel_msg_log:nnxxxx \tl_log:N } +\cs_new_protected:Npn \@@_analysis_show:NNN #1#2#3 { - \tl_if_exist:NTF #1 + \tl_if_exist:NTF #3 { - \exp_args:No \@@_analysis:n {#1} - \__kernel_msg_show:nnxxxx { tl } { show-analysis } - { \token_to_str:N #1 } { \@@_analysis_show: } { } { } + \exp_args:No \@@_analysis:n {#3} + #1 { tl } { show-analysis } + { \token_to_str:N #3 } { \@@_analysis_show: } { } { } } - { \tl_show:N #1 } + { #2 #3 } } -\cs_new_protected:Npn \tl_analysis_show:n #1 +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tl_analysis_show:n, \tl_analysis_log:n, \@@_analysis_show:Nn} +% No existence test needed here. +% \begin{macrocode} +\cs_new_protected:Npn \tl_analysis_show:n + { \@@_analysis_show:Nn \__kernel_msg_show:nnxxxx } +\cs_new_protected:Npn \tl_analysis_log:n + { \@@_analysis_show:Nn \__kernel_msg_log:nnxxxx } +\cs_new_protected:Npn \@@_analysis_show:Nn #1#2 { - \@@_analysis:n {#1} - \__kernel_msg_show:nnxxxx { tl } { show-analysis } - { } { \@@_analysis_show: } { } { } + \@@_analysis:n {#2} + #1 { tl } { show-analysis } { } { \@@_analysis_show: } { } { } } % \end{macrocode} % \end{macro} @@ -1021,7 +1039,7 @@ { \use_none:n #2 \iow_newline: > \use:nn { ~ } { ~ } - \if_int_compare:w "#2 = 0 \exp_stop_f: + \if_int_compare:w "#2 = \c_zero_int \exp_after:wN \@@_analysis_show_cs:n \else: \if_int_compare:w "#2 = 13 \exp_stop_f: @@ -1206,10 +1224,10 @@ \cs_new_protected:Npn \@@_peek_analysis_test: { \if_int_odd:w - \if_catcode:w \exp_not:N \l_peek_token { 0 \exp_stop_f: \fi: - \if_catcode:w \exp_not:N \l_peek_token } 0 \exp_stop_f: \fi: - \if_meaning:w \l_peek_token \c_space_token 0 \exp_stop_f: \fi: - 1 \exp_stop_f: + \if_catcode:w \exp_not:N \l_peek_token { \c_zero_int \fi: + \if_catcode:w \exp_not:N \l_peek_token } \c_zero_int \fi: + \if_meaning:w \l_peek_token \c_space_token \c_zero_int \fi: + \c_one_int \exp_after:wN \exp_after:wN \exp_after:wN \@@_peek_analysis_normal:N \exp_after:wN \exp_not:N |