diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3tl.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3tl.dtx | 88 |
1 files changed, 63 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index cf506b9feca..0f38c95aa74 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-11-09} +% \date{Released 2023-12-08} % % \maketitle % @@ -295,7 +295,11 @@ % or \cs{str_if_eq:nnTF} if category codes are not important. % \end{function} % -% \begin{function}[TF]{\tl_if_in:Nn, \tl_if_in:NV, \tl_if_in:cn, \tl_if_in:cV} +% \begin{function}[TF] +% { +% \tl_if_in:Nn, \tl_if_in:NV, \tl_if_in:No, +% \tl_if_in:cn, \tl_if_in:cV, \tl_if_in:co +% } % \begin{syntax} % \cs{tl_if_in:NnTF} \meta{tl~var} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} @@ -307,7 +311,10 @@ % \end{function} % % \begin{function}[TF] -% {\tl_if_in:nn, \tl_if_in:Vn, \tl_if_in:nV, \tl_if_in:on, \tl_if_in:no} +% { +% \tl_if_in:nn, \tl_if_in:Vn, \tl_if_in:VV, \tl_if_in:on, \tl_if_in:oo, +% \tl_if_in:nV, \tl_if_in:no +% } % \begin{syntax} % \cs{tl_if_in:nnTF} \Arg{token list_1} \Arg{token list_2} \Arg{true code} \Arg{false code} % \end{syntax} @@ -367,7 +374,10 @@ % \subsection{Testing the first token} % % \begin{function}[updated = 2012-07-09, EXP, pTF] -% {\tl_if_head_eq_catcode:nN, \tl_if_head_eq_catcode:oN} +% { +% \tl_if_head_eq_catcode:nN, \tl_if_head_eq_catcode:VN, +% \tl_if_head_eq_catcode:eN, \tl_if_head_eq_catcode:oN +% } % \begin{syntax} % \cs{tl_if_head_eq_catcode_p:nN} \Arg{token list} \meta{test token} % \cs{tl_if_head_eq_catcode:nNTF} \Arg{token list} \meta{test token} @@ -379,7 +389,10 @@ % \end{function} % % \begin{function}[updated = 2012-07-09, EXP, pTF] -% {\tl_if_head_eq_charcode:nN, \tl_if_head_eq_charcode:fN} +% { +% \tl_if_head_eq_charcode:nN, \tl_if_head_eq_charcode:VN, +% \tl_if_head_eq_charcode:eN, \tl_if_head_eq_charcode:fN +% } % \begin{syntax} % \cs{tl_if_head_eq_charcode_p:nN} \Arg{token list} \meta{test token} % \cs{tl_if_head_eq_charcode:nNTF} \Arg{token list} \meta{test token} @@ -390,7 +403,11 @@ % \meta{token list} is empty, the test is always \texttt{false}. % \end{function} % -% \begin{function}[updated = 2012-07-09, EXP, pTF]{\tl_if_head_eq_meaning:nN} +% \begin{function}[updated = 2012-07-09, EXP, pTF] +% { +% \tl_if_head_eq_meaning:nN, \tl_if_head_eq_meaning:VN, +% \tl_if_head_eq_meaning:eN +% } % \begin{syntax} % \cs{tl_if_head_eq_meaning_p:nN} \Arg{token list} \meta{test token} % \cs{tl_if_head_eq_meaning:nNTF} \Arg{token list} \meta{test token} @@ -516,7 +533,7 @@ % \subsection{Counting and reversing token lists} % % \begin{function}[added = 2012-05-13, EXP] -% {\tl_count:n, \tl_count:V, \tl_count:o} +% {\tl_count:n, \tl_count:V, \tl_count:v, \tl_count:e, \tl_count:o} % \begin{syntax} % \cs{tl_count:n} \Arg{tokens} % \end{syntax} @@ -1352,8 +1369,11 @@ % \tl_const:cn, \tl_const:ce, \tl_const:cx % } % Constants are also easy to generate. They use \cs{cs_gset_nopar:Npe} instead -% of \cs{__kernel_tl_gset:Ne} so that the correct scope checking is applied if -% \pkg{l3debug} is used. +% of \cs{__kernel_tl_gset:Ne} so that the correct scope checking for |c|, +% instead of for |g|, is applied when +% \cs{debug_on:n} |{ check-declarations }| is used. +% Constant assignment functions are patched specially in \pkg{l3debug} to +% apply such checks. % \begin{macrocode} \cs_new_protected:Npn \tl_const:Nn #1#2 { @@ -2429,12 +2449,16 @@ \fi: } \prg_generate_conditional_variant:Nnn \tl_if_eq:nn - { nV , ne , nx , e , ee , x , xx } + { nV , ne , nx , V, e , ee , x , xx } { TF , T , F } % \end{macrocode} % \end{macro} % -% \begin{macro}[TF]{\tl_if_in:Nn, \tl_if_in:NV, \tl_if_in:cn, \tl_if_in:cV} +% \begin{macro}[TF] +% { +% \tl_if_in:Nn, \tl_if_in:NV, \tl_if_in:No, +% \tl_if_in:cn, \tl_if_in:cV, \tl_if_in:co +% } % 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} @@ -2442,11 +2466,15 @@ \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 } \prg_generate_conditional_variant:Nnn \tl_if_in:Nn - { NV , c , cV } { T , F , TF } + { NV , No , c , cV , co } { T , F , TF } % \end{macrocode} % \end{macro} % -% \begin{macro}[TF]{\tl_if_in:nn, \tl_if_in:Vn, \tl_if_in:on, \tl_if_in:nV, \tl_if_in:no} +% \begin{macro}[TF] +% { +% \tl_if_in:nn, \tl_if_in:Vn, \tl_if_in:VV, \tl_if_in:on, \tl_if_in:oo, +% \tl_if_in:nV, \tl_if_in:no +% } % Once more, the test relies on the emptiness test for robustness. % 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, @@ -2476,7 +2504,7 @@ \if_false: } \fi: } \prg_generate_conditional_variant:Nnn \tl_if_in:nn - { V , o , nV , no } { T , F , TF } + { V , VV , o , oo , nV , no } { T , F , TF } % \end{macrocode} % \end{macro} % @@ -2756,7 +2784,7 @@ % % \subsection{Working with the contents of token lists} % -% \begin{macro}{\tl_count:n, \tl_count:V, \tl_count:o} +% \begin{macro}{\tl_count:n, \tl_count:V, \tl_count:v, \tl_count:e, \tl_count:o} % \begin{macro}{\tl_count:N, \tl_count:c} % \begin{macro}{\@@_count:n} % Count number of elements within a token list or token list @@ -2776,7 +2804,7 @@ { 0 \tl_map_function:NN #1 \@@_count:n } } \cs_new:Npn \@@_count:n #1 { + 1 } -\cs_generate_variant:Nn \tl_count:n { V , o } +\cs_generate_variant:Nn \tl_count:n { V , v , e , o } \cs_generate_variant:Nn \tl_count:N { c } % \end{macrocode} % \end{macro} @@ -3014,11 +3042,21 @@ % \end{macro} % \end{macro} % -% \begin{macro}[pTF]{\tl_if_head_eq_meaning:nN} -% \begin{macro}[pTF]{\tl_if_head_eq_charcode:nN} -% \begin{macro}[pTF]{\tl_if_head_eq_charcode:fN} -% \begin{macro}[pTF]{\tl_if_head_eq_catcode:nN} -% \begin{macro}[pTF]{\tl_if_head_eq_catcode:oN} +% \begin{macro}[pTF] +% { +% \tl_if_head_eq_meaning:nN, \tl_if_head_eq_meaning:VN, +% \tl_if_head_eq_meaning:eN +% } +% \begin{macro}[pTF] +% { +% \tl_if_head_eq_charcode:nN, \tl_if_head_eq_charcode:VN, +% \tl_if_head_eq_charcode:eN, \tl_if_head_eq_charcode:fN +% } +% \begin{macro}[pTF] +% { +% \tl_if_head_eq_catcode:nN, \tl_if_head_eq_catcode:VN, +% \tl_if_head_eq_catcode:eN, \tl_if_head_eq_catcode:oN +% } % \begin{macro}[EXP]{\@@_head_exp_not:w} % \begin{macro}[EXP]{\@@_if_head_eq_empty_arg:w} % Accessing the first token of a token list is tricky in three cases: @@ -3057,7 +3095,7 @@ \fi: } \prg_generate_conditional_variant:Nnn \tl_if_head_eq_charcode:nN - { f } { p , TF , T , F } + { V , e , f } { p , TF , T , F } % \end{macrocode} % For \cs{tl_if_head_eq_catcode:nN}, again we detect special cases % with a \cs{tl_if_head_is_N_type:n}. Then we need to test if the @@ -3084,7 +3122,7 @@ \fi: } \prg_generate_conditional_variant:Nnn \tl_if_head_eq_catcode:nN - { o } { p , TF , T , F } + { V , e , o } { p , TF , T , F } % \end{macrocode} % For \cs{tl_if_head_eq_meaning:nN}, again, detect special cases. In % the normal case, use \cs{tl_head:w}, with no \cs{exp_not:N} this @@ -3105,6 +3143,8 @@ \@@_if_head_eq_meaning_special:nN {#1} #2 } +\prg_generate_conditional_variant:Nnn \tl_if_head_eq_meaning:nN + { V , e } { p , TF , T , F } \cs_new:Npn \@@_if_head_eq_meaning_normal:nN #1 #2 { \exp_after:wN \if_meaning:w @@ -3158,8 +3198,6 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} -% \end{macro} % % \begin{macro}[pTF]{\tl_if_head_is_N_type:n} % \begin{macro}[EXP] |