summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3tl.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl.dtx92
1 files changed, 33 insertions, 59 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index 829f45c6201..d22763484f9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
@@ -37,7 +37,7 @@
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3tl.dtx 6465 2016-03-26 16:15:09Z joseph $
+\GetIdInfo$Id: l3tl.dtx 6692 2016-08-19 22:29:47Z bruno $
{L3 Token lists}
%</driver|package>
%<*driver>
@@ -105,30 +105,6 @@
% Functions which act on items are often faster than their analogue acting
% directly on tokens.
%
-% ^^A todo: perhaps move to another module, l3token or l3basics?
-% \begin{texnote}
-% When \TeX{} fetches an undelimited argument from the input stream,
-% explicit character tokens with character code $32$ (space) and
-% category code $10$ (space), which we here call \enquote{explicit
-% space characters}, are ignored. If the following token is an
-% explicit character token with category code $1$ (begin-group) and an
-% arbitrary character code, then \TeX{} scans ahead to obtain an equal
-% number of explicit character tokens with category code $1$
-% (begin-group) and $2$ (end-group), and the resulting list of tokens
-% (with outer braces removed) becomes the argument. Otherwise, a
-% single token is taken as the argument for the macro: we call such
-% single tokens \enquote{N-type}, as they are suitable to be used as
-% an argument for a function with the signature~\texttt{:N}.
-%
-% When \TeX{} reads a character of category code $10$ for the first
-% time, it is converted to an explicit space character, with character
-% code $32$, regardless of the initial character code.
-% \enquote{Funny} spaces with a different category code, can be
-% produced using \tn{tex_lowercase:D} or \tn{tex_uppercase:D}.
-% Explicit space characters are also produced as a result of
-% \cs{token_to_str:N}, \cs{tl_to_str:n}, etc.
-% \end{texnote}
-%
% \section{Creating and initialising token list variables}
%
% \begin{function}{\tl_new:N, \tl_new:c}
@@ -163,7 +139,7 @@
% \cs{tl_clear_new:N} \meta{tl~var}
% \end{syntax}
% Ensures that the \meta{tl~var} exists globally by applying
-% \cs{tl_new:N} if necessary, then applies \cs{tl_(g)clear:N} to leave
+% \cs{tl_new:N} if necessary, then applies \cs[index=tl_clear:N]{tl_(g)clear:N} to leave
% the \meta{tl~var} empty.
% \end{function}
%
@@ -504,7 +480,7 @@
% token count $1$ according to \cs{tl_count:n}.
% \end{function}
%
-% \begin{function}[added = 2013-07-24, EXP, TF]{\tl_case:Nn, \tl_case:cn}
+% \begin{function}[added = 2013-07-24, EXP, noTF]{\tl_case:Nn, \tl_case:cn}
% \begin{syntax}
% \cs{tl_case:NnTF} \meta{test token list variable} \\
% ~~"{" \\
@@ -601,7 +577,7 @@
% \begin{syntax}
% \cs{tl_map_break:}
% \end{syntax}
-% Used to terminate a \cs{tl_map_\ldots} function before all
+% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all
% entries in the \meta{token list variable} have been processed. This
% will normally take place within a conditional statement, for example
% \begin{verbatim}
@@ -612,7 +588,7 @@
% }
% \end{verbatim}
% See also \cs{tl_map_break:n}.
-% Use outside of a \cs{tl_map_\ldots} scenario will lead to low
+% Use outside of a \cs[no-index]{tl_map_\ldots} scenario will lead to low
% level \TeX{} errors.
% \begin{texnote}
% When the mapping is broken, additional tokens may be inserted by the
@@ -626,7 +602,7 @@
% \begin{syntax}
% \cs{tl_map_break:n} \Arg{tokens}
% \end{syntax}
-% Used to terminate a \cs{tl_map_\ldots} function before all
+% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all
% entries in the \meta{token list variable} have been processed, inserting
% the \meta{tokens} after the mapping has ended. This will
% normally take place within a conditional statement, for example
@@ -638,7 +614,7 @@
% % Do something useful
% }
% \end{verbatim}
-% Use outside of a \cs{tl_map_\ldots} scenario will lead to low
+% Use outside of a \cs[no-index]{tl_map_\ldots} scenario will lead to low
% level \TeX{} errors.
% \begin{texnote}
% When the mapping is broken, additional tokens may be inserted by the
@@ -1334,7 +1310,7 @@
% check definitions exist. This part of the process is done now, so that
% variable types based on |tl| (for example |clist|, |seq| and |prop|) will
% inherit the appropriate definitions.
-% No \cs{tl_map_\ldots} yet as the mechanisms are not fully in place. Thus
+% No \cs[no-index]{tl_map_\ldots} yet as the mechanisms are not fully in place. Thus
% instead do a more low level set up for a mapping, as in \pkg{l3basics}.
% \begin{macrocode}
%<*package>
@@ -1462,11 +1438,11 @@
% The difference between single-line and multiple-line files
% complicates the story, as explained below.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \tl_set_rescan:Nnn
+\cs_new_protected:Npn \tl_set_rescan:Nnn
{ \@@_set_rescan:NNnn \tl_set:Nn }
-\cs_new_protected_nopar:Npn \tl_gset_rescan:Nnn
+\cs_new_protected:Npn \tl_gset_rescan:Nnn
{ \@@_set_rescan:NNnn \tl_gset:Nn }
-\cs_new_protected_nopar:Npn \tl_rescan:nn
+\cs_new_protected:Npn \tl_rescan:nn
{ \@@_set_rescan:NNnn \prg_do_nothing: \use:n }
\cs_new_protected:Npn \@@_set_rescan:NNnn #1#2#3#4
{
@@ -1654,13 +1630,13 @@
% describing the auxiliary functions below, we denote the contents of
% the \meta{tl~var} by \meta{token list}.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \tl_replace_once:Nnn
+\cs_new_protected:Npn \tl_replace_once:Nnn
{ \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_set:Nx }
-\cs_new_protected_nopar:Npn \tl_greplace_once:Nnn
+\cs_new_protected:Npn \tl_greplace_once:Nnn
{ \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_gset:Nx }
-\cs_new_protected_nopar:Npn \tl_replace_all:Nnn
+\cs_new_protected:Npn \tl_replace_all:Nnn
{ \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_set:Nx }
-\cs_new_protected_nopar:Npn \tl_greplace_all:Nnn
+\cs_new_protected:Npn \tl_greplace_all:Nnn
{ \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_gset:Nx }
\cs_generate_variant:Nn \tl_replace_once:Nnn { c }
\cs_generate_variant:Nn \tl_greplace_once:Nnn { c }
@@ -1873,6 +1849,7 @@
\cs_generate_variant:Nn \tl_gremove_all:Nn { c }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \subsection{Token list conditionals}
%
@@ -1898,7 +1875,6 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}[pTF]{\tl_if_empty:N, \tl_if_empty:c}
% These functions check whether the token list in the argument is
@@ -1949,13 +1925,13 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[pTF]{\tl_if_empty:o}
+% \begin{macro}[pTF,documented-as=\tl_if_empty:nTF]{\tl_if_empty:o}
% \begin{macro}[EXP,aux]{\@@_if_empty_return:o}
% The auxiliary function \cs{@@_if_empty_return:o} is for use
% in various token list conditionals which reduce to testing
% if a given token list is empty after applying a simple function
% to it.
-% The test for emptiness is based on \cs{tl_if_empty:n(TF)}, but
+% The test for emptiness is based on \cs{tl_if_empty:nTF}, but
% the expansion is hard-coded for efficiency, as this auxiliary
% function is used in many places.
% Note that this works because \cs{etex_detokenize:D} expands tokens
@@ -2019,12 +1995,12 @@
% \end{macro}
%
% \begin{macro}[TF]{\tl_if_in:Nn, \tl_if_in:cn}
-% See \cs{tl_if_in:nn(TF)} for further comments. Here we simply
-% expand the token list variable and pass it to \cs{tl_if_in:nn(TF)}.
+% See \cs{tl_if_in:nnTF} for further comments. Here we simply
+% expand the token list variable and pass it to \cs{tl_if_in:nnTF}.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \tl_if_in:NnT { \exp_args:No \tl_if_in:nnT }
-\cs_new_protected_nopar:Npn \tl_if_in:NnF { \exp_args:No \tl_if_in:nnF }
-\cs_new_protected_nopar:Npn \tl_if_in:NnTF { \exp_args:No \tl_if_in:nnTF }
+\cs_new_protected:Npn \tl_if_in:NnT { \exp_args:No \tl_if_in:nnT }
+\cs_new_protected:Npn \tl_if_in:NnF { \exp_args:No \tl_if_in:nnF }
+\cs_new_protected:Npn \tl_if_in:NnTF { \exp_args:No \tl_if_in:nnTF }
\cs_generate_variant:Nn \tl_if_in:NnT { c }
\cs_generate_variant:Nn \tl_if_in:NnF { c }
\cs_generate_variant:Nn \tl_if_in:NnTF { c }
@@ -2036,7 +2012,7 @@
% The function \cs{@@_tmp:w} removes tokens until the first occurrence
% of |#2|. If this does not appear in |#1|, then the final |#2| is removed,
% leaving an empty token list. Otherwise some tokens remain, and the
-% test is \texttt{false}. See \cs{tl_if_empty:n(TF)} for details on
+% test is \texttt{false}. See \cs{tl_if_empty:nTF} for details on
% the emptiness test.
%
% Treating correctly cases like
@@ -2106,8 +2082,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[EXP]{\tl_case:Nn, \tl_case:cn}
-% \begin{macro}[EXP, TF]{\tl_case:Nn, \tl_case:cn}
+% \begin{macro}[EXP, noTF]{\tl_case:Nn, \tl_case:cn}
% \begin{macro}[EXP, aux]{\@@_case:nnTF}
% \begin{macro}[aux, EXP]{\@@_case:Nw}
% \begin{macro}[int, EXP]{\__prg_case_end:nw}
@@ -2173,7 +2148,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \subsection{Mapping to token lists}
%
@@ -2190,7 +2164,7 @@
\q_recursion_tail
\__prg_break_point:Nn \tl_map_break: { }
}
-\cs_new_nopar:Npn \tl_map_function:NN
+\cs_new:Npn \tl_map_function:NN
{ \exp_args:No \tl_map_function:nN }
\cs_new:Npn \@@_map_function:Nn #1#2
{
@@ -2239,7 +2213,7 @@
\q_recursion_tail
\__prg_break_point:Nn \tl_map_break: { }
}
-\cs_new_protected_nopar:Npn \tl_map_variable:NNn
+\cs_new_protected:Npn \tl_map_variable:NNn
{ \exp_args:No \tl_map_variable:nNn }
\cs_new_protected:Npn \@@_map_variable:Nnn #1#2#3
{
@@ -2258,9 +2232,9 @@
% \begin{macro}{\tl_map_break:n}
% The break statements use the general \cs{__prg_map_break:Nn}.
% \begin{macrocode}
-\cs_new_nopar:Npn \tl_map_break:
+\cs_new:Npn \tl_map_break:
{ \__prg_map_break:Nn \tl_map_break: { } }
-\cs_new_nopar:Npn \tl_map_break:n
+\cs_new:Npn \tl_map_break:n
{ \__prg_map_break:Nn \tl_map_break: }
% \end{macrocode}
% \end{macro}
@@ -2634,7 +2608,7 @@
}
\cs_generate_variant:Nn \tl_head:n { V , v , f }
\cs_new:Npn \tl_head:w #1#2 \q_stop {#1}
-\cs_new_nopar:Npn \tl_head:N { \exp_args:No \tl_head:n }
+\cs_new:Npn \tl_head:N { \exp_args:No \tl_head:n }
% \end{macrocode}
% To corrected leave the tail of a token list, it's important \emph{not} to
% absorb any of the tail part as an argument. For example, the simple
@@ -2659,7 +2633,7 @@
{ \exp_after:wN { \use_none:n #1 } }
}
\cs_generate_variant:Nn \tl_tail:n { V , v , f }
-\cs_new_nopar:Npn \tl_tail:N { \exp_args:No \tl_tail:n }
+\cs_new:Npn \tl_tail:N { \exp_args:No \tl_tail:n }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2914,7 +2888,7 @@
{ \__prg_break:n { \exp_not:n {#2} } }
{ \exp_args:Nf \@@_item:nn { \int_eval:n { #1 - 1 } } }
}
-\cs_new_nopar:Npn \tl_item:Nn { \exp_args:No \tl_item:nn }
+\cs_new:Npn \tl_item:Nn { \exp_args:No \tl_item:nn }
\cs_generate_variant:Nn \tl_item:Nn { c }
% \end{macrocode}
% \end{macro}
@@ -2972,7 +2946,7 @@
%
% \subsection{Deprecated functions}
%
-% \begin{macro}{\tl_to_lowercase:n, \tl_to_uppercase:n}
+% \begin{macro}[deprecated=2017-12-31]{\tl_to_lowercase:n, \tl_to_uppercase:n}
% For removal after 2017-12-31.
% \begin{macrocode}
\cs_new_protected:Npn \tl_to_lowercase:n #1