summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-12-07 22:06:05 +0000
committerKarl Berry <karl@freefriends.org>2020-12-07 22:06:05 +0000
commit64e75915646d2f3522cc81a7142eac31ab5372d4 (patch)
tree3ff7ed7598a38929482700509f6f686fb5556e4c /Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
parent11717414a40ca6ce25ae1a4c4c097c580a33a48a (diff)
l3kernel (7dec20)
git-svn-id: svn://tug.org/texlive/trunk@57088 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3regex.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3regex.dtx20
1 files changed, 12 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
index 37ea18408f3..85e9cf12b95 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-12-05}
+% \date{Released 2020-12-07}
%
% \maketitle
%
@@ -6487,12 +6487,16 @@
% \begin{macro}{\@@_peek_end:, \@@_peek_remove_end:n}
% Once the regex matches (or permanently fails to match) we call
% \cs{@@_peek_end:}, or \cs{@@_peek_remove_end:n} with argument the
-% last token seen (or rather tokens that \texttt{o}-expand and
-% \texttt{x}-expand to it). For \cs{peek_regex:nTF} we reinsert
-% tokens seen by calling \cs{@@_peek_reinsert:N} regardless of the
-% result of the match. For \cs{peek_regex_remove_once:nTF} we reinsert the
-% tokens seen only if the match failed; otherwise we just reinsert the
-% tokens~|#1|, with one expansion.
+% last token seen. For \cs{peek_regex:nTF} we reinsert tokens seen by
+% calling \cs{@@_peek_reinsert:N} regardless of the result of the
+% match. For \cs{peek_regex_remove_once:nTF} we reinsert the tokens
+% seen only if the match failed; otherwise we just reinsert the
+% tokens~|#1|, with one expansion. To be more precise, |#1| consists
+% of tokens that \texttt{o}-expand and \texttt{x}-expand to the last
+% token seen, for example it is \cs{exp_not:N} \meta{cs} for a control
+% sequence. This means that just doing \cs{exp_after:wN}
+% \cs{l_@@_peek_true_tl} |#1| would be unsafe because the expansion of
+% \meta{cs} would be suppressed.
% \begin{macrocode}
\cs_new_protected:Npn \@@_peek_end:
{
@@ -6503,7 +6507,7 @@
\cs_new_protected:Npn \@@_peek_remove_end:n #1
{
\bool_if:NTF \g_@@_success_bool
- { \exp_after:wN \l_@@_peek_true_tl #1 }
+ { \exp_args:NNo \use:nn \l_@@_peek_true_tl {#1} }
{ \@@_peek_reinsert:N \l_@@_peek_false_tl }
}
% \end{macrocode}