summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx580
1 files changed, 292 insertions, 288 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
index 89ce9c22f3d..ef4d26bfe75 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
@@ -36,7 +36,7 @@
%<*driver|package>
\RequirePackage{expl3}
\GetIdInfo$Id: l3tl-analysis.dtx 3039 2011-12-08 09:22:35Z bruno $
- {L3 Experimental Analysis of Token lists}
+ {L3 Experimental token lists analysis}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
@@ -88,14 +88,14 @@
%
% \subsection{Internal functions}
%
-% \begin{variable}{\s_tl}
+% \begin{variable}{\s__tl}
% The format used to store token lists internally uses the scan mark
-% \cs{s_tl} as a delimiter.
+% \cs{s__tl} as a delimiter.
% \end{variable}
%
-% \begin{function}{\tl_analysis_map_inline:nn}
+% \begin{function}{\__tl_analysis_map_inline:nn}
% \begin{syntax}
-% \cs{tl_analysis_map_inline:nn} \Arg{token list} \Arg{inline function}
+% \cs{__tl_analysis_map_inline:nn} \Arg{token list} \Arg{inline function}
% \end{syntax}
% Applies the \meta{inline function} to each individual \meta{token}
% in the \meta{token list}. The \meta{inline function} receives three
@@ -116,8 +116,8 @@
% \end{function}
%
% For optimizations in \pkg{l3regex} (when matching control sequences),
-% it may be useful to provide a \cs{tl_analysis_from_str_map_inline:nn}
-% function, perhaps named \cs{str_analysis_map_inline:nn}.
+% it may be useful to provide a \cs{__tl_analysis_from_str_map_inline:nn}
+% function, perhaps named \cs{__str_analysis_map_inline:nn}.
%
% \subsection{Internal format}
%
@@ -138,7 +138,7 @@
% regexes are catcode-agnostic. The internal format thus takes the form
% of a succession of items of the form
% \begin{quote}
-% \meta{tokens} \cs{s_tl} \meta{catcode} \meta{char code} \cs{s_tl}
+% \meta{tokens} \cs{s__tl} \meta{catcode} \meta{char code} \cs{s__tl}
% \end{quote}
% The \meta{tokens} \texttt{o}- \emph{and} \texttt{x}-expand to the
% original token in the token list or to the cluster of tokens
@@ -149,7 +149,7 @@
%
% Using delimited arguments lets us build the \meta{tokens}
% progressively when doing an encoding conversion in \pkg{l3str}. On the
-% other hand, the delimiter \cs{s_tl} may not appear unbraced in
+% other hand, the delimiter \cs{s__tl} may not appear unbraced in
% \meta{tokens}. This is not a problem because we are careful to wrap
% control sequences in braces (as an argument to \cs{exp_not:n}) when
% converting from a general token list to the internal format.
@@ -159,15 +159,15 @@
% it is the following.
% \begin{itemize}
% \item A control sequence |\cs| becomes |\exp_not:n { \cs }|
-% \cs{s_tl} $0$ $-1$ \cs{s_tl}.
+% \cs{s__tl} $0$ $-1$ \cs{s__tl}.
% \item A begin-group character |{| becomes \cs{exp_after:wN} |{|
-% \cs{if_false:} |}| \cs{fi:} \cs{s_tl} $1$ \meta{char code}
-% \cs{s_tl}.
+% \cs{if_false:} |}| \cs{fi:} \cs{s__tl} $1$ \meta{char code}
+% \cs{s__tl}.
% \item An end-group character |}| becomes \cs{if_false:} |{| \cs{fi:}
-% |}| \cs{s_tl} $2$ \meta{char code} \cs{s_tl}.
+% |}| \cs{s__tl} $2$ \meta{char code} \cs{s__tl}.
% \item A character with any other category code becomes
-% \cs{exp_not:n} \Arg{character} \cs{s_tl} \meta{hex catcode}
-% \meta{char code} \cs{s_tl}.
+% \cs{exp_not:n} \Arg{character} \cs{s__tl} \meta{hex catcode}
+% \meta{char code} \cs{s__tl}.
% \end{itemize}
%
% ^^A todo: ask LuaTeX list for an \ifx\undefined <active char>
@@ -184,6 +184,10 @@
% \end{macrocode}
%
% \begin{macrocode}
+%<@@=tl_analysis>
+% \end{macrocode}
+%
+% \begin{macrocode}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\RequirePackage{l3str}
@@ -191,127 +195,127 @@
%
% \subsection{Variables and helper functions}
%
-% \begin{variable}{\s_tl}
-% The scan mark \cs{s_tl} is used as a delimiter in the internal
+% \begin{variable}{\s__tl}
+% The scan mark \cs{s__tl} is used as a delimiter in the internal
% format. This is more practical than using a quark, because we would
% then need to control expansion much more carefully: compare
-% \cs{int_value:w} |`#1| \cs{s_tl} with \cs{int_value:w} |`#1|
+% \cs{__int_value:w} |`#1| \cs{s__tl} with \cs{__int_value:w} |`#1|
% \cs{exp_stop_f:} \cs{exp_not:N} \cs{q_mark} to extract a character
% code followed by the delimiter in an \texttt{x}-expansion.
% \begin{macrocode}
-\scan_new:N \s_tl
+\__scan_new:N \s__tl
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_tl_analysis_internal_tl}
+% \begin{variable}{\l_@@_internal_tl}
% This token list variable is used to hand the argument of
% \cs{tl_show_analysis:n} to \cs{tl_show_analysis:N}.
% \begin{macrocode}
-\tl_new:N \l_tl_analysis_internal_tl
+\tl_new:N \l_@@_internal_tl
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_tl_analysis_token}
-% \begin{variable}{\l_tl_analysis_char_token}
+% \begin{variable}{\l_@@_token}
+% \begin{variable}{\l_@@_char_token}
% The tokens in the token list are probed with the \TeX{} primitive
-% \tn{futurelet}. We use \cs{l_tl_analysis_token} in that
+% \tn{futurelet}. We use \cs{l_@@_token} in that
% construction. In some cases, we convert the following token to a
% string before probing it: then the token variable used is
-% \cs{l_tl_analysis_char_token}.
+% \cs{l_@@_char_token}.
% \begin{macrocode}
-\cs_new_eq:NN \l_tl_analysis_token ?
-\cs_new_eq:NN \l_tl_analysis_char_token ?
+\cs_new_eq:NN \l_@@_token ?
+\cs_new_eq:NN \l_@@_char_token ?
% \end{macrocode}
% \end{variable}
% \end{variable}
%
-% \begin{variable}{\l_tl_analysis_normal_int}
+% \begin{variable}{\l_@@_normal_int}
% The number of normal (\texttt{N}-type argument) tokens since the
% last special token.
% \begin{macrocode}
-\int_new:N \l_tl_analysis_normal_int
+\int_new:N \l_@@_normal_int
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_tl_analysis_index_int}
+% \begin{variable}{\l_@@_index_int}
% During the first pass, this is the index in the array being built.
% During the second pass, it is equal to the maximum index in the
% array from the first pass.
% \begin{macrocode}
-\int_new:N \l_tl_analysis_index_int
+\int_new:N \l_@@_index_int
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_tl_analysis_nesting_int}
+% \begin{variable}{\l_@@_nesting_int}
% Nesting depth of explicit begin-group and end-group characters
% during the first pass. This lets us detect the end of the token list
% without a reserved end-marker.
% \begin{macrocode}
-\int_new:N \l_tl_analysis_nesting_int
+\int_new:N \l_@@_nesting_int
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_tl_analysis_type_int}
+% \begin{variable}{\l_@@_type_int}
% When encountering special characters, we record their \enquote{type}
% in this integer.
% \begin{macrocode}
-\int_new:N \l_tl_analysis_type_int
+\int_new:N \l_@@_type_int
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_tl_analysis_result_tl}
+% \begin{variable}{\g_@@_result_tl}
% The result of the conversion is stored in this token list, with a
% succession of items of the form
% \begin{quote}
-% \meta{tokens} \cs{s_tl} \meta{catcode} \meta{char code} \cs{s_tl}
+% \meta{tokens} \cs{s__tl} \meta{catcode} \meta{char code} \cs{s__tl}
% \end{quote}
% \begin{macrocode}
-\tl_new:N \g_tl_analysis_result_tl
+\tl_new:N \g_@@_result_tl
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[int, EXP]{\tl_analysis_extract_charcode:}
-% \begin{macro}[aux, EXP]{\tl_analysis_extract_charcode_aux:w}
+% \begin{macro}[int, EXP]{\@@_extract_charcode:}
+% \begin{macro}[aux, EXP]{\@@_extract_charcode_aux:w}
% Extracting the character code from the meaning of
-% \cs{l_tl_analysis_token}. This has no error checking, and should
+% \cs{l_@@_token}. This has no error checking, and should
% only be assumed to work for begin-group and end-group character
% tokens. It produces a number in the form |`|\meta{char}.
% \begin{macrocode}
-\cs_new_nopar:Npn \tl_analysis_extract_charcode:
+\cs_new_nopar:Npn \@@_extract_charcode:
{
- \exp_after:wN \tl_analysis_extract_charcode_aux:w
- \token_to_meaning:N \l_tl_analysis_token
+ \exp_after:wN \@@_extract_charcode_aux:w
+ \token_to_meaning:N \l_@@_token
}
-\cs_new:Npn \tl_analysis_extract_charcode_aux:w #1 ~ #2 ~ { ` }
+\cs_new:Npn \@@_extract_charcode_aux:w #1 ~ #2 ~ { ` }
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\tl_analysis_cs_space_count:NN}
-% \begin{macro}[aux, EXP]{\tl_analysis_cs_space_count:w}
-% \begin{macro}[aux, EXP]{\tl_analysis_cs_space_count_end:w}
+% \begin{macro}[int, EXP]{\@@_cs_space_count:NN}
+% \begin{macro}[aux, EXP]{\@@_cs_space_count:w}
+% \begin{macro}[aux, EXP]{\@@_cs_space_count_end:w}
% Counts the number of spaces in the string representation of its
% second argument, as well as the number of characters following the
% last space in that representation, and feeds the two numbers as
% semicolon-delimited arguments to the first argument. When this
% function is used, the escape character is printable and non-space.
% \begin{macrocode}
-\cs_new:Npn \tl_analysis_cs_space_count:NN #1 #2
+\cs_new:Npn \@@_cs_space_count:NN #1 #2
{
\exp_after:wN #1
- \int_value:w \int_eval:w \c_zero
- \exp_after:wN \tl_analysis_cs_space_count:w
+ \__int_value:w \__int_eval:w \c_zero
+ \exp_after:wN \@@_cs_space_count:w
\token_to_str:N #2
- \fi: \tl_analysis_cs_space_count_end:w ; ~ !
+ \fi: \@@_cs_space_count_end:w ; ~ !
}
-\cs_new:Npn \tl_analysis_cs_space_count:w #1 ~
+\cs_new:Npn \@@_cs_space_count:w #1 ~
{
\if_false: #1 #1 \fi:
+ \c_one
- \tl_analysis_cs_space_count:w
+ \@@_cs_space_count:w
}
-\cs_new:Npn \tl_analysis_cs_space_count_end:w ; #1 \fi: #2 !
- { \exp_after:wN ; \int_value:w \str_length_ignore_spaces:n {#1} ; }
+\cs_new:Npn \@@_cs_space_count_end:w ; #1 \fi: #2 !
+ { \exp_after:wN ; \__int_value:w \str_count_ignore_spaces:n {#1} ; }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -321,10 +325,10 @@
%
% Our goal is to produce a token list of the form roughly
% \begin{quote}
-% \meta{token 1} \cs{s_tl} \meta{catcode 1} \meta{char code 1} \cs{s_tl} \\
-% \meta{token 2} \cs{s_tl} \meta{catcode 2} \meta{char code 2} \cs{s_tl} \\
+% \meta{token 1} \cs{s__tl} \meta{catcode 1} \meta{char code 1} \cs{s__tl} \\
+% \meta{token 2} \cs{s__tl} \meta{catcode 2} \meta{char code 2} \cs{s__tl} \\
% \ldots{}
-% \meta{token N} \cs{s_tl} \meta{catcode N} \meta{char code N} \cs{s_tl}
+% \meta{token N} \cs{s__tl} \meta{catcode N} \meta{char code N} \cs{s__tl}
% \end{quote}
% Most but not all tokens can be grabbed as an undelimited
% (\texttt{N}-type) argument by \TeX{}. The plan is to have a two pass
@@ -337,7 +341,7 @@
% result one item at a time.
%
% To ease the difficult first pass, we first do some setup with
-% \cs{tl_analysis_setup:n}. Active characters set equal to non-active
+% \cs{@@_setup:n}. Active characters set equal to non-active
% characters cause trouble, so we disable all active characters by
% setting them equal to \texttt{undefined} locally. We also set there
% the escape character to be printable (backslash, but this later
@@ -373,19 +377,19 @@
%
% The second pass is a simple exercise in expandable loops.
%
-% \begin{macro}[int]{\tl_analysis:n}
+% \begin{macro}[int]{\@@:n}
% Everything is done within a group, and all definitions will be
% local. We use \cs{group_align_safe_begin/end:} to avoid problems in
-% case \cs{tl_analysis:n} is used within an alignment and its argument
+% case \cs{@@:n} is used within an alignment and its argument
% contains alignment tab tokens.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_analysis:n #1
+\cs_new_protected:Npn \@@:n #1
{
\group_begin:
\group_align_safe_begin:
- \tl_analysis_setup:n {#1}
- \tl_analysis_i:n {#1}
- \tl_analysis_ii:n {#1}
+ \@@_setup:n {#1}
+ \@@_i:n {#1}
+ \@@_ii:n {#1}
\group_align_safe_end:
\group_end:
}
@@ -394,8 +398,8 @@
%
% \subsection{Setup}
%
-% \begin{macro}[int]{\tl_analysis_setup:n}
-% \begin{macro}[aux]{\tl_analysis_disable_loop:N}
+% \begin{macro}[int]{\@@_setup:n}
+% \begin{macro}[aux]{\@@_disable_loop:N}
% Active characters can cause problems later on in the processing,
% so the first step is to disable them, by setting them to
% \texttt{undefined}. Since Unicode contains too many characters
@@ -407,20 +411,20 @@
% and we end the loop by feeding an odd non-\texttt{N}-type
% argument to the looping macro.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_analysis_setup:n #1
+\cs_new_protected:Npn \@@_setup:n #1
{
\int_set_eq:NN \tex_escapechar:D \c_minus_one
- \exp_after:wN \tl_analysis_disable_loop:N
- \tl_to_str:n {#1} { ~ } { ? ~ \prg_map_break: }
- \prg_break_point:n { }
+ \exp_after:wN \@@_disable_loop:N
+ \tl_to_str:n {#1} { ~ } { ? ~ \__prg_break: }
+ \__prg_break_point:
}
\group_begin:
\char_set_catcode_active:N \^^@
- \cs_new_protected:Npn \tl_analysis_disable_loop:N #1
+ \cs_new_protected:Npn \@@_disable_loop:N #1
{
\tex_lccode:D \c_zero `#1 ~
\tl_to_lowercase:n { \tex_let:D ^^@ } \c_undefined:D
- \tl_analysis_disable_loop:N
+ \@@_disable_loop:N
}
\group_end:
% \end{macrocode}
@@ -463,36 +467,36 @@
% \cs{str_tail:n} \Arg{token} is non-empty, because the
% escape character is printable.
%
-% \begin{macro}[int]{\tl_analysis_i:n}
+% \begin{macro}[int]{\@@_i:n}
% We read tokens one by one using \tn{futurelet}.
% While performing the loop, we keep track of the number of
% true begin-group characters minus the number of
-% true end-group characters in \cs{l_tl_analysis_nesting_int}.
+% true end-group characters in \cs{l_@@_nesting_int}.
% This reaches $-1$ when we read the closing brace.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_analysis_i:n #1
+\cs_new_protected:Npn \@@_i:n #1
{
\int_set:Nn \tex_escapechar:D { 92 }
- \int_zero:N \l_tl_analysis_normal_int
- \int_zero:N \l_tl_analysis_index_int
- \int_zero:N \l_tl_analysis_nesting_int
- \if_false: { \fi: \tl_analysis_i_loop:w #1 }
- \int_decr:N \l_tl_analysis_index_int
+ \int_zero:N \l_@@_normal_int
+ \int_zero:N \l_@@_index_int
+ \int_zero:N \l_@@_nesting_int
+ \if_false: { \fi: \@@_i_loop:w #1 }
+ \int_decr:N \l_@@_index_int
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\tl_analysis_i_loop:w}
+% \begin{macro}[int]{\@@_i_loop:w}
% Read one character and check its type.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \tl_analysis_i_loop:w
- { \tex_futurelet:D \l_tl_analysis_token \tl_analysis_i_type:w }
+\cs_new_protected_nopar:Npn \@@_i_loop:w
+ { \tex_futurelet:D \l_@@_token \@@_i_type:w }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\tl_analysis_i_type:w}
-% At this point, \cs{l_tl_analysis_token} holds the meaning
-% of the following token. We store in \cs{l_tl_analysis_type_int}
+% \begin{macro}[int]{\@@_i_type:w}
+% At this point, \cs{l_@@_token} holds the meaning
+% of the following token. We store in \cs{l_@@_type_int}
% the meaning of the token ahead:
% \begin{itemize}
% \item 0 space token;
@@ -504,45 +508,45 @@
% character changes the nesting level ($2$ is used only here,
% and is irrelevant later). Then call the auxiliary for each case.
% Note that nesting conditionals here is safe because we only skip
-% over \cs{l_tl_analysis_token} if it matches with one of the
+% over \cs{l_@@_token} if it matches with one of the
% character tokens (hence is not a primitive conditional).
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \tl_analysis_i_type:w
+\cs_new_protected_nopar:Npn \@@_i_type:w
{
- \l_tl_analysis_type_int =
- \if_meaning:w \l_tl_analysis_token \c_space_token
+ \l_@@_type_int =
+ \if_meaning:w \l_@@_token \c_space_token
\c_zero
\else:
- \if_catcode:w \exp_not:N \l_tl_analysis_token \c_group_begin_token
+ \if_catcode:w \exp_not:N \l_@@_token \c_group_begin_token
\c_one
\else:
- \if_catcode:w \exp_not:N \l_tl_analysis_token \c_group_end_token
+ \if_catcode:w \exp_not:N \l_@@_token \c_group_end_token
\c_minus_one
\else:
\c_two
\fi:
\fi:
\fi:
- \if_case:w \l_tl_analysis_type_int
- \exp_after:wN \tl_analysis_i_space:w
- \or: \exp_after:wN \tl_analysis_i_bgroup:w
- \or: \exp_after:wN \tl_analysis_i_safe:N
- \else: \exp_after:wN \tl_analysis_i_egroup:w
+ \if_case:w \l_@@_type_int
+ \exp_after:wN \@@_i_space:w
+ \or: \exp_after:wN \@@_i_bgroup:w
+ \or: \exp_after:wN \@@_i_safe:N
+ \else: \exp_after:wN \@@_i_egroup:w
\fi:
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\tl_analysis_i_space:w}
-% \begin{macro}[aux]{\tl_analysis_i_space_test:w}
+% \begin{macro}[int]{\@@_i_space:w}
+% \begin{macro}[aux]{\@@_i_space_test:w}
% In this branch, the following token's meaning is a blank space.
% Apply \tn{string} to that token: if it is a control sequence
% the result starts with the escape character; otherwise it is
% a true blank space, whose string representation is also a blank space.
-% We test for that in \cs{tl_analysis_i_space_test:w},
-% after grabbing as \cs{l_tl_analysis_char_token} the first character
+% We test for that in \cs{@@_i_space_test:w},
+% after grabbing as \cs{l_@@_char_token} the first character
% of the string representation.
-% Also, since \cs{tl_analysis_i_store:} expects the special token to be
+% Also, since \cs{@@_i_store:} expects the special token to be
% stored in the relevant \tn{toks} register, we do that. The extra
% \cs{exp_not:n} is unnecessary of course, but it makes the treatment
% of all tokens more homogeneous.
@@ -555,30 +559,30 @@
% so that the second pass does not need to test the meaning of tokens,
% only strings.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \tl_analysis_i_space:w
+\cs_new_protected_nopar:Npn \@@_i_space:w
{
- \tex_afterassignment:D \tl_analysis_i_space_test:w
+ \tex_afterassignment:D \@@_i_space_test:w
\exp_after:wN \cs_set_eq:NN
- \exp_after:wN \l_tl_analysis_char_token
+ \exp_after:wN \l_@@_char_token
\token_to_str:N
}
-\cs_new_protected_nopar:Npn \tl_analysis_i_space_test:w
+\cs_new_protected_nopar:Npn \@@_i_space_test:w
{
- \if_meaning:w \l_tl_analysis_char_token \c_space_token
- \tex_toks:D \l_tl_analysis_index_int { \exp_not:n { ~ } }
- \tl_analysis_i_store:
+ \if_meaning:w \l_@@_char_token \c_space_token
+ \tex_toks:D \l_@@_index_int { \exp_not:n { ~ } }
+ \@@_i_store:
\else:
- \int_incr:N \l_tl_analysis_normal_int
+ \int_incr:N \l_@@_normal_int
\fi:
- \tl_analysis_i_loop:w
+ \@@_i_loop:w
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int]{\tl_analysis_i_bgroup:w, \tl_analysis_i_egroup:w}
-% \begin{macro}[aux]{\tl_analysis_i_group:nw}
-% \begin{macro}[aux]{\tl_analysis_i_group_test:w}
+% \begin{macro}[int]{\@@_i_bgroup:w, \@@_i_egroup:w}
+% \begin{macro}[aux]{\@@_i_group:nw}
+% \begin{macro}[aux]{\@@_i_group_test:w}
% The token might be either a true character token with
% catcode $1$ or $2$, or it could be a control sequence.
% The only tricky case is if the character code happens
@@ -588,50 +592,50 @@
% and of a control sequence set equal to it start differently.
% Then probe what the first character of that string
% representation is: this is the place where we need
-% \cs{l_tl_analysis_char_token} to be a separate control
-% sequence from \cs{l_tl_analysis_token}, to compare them.
+% \cs{l_@@_char_token} to be a separate control
+% sequence from \cs{l_@@_token}, to compare them.
% \begin{macrocode}
\group_begin:
\char_set_catcode_group_begin:N \^^@
\char_set_catcode_group_end:N \^^E
- \cs_new_protected_nopar:Npn \tl_analysis_i_bgroup:w
- { \tl_analysis_i_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } }
+ \cs_new_protected_nopar:Npn \@@_i_bgroup:w
+ { \@@_i_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } }
\char_set_catcode_group_begin:N \^^B
\char_set_catcode_group_end:N \^^@
- \cs_new_protected_nopar:Npn \tl_analysis_i_egroup:w
- { \tl_analysis_i_group:nw { \if_false: ^^B \fi: ^^@ } }
+ \cs_new_protected_nopar:Npn \@@_i_egroup:w
+ { \@@_i_group:nw { \if_false: ^^B \fi: ^^@ } }
\group_end:
-\cs_new_protected:Npn \tl_analysis_i_group:nw #1
+\cs_new_protected:Npn \@@_i_group:nw #1
{
- \tex_lccode:D \c_zero = \tl_analysis_extract_charcode: \scan_stop:
- \tl_to_lowercase:n { \tex_toks:D \l_tl_analysis_index_int {#1} }
- \if_num:w \tex_lccode:D \c_zero = \tex_escapechar:D
+ \tex_lccode:D \c_zero = \@@_extract_charcode: \scan_stop:
+ \tl_to_lowercase:n { \tex_toks:D \l_@@_index_int {#1} }
+ \if_int_compare:w \tex_lccode:D \c_zero = \tex_escapechar:D
\int_set:Nn \tex_escapechar:D { 139 - \tex_escapechar:D }
\fi:
- \tex_afterassignment:D \tl_analysis_i_group_test:w
+ \tex_afterassignment:D \@@_i_group_test:w
\exp_after:wN \cs_set_eq:NN
- \exp_after:wN \l_tl_analysis_char_token
+ \exp_after:wN \l_@@_char_token
\token_to_str:N
}
-\cs_new_protected_nopar:Npn \tl_analysis_i_group_test:w
+\cs_new_protected_nopar:Npn \@@_i_group_test:w
{
- \if_charcode:w \l_tl_analysis_token \l_tl_analysis_char_token
- \tl_analysis_i_store:
+ \if_charcode:w \l_@@_token \l_@@_char_token
+ \@@_i_store:
\else:
- \int_incr:N \l_tl_analysis_normal_int
+ \int_incr:N \l_@@_normal_int
\fi:
- \tl_analysis_i_loop:w
+ \@@_i_loop:w
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int]{\tl_analysis_i_store:}
+% \begin{macro}[int]{\@@_i_store:}
% This function is called each time we meet a special token;
-% at this point, the \tn{toks} register \cs{l_tl_analysis_index_int}
+% at this point, the \tn{toks} register \cs{l_@@_index_int}
% holds a token list which expands to the given special token.
-% Also, the value of \cs{l_tl_analysis_type_int} indicates which case
+% Also, the value of \cs{l_@@_type_int} indicates which case
% we are in:
% \begin{itemize}
% \item -1 end-group character;
@@ -651,31 +655,31 @@
% \item 2 space begin-group character.
% \end{itemize}
% This has the property that non-space characters correspond to odd
-% values of \cs{l_tl_analysis_type_int}.
+% values of \cs{l_@@_type_int}.
% The number of normal tokens, and the type of special token,
% are packed into a \tn{skip} register.
% Finally, we check whether we reached the last closing brace, in which
% case we stop by disabling the looping function (locally).
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \tl_analysis_i_store:
+\cs_new_protected_nopar:Npn \@@_i_store:
{
- \tex_advance:D \l_tl_analysis_nesting_int \l_tl_analysis_type_int
- \if_num:w \tex_lccode:D \c_zero = \c_thirty_two
- \tex_multiply:D \l_tl_analysis_type_int \c_two
+ \tex_advance:D \l_@@_nesting_int \l_@@_type_int
+ \if_int_compare:w \tex_lccode:D \c_zero = \c_thirty_two
+ \tex_multiply:D \l_@@_type_int \c_two
\fi:
- \tex_skip:D \l_tl_analysis_index_int
- = \l_tl_analysis_normal_int sp plus \l_tl_analysis_type_int sp \scan_stop:
- \int_incr:N \l_tl_analysis_index_int
- \int_zero:N \l_tl_analysis_normal_int
- \if_num:w \l_tl_analysis_nesting_int = \c_minus_one
- \cs_set_eq:NN \tl_analysis_i_loop:w \scan_stop:
+ \tex_skip:D \l_@@_index_int
+ = \l_@@_normal_int sp plus \l_@@_type_int sp \scan_stop:
+ \int_incr:N \l_@@_index_int
+ \int_zero:N \l_@@_normal_int
+ \if_int_compare:w \l_@@_nesting_int = \c_minus_one
+ \cs_set_eq:NN \@@_i_loop:w \scan_stop:
\fi:
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\tl_analysis_i_safe:N}
-% \begin{macro}[aux]{\tl_analysis_i_cs:ww}
+% \begin{macro}[int]{\@@_i_safe:N}
+% \begin{macro}[aux]{\@@_i_cs:ww}
% This should be the simplest case: since the upcoming token is safe,
% we can simply grab it in a second pass. However, other branches of
% the code must pass their tokens through \tn{string}, hence we do it
@@ -689,32 +693,32 @@
% if the control sequence name contains no space, count that token
% as a number of normal tokens equal to its string length. If the
% control sequence contains spaces, they should be registered as
-% special characters by increasing \cs{l_tl_analysis_index_int}
+% special characters by increasing \cs{l_@@_index_int}
% (no need to carefully count character between each space), and
% all characters after the last space should be counted in the
% following sequence of \enquote{normal} tokens.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_analysis_i_safe:N #1
+\cs_new_protected:Npn \@@_i_safe:N #1
{
\if_charcode:w
\scan_stop:
\exp_after:wN \use_none:n \token_to_str:N #1 \prg_do_nothing:
\scan_stop:
- \int_incr:N \l_tl_analysis_normal_int
+ \int_incr:N \l_@@_normal_int
\else:
- \tl_analysis_cs_space_count:NN \tl_analysis_i_cs:ww #1
+ \@@_cs_space_count:NN \@@_i_cs:ww #1
\fi:
- \tl_analysis_i_loop:w
+ \@@_i_loop:w
}
-\cs_new_protected:Npn \tl_analysis_i_cs:ww #1; #2;
+\cs_new_protected:Npn \@@_i_cs:ww #1; #2;
{
- \if_num:w #1 > \c_zero
- \tex_skip:D \l_tl_analysis_index_int
- = \int_eval:w \l_tl_analysis_normal_int + \c_one sp \scan_stop:
- \tex_advance:D \l_tl_analysis_index_int #1 \exp_stop_f:
- \l_tl_analysis_normal_int #2 \exp_stop_f:
+ \if_int_compare:w #1 > \c_zero
+ \tex_skip:D \l_@@_index_int
+ = \__int_eval:w \l_@@_normal_int + \c_one sp \scan_stop:
+ \tex_advance:D \l_@@_index_int #1 \exp_stop_f:
+ \l_@@_normal_int #2 \exp_stop_f:
\else:
- \tex_advance:D \l_tl_analysis_normal_int #2 \exp_stop_f:
+ \tex_advance:D \l_@@_normal_int #2 \exp_stop_f:
\fi:
}
% \end{macrocode}
@@ -727,60 +731,60 @@
% All the necessary information is stored in \tn{skip}
% and \tn{toks} registers.
%
-% \begin{macro}[int]{\tl_analysis_ii:n}
-% \begin{macro}[int, EXP]{\tl_analysis_ii_loop:w}
+% \begin{macro}[int]{\@@_ii:n}
+% \begin{macro}[int, EXP]{\@@_ii_loop:w}
% Start the loop with the index $0$. No need for an end-marker:
% the loop will stop by itself when the last index is read.
% We will repeatedly oscillate between reading long stretches
% of normal tokens, and reading special tokens.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_analysis_ii:n #1
+\cs_new_protected:Npn \@@_ii:n #1
{
- \tl_gset:Nx \g_tl_analysis_result_tl
+ \tl_gset:Nx \g_@@_result_tl
{
- \tl_analysis_ii_loop:w 0; #1
- \prg_break_point:n { }
+ \@@_ii_loop:w 0; #1
+ \__prg_break_point:
}
}
-\cs_new:Npn \tl_analysis_ii_loop:w #1;
+\cs_new:Npn \@@_ii_loop:w #1;
{
- \exp_after:wN \tl_analysis_ii_normals:ww
- \int_value:w \tex_skip:D #1 ; #1 ;
+ \exp_after:wN \@@_ii_normals:ww
+ \__int_value:w \tex_skip:D #1 ; #1 ;
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\tl_analysis_ii_normals:ww}
-% \begin{macro}[aux, EXP]{\tl_analysis_ii_normal:wwN}
+% \begin{macro}[int, EXP]{\@@_ii_normals:ww}
+% \begin{macro}[aux, EXP]{\@@_ii_normal:wwN}
% The first argument is the number of normal tokens which remain
% to be read, and the second argument is the index in the array
% produced in the first step.
% A character's string representation is always one character long,
% while a control sequence is always longer (we have set the escape
% character to a printable value). In both cases, we leave
-% \cs{exp_not:n} \Arg{token} \cs{s_tl} in the input stream
+% \cs{exp_not:n} \Arg{token} \cs{s__tl} in the input stream
% (after \texttt{x}-expansion). Here, \cs{exp_not:n} is used
-% rather than \cs{exp_not:N} because |#3| could be \cs{s_tl},
+% rather than \cs{exp_not:N} because |#3| could be \cs{s__tl},
% hence must be hidden behind braces in the result.
% \begin{macrocode}
-\cs_new:Npn \tl_analysis_ii_normals:ww #1;
+\cs_new:Npn \@@_ii_normals:ww #1;
{
- \if_num:w #1 = \c_zero
- \tl_analysis_ii_special:w
+ \if_int_compare:w #1 = \c_zero
+ \@@_ii_special:w
\fi:
- \tl_analysis_ii_normal:wwN #1;
+ \@@_ii_normal:wwN #1;
}
-\cs_new:Npn \tl_analysis_ii_normal:wwN #1; #2; #3
+\cs_new:Npn \@@_ii_normal:wwN #1; #2; #3
{
- \exp_not:n { \exp_not:n { #3 } } \s_tl
+ \exp_not:n { \exp_not:n { #3 } } \s__tl
\if_charcode:w
\scan_stop:
\exp_after:wN \use_none:n \token_to_str:N #3 \prg_do_nothing:
\scan_stop:
- \exp_after:wN \tl_analysis_ii_char:Nww
+ \exp_after:wN \@@_ii_char:Nww
\else:
- \exp_after:wN \tl_analysis_ii_cs:Nww
+ \exp_after:wN \@@_ii_cs:Nww
\fi:
#3 #1; #2;
}
@@ -788,10 +792,10 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\tl_analysis_ii_char:Nww}
+% \begin{macro}[int, EXP]{\@@_ii_char:Nww}
% If the normal token we grab is a character, leave
-% \meta{catcode} \meta{charcode} followed by \cs{s_tl}
-% in the input stream, and call \cs{tl_analysis_ii_normals:ww}
+% \meta{catcode} \meta{charcode} followed by \cs{s__tl}
+% in the input stream, and call \cs{@@_ii_normals:ww}
% with its first argument decremented.
% \begin{macrocode}
\group_begin:
@@ -801,7 +805,7 @@
\char_set_uccode:nn { `? } { `D }
\tl_to_uppercase:n
{
- \cs_new:Npn \tl_analysis_ii_char:Nww #1
+ \cs_new:Npn \@@_ii_char:Nww #1
{
\if_meaning:w #1 \c_undefined:D ? \else:
\if_catcode:w #1 \c_catcode_other_token C \else:
@@ -813,47 +817,47 @@
\if_catcode:w #1 \c_space_token A \else:
6
\fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi:
- \int_value:w `#1 \s_tl
- \exp_after:wN \tl_analysis_ii_normals:ww
- \int_use:N \int_eval:w \c_minus_one +
+ \__int_value:w `#1 \s__tl
+ \exp_after:wN \@@_ii_normals:ww
+ \int_use:N \__int_eval:w \c_minus_one +
}
}
\group_end:
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\tl_analysis_ii_cs:Nww}
-% \begin{macro}[aux, EXP]{\tl_analysis_ii_cs_test:ww}
+% \begin{macro}[int, EXP]{\@@_ii_cs:Nww}
+% \begin{macro}[aux, EXP]{\@@_ii_cs_test:ww}
% If the token we grab is a control sequence, leave
% |0 -1| (as category code and character code) in the input stream,
-% followed by \cs{s_tl},
-% and call \cs{tl_analysis_ii_normals:ww} with updated arguments.
+% followed by \cs{s__tl},
+% and call \cs{@@_ii_normals:ww} with updated arguments.
% \begin{macrocode}
-\cs_new:Npn \tl_analysis_ii_cs:Nww #1
+\cs_new:Npn \@@_ii_cs:Nww #1
{
- 0 -1 \s_tl
- \tl_analysis_cs_space_count:NN \tl_analysis_ii_cs_test:ww #1
+ 0 -1 \s__tl
+ \@@_cs_space_count:NN \@@_ii_cs_test:ww #1
}
-\cs_new:Npn \tl_analysis_ii_cs_test:ww #1 ; #2 ; #3 ; #4 ;
+\cs_new:Npn \@@_ii_cs_test:ww #1 ; #2 ; #3 ; #4 ;
{
- \exp_after:wN \tl_analysis_ii_normals:ww
- \int_use:N \int_eval:w
- \if_num:w #1 = \c_zero
+ \exp_after:wN \@@_ii_normals:ww
+ \int_use:N \__int_eval:w
+ \if_int_compare:w #1 = \c_zero
#3
\else:
- \tex_skip:D \int_eval:w #4 + #1 \int_eval_end:
+ \tex_skip:D \__int_eval:w #4 + #1 \__int_eval_end:
\fi:
- #2
\exp_after:wN ;
- \int_use:N \int_eval:w #4 + #1 ;
+ \int_use:N \__int_eval:w #4 + #1 ;
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int, EXP]{\tl_analysis_ii_special:w}
-% \begin{macro}[aux, EXP]{\tl_analysis_ii_special_char:wN}
-% \begin{macro}[aux, EXP]{\tl_analysis_ii_special_space:w}
+% \begin{macro}[int, EXP]{\@@_ii_special:w}
+% \begin{macro}[aux, EXP]{\@@_ii_special_char:wN}
+% \begin{macro}[aux, EXP]{\@@_ii_special_space:w}
% Here, |#1| is the current index in the array built in the first pass.
% Check now whether we reached the end (we shouldn't keep the trailing
% end-group character that marked the end of the token list in the
@@ -861,18 +865,18 @@
% Unpack the \tn{toks} register: when \texttt{x}-expanding again,
% we will get the special token.
% Then leave the category code in the input stream, followed by
-% the character code, and call \cs{tl_analysis_ii_loop:w} with the next index.
+% the character code, and call \cs{@@_ii_loop:w} with the next index.
% \begin{macrocode}
\group_begin:
\char_set_catcode_other:N A
- \cs_new:Npn \tl_analysis_ii_special:w
- \fi: \tl_analysis_ii_normal:wwN 0 ; #1 ;
+ \cs_new:Npn \@@_ii_special:w
+ \fi: \@@_ii_normal:wwN 0 ; #1 ;
{
\fi:
- \if_num:w #1 = \l_tl_analysis_index_int
- \exp_after:wN \prg_map_break:
+ \if_int_compare:w #1 = \l_@@_index_int
+ \exp_after:wN \__prg_break:
\fi:
- \tex_the:D \tex_toks:D #1 \s_tl
+ \tex_the:D \tex_toks:D #1 \s__tl
\if_case:w \etex_gluestretch:D \tex_skip:D #1 \exp_stop_f:
A
\or: 1
@@ -880,23 +884,23 @@
\else: 2
\fi:
\if_int_odd:w \etex_gluestretch:D \tex_skip:D #1 \exp_stop_f:
- \exp_after:wN \tl_analysis_ii_special_char:wN \int_use:N
+ \exp_after:wN \@@_ii_special_char:wN \int_use:N
\else:
- \exp_after:wN \tl_analysis_ii_special_space:w \int_use:N
+ \exp_after:wN \@@_ii_special_space:w \int_use:N
\fi:
- \int_eval:w \c_one + #1 \exp_after:wN ;
+ \__int_eval:w \c_one + #1 \exp_after:wN ;
\token_to_str:N
}
\group_end:
-\cs_new:Npn \tl_analysis_ii_special_char:wN #1 ; #2
+\cs_new:Npn \@@_ii_special_char:wN #1 ; #2
{
- \int_value:w `#2 \s_tl
- \tl_analysis_ii_loop:w #1 ;
+ \__int_value:w `#2 \s__tl
+ \@@_ii_loop:w #1 ;
}
-\cs_new:Npn \tl_analysis_ii_special_space:w #1 ; ~
+\cs_new:Npn \@@_ii_special_space:w #1 ; ~
{
- 32 \s_tl
- \tl_analysis_ii_loop:w #1 ;
+ 32 \s__tl
+ \@@_ii_loop:w #1 ;
}
% \end{macrocode}
% \end{macro}
@@ -905,38 +909,38 @@
%
% \subsection{Mapping through the analysis}
%
-% \begin{macro}[int]{\tl_analysis_map_inline:nn}
-% \begin{macro}[aux]{\tl_analysis_map_inline_aux:Nn}
+% \begin{macro}[int]{\@@_map_inline:nn}
+% \begin{macro}[aux]{\@@_map_inline_aux:Nn}
% First obtain the analysis of the token list into
-% \cs{g_tl_analysis_result_tl}. To allow nested mappings, increase the
-% nesting depth \cs{g_prg_map_int} (shared between all modules), then
+% \cs{g_@@_result_tl}. To allow nested mappings, increase the
+% nesting depth \cs{g__prg_map_int} (shared between all modules), then
% define the looping macro, which has a name specific to that nesting
% depth. That looping grabs the \meta{tokens}, \meta{catcode} and
% \meta{char code}; it checks for the end of the loop with
% \cs{use_none:n} |##2|, normally empty, but which becomes
-% \cs{prg_map_break:} at the end; it then performs the user's code
+% \cs{tl_map_break:} at the end; it then performs the user's code
% |#2|, and loops by calling itself. When the loop ends, remember to
% decrease the nesting depth.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_analysis_map_inline:nn #1
+\cs_new_protected:Npn \@@_map_inline:nn #1
{
- \tl_analysis:n {#1}
- \int_gincr:N \g_prg_map_int
- \exp_args:Nc \tl_analysis_map_inline_aux:Nn
- { tl_analysis_map_inline_ \int_use:N \g_prg_map_int :wNw }
+ \@@:n {#1}
+ \int_gincr:N \g__prg_map_int
+ \exp_args:Nc \@@_map_inline_aux:Nn
+ { @@_map_inline_ \int_use:N \g__prg_map_int :wNw }
}
-\cs_new_protected:Npn \tl_analysis_map_inline_aux:Nn #1#2
+\cs_new_protected:Npn \@@_map_inline_aux:Nn #1#2
{
- \cs_gset_protected:Npn #1 ##1 \s_tl ##2 ##3 \s_tl
+ \cs_gset_protected:Npn #1 ##1 \s__tl ##2 ##3 \s__tl
{
\use_none:n ##2
#2
#1
}
\exp_after:wN #1
- \g_tl_analysis_result_tl
- \s_tl { ? \prg_map_break: } \s_tl
- \prg_break_point:n { \int_gdecr:N \g_prg_map_int }
+ \g_@@_result_tl
+ \s__tl { ? \tl_map_break: } \s__tl
+ \__prg_break_point:Nn \tl_map_break: { \int_gdecr:N \g__prg_map_int }
}
% \end{macrocode}
% \end{macro}
@@ -946,29 +950,29 @@
%
% \begin{macro}{\tl_show_analysis:N}
% \begin{macro}{\tl_show_analysis:n}
-% Add to \cs{tl_analysis:n} a third pass to display tokens to the terminal.
+% Add to \cs{@@:n} a third pass to display tokens to the terminal.
% \begin{macrocode}
\cs_new_protected:Npn \tl_show_analysis:N #1
{
- \exp_args:No \tl_analysis:n {#1}
- \msg_aux_show:Nnx #1
+ \exp_args:No \@@:n {#1}
+ \__msg_show_variable:Nnn #1
{ tl-analysis }
{
- \exp_after:wN \tl_show_analysis_loop:wNw \g_tl_analysis_result_tl
- \s_tl { ? \prg_map_break: } \s_tl
- \prg_break_point:n { }
+ \exp_after:wN \@@_show_loop:wNw \g_@@_result_tl
+ \s__tl { ? \__prg_break: } \s__tl
+ \__prg_break_point:
}
}
\cs_new_protected:Npn \tl_show_analysis:n #1
{
- \tl_set:Nn \l_tl_analysis_internal_tl {#1}
- \tl_show_analysis:N \l_tl_analysis_internal_tl
+ \tl_set:Nn \l_@@_internal_tl {#1}
+ \tl_show_analysis:N \l_@@_internal_tl
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[aux, rEXP]{\tl_show_analysis_loop:wNw}
+% \begin{macro}[aux, rEXP]{\@@_show_loop:wNw}
% Here, |#1| \texttt{o}- and \texttt{x}-expands to the token;
% |#2| is the category code (one uppercase hexadecimal digit),
% $0$ for control sequences;
@@ -977,34 +981,34 @@
% the meaning may overflow one line, and we want to truncate
% it. Those cases are thus separated out.
% \begin{macrocode}
-\cs_new:Npn \tl_show_analysis_loop:wNw #1 \s_tl #2 #3 \s_tl
+\cs_new:Npn \@@_show_loop:wNw #1 \s__tl #2 #3 \s__tl
{
\use_none:n #2
\iow_newline: > \c_space_tl \c_space_tl
- \if_num:w "#2 = \c_zero
- \exp_after:wN \tl_show_analysis_cs:n
+ \if_int_compare:w "#2 = \c_zero
+ \exp_after:wN \@@_show_cs:n
\else:
- \if_num:w "#2 = \c_thirteen
+ \if_int_compare:w "#2 = \c_thirteen
\exp_after:wN \exp_after:wN
- \exp_after:wN \tl_show_analysis_active:n
+ \exp_after:wN \@@_show_active:n
\else:
\exp_after:wN \exp_after:wN
- \exp_after:wN \tl_show_analysis_normal:n
+ \exp_after:wN \@@_show_normal:n
\fi:
\fi:
{#1}
- \tl_show_analysis_loop:wNw
+ \@@_show_loop:wNw
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[aux, rEXP]{\tl_show_analysis_normal:n}
+% \begin{macro}[aux, rEXP]{\@@_show_normal:n}
% Non-active characters are a simple matter of printing
% the character, and its meaning. Our test suite checks that
% begin-group and end-group characters do not mess up
% \TeX{}'s alignment status.
% \begin{macrocode}
-\cs_new:Npn \tl_show_analysis_normal:n #1
+\cs_new:Npn \@@_show_normal:n #1
{
\exp_after:wN \token_to_str:N #1 ~
( \exp_after:wN \token_to_meaning:N #1 )
@@ -1012,63 +1016,63 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[EXP]{\tl_show_analysis_value:N}
+% \begin{macro}[EXP]{\@@_show_value:N}
% This expands to the value of |#1| if it has any.
% \begin{macrocode}
-\cs_new:Npn \tl_show_analysis_value:N #1
+\cs_new:Npn \@@_show_value:N #1
{
\token_if_expandable:NF #1
{
- \token_if_chardef:NTF #1 \prg_map_break: { }
- \token_if_mathchardef:NTF #1 \prg_map_break: { }
- \token_if_dim_register:NTF #1 \prg_map_break: { }
- \token_if_int_register:NTF #1 \prg_map_break: { }
- \token_if_skip_register:NTF #1 \prg_map_break: { }
- \token_if_toks_register:NTF #1 \prg_map_break: { }
- \use_none:nnnn
- \prg_break_point:n { }
+ \token_if_chardef:NTF #1 \__prg_break: { }
+ \token_if_mathchardef:NTF #1 \__prg_break: { }
+ \token_if_dim_register:NTF #1 \__prg_break: { }
+ \token_if_int_register:NTF #1 \__prg_break: { }
+ \token_if_skip_register:NTF #1 \__prg_break: { }
+ \token_if_toks_register:NTF #1 \__prg_break: { }
+ \use_none:nnn
+ \__prg_break_point:
\use:n { = \tex_the:D #1 }
}
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[aux, rEXP]{\tl_show_analysis_cs:n}
-% \begin{macro}[aux, rEXP]{\tl_show_analysis_active:n}
-% \begin{macro}[aux, rEXP]{\tl_show_analysis_long:nn}
-% \begin{macro}[aux, rEXP]{\tl_show_analysis_long_aux:nnnn}
+% \begin{macro}[aux, rEXP]{\@@_show_cs:n}
+% \begin{macro}[aux, rEXP]{\@@_show_active:n}
+% \begin{macro}[aux, rEXP]{\@@_show_long:nn}
+% \begin{macro}[aux, rEXP]{\@@_show_long_aux:nnnn}
% Control sequences and active characters are printed in the same way,
-% making sure not to go beyond the \cs{l_iow_line_length_int}. In case
+% making sure not to go beyond the \cs{l_iow_line_count_int}. In case
% of an overflow, we replace the last characters by
-% \cs{c_tl_show_analysis_etc_str}.
+% \cs{c_@@_show_etc_str}.
% \begin{macrocode}
-\cs_new:Npn \tl_show_analysis_cs:n #1
- { \exp_args:No \tl_show_analysis_long:nn {#1} { control~sequence= } }
-\cs_new:Npn \tl_show_analysis_active:n #1
- { \exp_args:No \tl_show_analysis_long:nn {#1} { active~character= } }
-\cs_new:Npn \tl_show_analysis_long:nn #1
+\cs_new:Npn \@@_show_cs:n #1
+ { \exp_args:No \@@_show_long:nn {#1} { control~sequence= } }
+\cs_new:Npn \@@_show_active:n #1
+ { \exp_args:No \@@_show_long:nn {#1} { active~character= } }
+\cs_new:Npn \@@_show_long:nn #1
{
- \tl_show_analysis_long_aux:oofn
+ \@@_show_long_aux:oofn
{ \token_to_str:N #1 }
{ \token_to_meaning:N #1 }
- { \tl_show_analysis_value:N #1 }
+ { \@@_show_value:N #1 }
}
-\cs_new:Npn \tl_show_analysis_long_aux:nnnn #1#2#3#4
+\cs_new:Npn \@@_show_long_aux:nnnn #1#2#3#4
{
\int_compare:nNnTF
- { \str_length:n { #1 ~ ( #4 #2 #3 ) } }
- > { \l_iow_line_length_int - \c_three }
+ { \str_count:n { #1 ~ ( #4 #2 #3 ) } }
+ > { \l_iow_line_count_int - \c_three }
{
- \str_substr:nnn { #1 ~ ( #4 #2 #3 ) } \c_zero
+ \str_substr:nnn { #1 ~ ( #4 #2 #3 ) } \c_one
{
- \l_iow_line_length_int - \c_three
- - \str_length:N \c_tl_show_analysis_etc_str
+ \l_iow_line_count_int - \c_three
+ - \str_count:N \c_@@_show_etc_str
}
- \c_tl_show_analysis_etc_str
+ \c_@@_show_etc_str
}
{ #1 ~ ( #4 #2 #3 ) }
}
-\cs_generate_variant:Nn \tl_show_analysis_long_aux:nnnn { oof }
+\cs_generate_variant:Nn \@@_show_long_aux:nnnn { oof }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1077,21 +1081,21 @@
%
% \subsection{Messages}
%
-% \begin{variable}{\c_tl_show_analysis_etc_str}
+% \begin{variable}{\c_@@_show_etc_str}
% When a control sequence (or active character)
% and its meaning are too long to fit in one line
% of the terminal, the end is replaced by this token list.
% \begin{macrocode}
-\tl_const:Nx \c_tl_show_analysis_etc_str % (
+\tl_const:Nx \c_@@_show_etc_str % (
{ \token_to_str:N \ETC.) }
% \end{macrocode}
% \end{variable}
%
% \begin{macrocode}
-\msg_kernel_new:nnn { tl-analysis } { show }
+\__msg_kernel_new:nnn { kernel } { show-tl-analysis }
{
The~token~list~
- \str_if_eq:nnF {#1} { \l_tl_analysis_internal_tl }
+ \str_if_eq:nnF {#1} { \l_@@_internal_tl }
{ \token_to_str:N #1 ~ }
\tl_if_empty:NTF #1
{ is~empty }