summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3regex.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3regex.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3regex.dtx20
1 files changed, 12 insertions, 8 deletions
diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx
index 37ea18408f..85e9cf12b9 100644
--- a/macros/latex/contrib/l3kernel/l3regex.dtx
+++ b/macros/latex/contrib/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}