[latex3-commits] [git/LaTeX3-latex3-latex3] master: Leave implicit tokens unchanged in \text_expand:n (d342555a1)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Feb 13 18:59:43 CET 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/d342555a16e4e34993af32908b801ddd050fb510
>---------------------------------------------------------------
commit d342555a16e4e34993af32908b801ddd050fb510
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Feb 13 17:59:33 2020 +0000
Leave implicit tokens unchanged in \text_expand:n
>---------------------------------------------------------------
d342555a16e4e34993af32908b801ddd050fb510
l3kernel/CHANGELOG.md | 3 +++
l3kernel/l3text.dtx | 19 ++++---------------
l3kernel/testfiles/m3text001.tlg | 2 +-
3 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index c5417fe11..09787f4bb 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+- Leave implicit tokens unchanged by `\text_expand:n`
+
## [2020-02-11]
### Added
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 8940ce5af..5e84bbc8c 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -64,14 +64,13 @@
% \begin{syntax}
% \cs{text_expand:n} \Arg{text}
% \end{syntax}
-% Takes user input \meta{text} and transforms expandable and implicit
-% content to the explicit equivalent. Protected commands (typically
+% Takes user input \meta{text} and expands the content.
+% Protected commands (typically
% formatting) are left in place, and no processing takes place of
% math mode material (as delimited by pairs given in
% \cs{l_text_math_delims_tl} or as the argument to commands listed
% in \cs{l_text_math_arg_tl}). Commands which are neither engine-
-% nor \LaTeX{} protected are expanded exhaustively. Implicit tokens,
-% including implicit groups, are converted to their explicit equivalent.
+% nor \LaTeX{} protected are expanded exhaustively.
% Any commands listed in \cs{l_text_expand_exclude_tl},
% \cs{l_text_accents_tl} and \cs{l_text_letterlike_tl} are excluded from
% expansion.
@@ -697,7 +696,7 @@
\cs_new:Npn \@@_expand_math_search:NNN #1#2#3
{
\quark_if_recursion_tail_stop_do:Nn #2
- { \@@_expand_implicit:N #1 }
+ { \@@_expand_explicit:N #1 }
\token_if_eq_meaning:NNTF #1 #2
{
\use_i_delimit_by_q_recursion_stop:nw
@@ -740,16 +739,6 @@
\@@_expand_math_loop:Nw #1
}
% \end{macrocode}
-% Conversion of implicit to explicit tokens does not have to account for
-% spaces or brace groups: they are already fixed above. So we can assume that
-% the result of this conversion is still an \texttt{N}-type token.
-% \begin{macrocode}
-\cs_new:Npn \@@_expand_implicit:N #1
- {
- \exp_args:NNe \use:nn \@@_expand_explicit:N
- { \@@_token_to_explicit:N #1 }
- }
-% \end{macrocode}
% At this stage, either we have a control sequence or a simple character:
% split and handle.
% \begin{macrocode}
diff --git a/l3kernel/testfiles/m3text001.tlg b/l3kernel/testfiles/m3text001.tlg
index b468aa196..199f30f57 100644
--- a/l3kernel/testfiles/m3text001.tlg
+++ b/l3kernel/testfiles/m3text001.tlg
@@ -35,5 +35,5 @@ TEST 5: Accents
============================================================
TEST 6: Implicit tokens
============================================================
-"A"B"C" " " "
+"\AAA "\BBB "\CCC " " " "
============================================================
More information about the latex3-commits
mailing list.