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.dtx57
1 files changed, 34 insertions, 23 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index 61505a3337c..40fb555658c 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
@@ -41,7 +41,7 @@
% }^^A
% }
%
-% \date{Released 2018-04-30}
+% \date{Released 2018-05-12}
%
% \maketitle
%
@@ -1489,7 +1489,7 @@
}
{
\group_begin:
- \exp_args:No \etex_everyeof:D
+ \exp_args:No \tex_everyeof:D
{ \c_@@_rescan_marker_tl \exp_not:N }
\int_compare:nNnT \tex_endlinechar:D = { 32 }
{ \int_set:Nn \tex_endlinechar:D { -1 } }
@@ -1507,7 +1507,7 @@
{
\exp_after:wN \@@_rescan:w
\exp_after:wN \prg_do_nothing:
- \etex_scantokens:D {#1}
+ \tex_scantokens:D {#1}
}
}
\exp_args:Nno \use:nn
@@ -1625,7 +1625,7 @@
\exp_not:n { \cs_set:Npn \@@_rescan:w ##1 }
\exp_after:wN \@@_rescan:w
\exp_after:wN \prg_do_nothing:
- \etex_scantokens:D {#1}
+ \tex_scantokens:D {#1}
}
\c_@@_rescan_marker_tl
}
@@ -1640,7 +1640,7 @@
= { 10 } { ~ }
\exp_after:wN \@@_rescan:w
\exp_after:wN \prg_do_nothing:
- \etex_scantokens:D { #2 #1 }
+ \tex_scantokens:D { #2 #1 }
}
}
\group_end:
@@ -1896,12 +1896,18 @@
% \TeX{} skips spaces when reading a non-delimited arguments. Thus,
% a \meta{token list} is blank if and only if \cs{use_none:n}
% \meta{token list} |?| is empty after one expansion. The auxiliary
-% \cs{@@_if_empty_return:o} is a fast emptyness test, converting its
+% \cs{@@_if_empty_if:o} is a fast emptyness test, converting its
% argument to a string (after one expansion) and using the test
% \cs{if_meaning:w} \cs{q_nil} |...| \cs{q_nil}.
% \begin{macrocode}
\prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF }
- { \@@_if_empty_return:o { \use_none:n #1 ? } }
+ {
+ \@@_if_empty_if:o { \use_none:n #1 ? }
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
\prg_generate_conditional_variant:Nnn \tl_if_blank:n
{ V , o } { p , T , F , TF }
% \end{macrocode}
@@ -1954,26 +1960,31 @@
% \end{macro}
%
% \begin{macro}[pTF,documented-as=\tl_if_empty:nTF]{\tl_if_empty:o}
-% \begin{macro}[EXP]{\@@_if_empty_return:o}
-% The auxiliary function \cs{@@_if_empty_return:o} is for use
+% \begin{macro}[EXP]{\@@_if_empty_if:o}
+% The auxiliary function \cs{@@_if_empty_if: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:nTF}, but
% the expansion is hard-coded for efficiency, as this auxiliary
-% function is used in many places.
+% function is used in several places.
+% We don't put \cs{prg_return_true:} and so on in the definition of
+% the auxiliary, because that would prevent an optimization applied to
+% conditionals that end with this code.
% \begin{macrocode}
-\cs_new:Npn \@@_if_empty_return:o #1
+\cs_new:Npn \@@_if_empty_if:o #1
{
\exp_after:wN \if_meaning:w \exp_after:wN \q_nil
\__kernel_tl_to_str:w \exp_after:wN {#1} \q_nil
+ }
+\prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F }
+ {
+ \@@_if_empty_if:o {#1}
\prg_return_true:
\else:
\prg_return_false:
\fi:
- }
-\prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F }
- { \@@_if_empty_return:o {#1} }
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2004,13 +2015,13 @@
\group_begin:
\tl_set:Nn \l_@@_internal_a_tl {#1}
\tl_set:Nn \l_@@_internal_b_tl {#2}
- \if_meaning:w \l_@@_internal_a_tl \l_@@_internal_b_tl
- \group_end:
- \prg_return_true:
- \else:
- \group_end:
- \prg_return_false:
- \fi:
+ \exp_after:wN
+ \group_end:
+ \if_meaning:w \l_@@_internal_a_tl \l_@@_internal_b_tl
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
}
\tl_new:N \l_@@_internal_a_tl
\tl_new:N \l_@@_internal_b_tl
@@ -2982,7 +2993,7 @@
%
% The token list \cs{l_@@_internal_a_tl} containing the result
% of all these manipulations is displayed to the terminal using
-% \cs{etex_showtokens:D} and an odd \cs{exp_after:wN} which expand the
+% \cs{tex_showtokens:D} and an odd \cs{exp_after:wN} which expand the
% closing brace to improve the output slightly. The calls to
% \cs{__kernel_iow_with:Nnn} ensure that the \tn{newlinechar} is set to~$10$
% so that the \cs{iow_newline:} inserted by the line-wrapping code
@@ -2998,7 +3009,7 @@
{
\__kernel_iow_with:Nnn \tex_errorcontextlines:D { -1 }
{
- \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN
+ \tex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN
{ \exp_after:wN \l_@@_internal_a_tl }
}
}