[latex3-commits] [git/LaTeX3-latex3-latex3] master: Fix \tl_rescan:nn when it receives a comment character (fixes #607) (1d76cd249)

Bruno Le Floch bruno at le-floch.fr
Sun Aug 18 20:02:14 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/1d76cd249b898a01bcd3415116346630232a7036

>---------------------------------------------------------------

commit 1d76cd249b898a01bcd3415116346630232a7036
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sun Aug 18 20:02:14 2019 +0200

    Fix \tl_rescan:nn when it receives a comment character (fixes #607)


>---------------------------------------------------------------

1d76cd249b898a01bcd3415116346630232a7036
 l3kernel/CHANGELOG.md                   |   5 ++
 l3kernel/l3tl.dtx                       | 122 +++++++++++++++++++-------------
 l3kernel/testfiles/m3expl001.luatex.tlg |   5 +-
 l3kernel/testfiles/m3expl001.ptex.tlg   |   5 +-
 l3kernel/testfiles/m3expl001.tlg        |   5 +-
 l3kernel/testfiles/m3expl001.uptex.tlg  |   5 +-
 l3kernel/testfiles/m3expl001.xetex.tlg  |   5 +-
 l3kernel/testfiles/m3expl003.luatex.tlg |   5 +-
 l3kernel/testfiles/m3expl003.ptex.tlg   |   5 +-
 l3kernel/testfiles/m3expl003.tlg        |   5 +-
 l3kernel/testfiles/m3expl003.uptex.tlg  |   5 +-
 l3kernel/testfiles/m3expl003.xetex.tlg  |   5 +-
 l3kernel/testfiles/m3tl008.lvt          |  10 ++-
 l3kernel/testfiles/m3tl008.tlg          |   4 ++
 14 files changed, 121 insertions(+), 70 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index ab9381bfc..d807112c8 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,11 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Fixed
+
+- `\tl_rescan:nn` and `\tl_(g)set_rescan:Nnn` when single-line input
+  contains a comment character (see #607)
+
 ## [2019-08-14]
 
 ### Deprecated
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index cb617cc5a..939b9fcf1 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -1558,12 +1558,12 @@
 % \begin{macro}[EXP]{\@@_rescan:NNw}
 %   In a group, after some initial setup explained below and the user
 %   setup~|#3| (followed by \cs{scan_stop:} to be safe), there is a call
-%   to \cs{@@_set_rescan:nNN}.  This shared auxiliary distinguishes
-%   single-line and multi-line files as explained below.  In the
-%   simplest case of multi-line files it calls (with the same arguments)
+%   to \cs{@@_set_rescan:nNN}.  This shared auxiliary defined later
+%   distinguishes single-line and multi-line ``files''.  In the simplest
+%   case of multi-line files, it calls (with the same arguments)
 %   \cs{@@_set_rescan_multi:nNN}, whose code is included here to help
-%   understand the approach: it rescans its argument |#1|, closes the
-%   group, and performs the assignment.
+%   understand the approach.  This function rescans its argument |#1|,
+%   closes the group, and performs the assignment.
 %
 %   One difficulty when rescanning is that \tn{scantokens} treats the
 %   argument as a file, and without the correct settings a \TeX{} error
@@ -1575,9 +1575,9 @@
 %   \tn{scantokens} and closing it inside that temporary file; we avoid
 %   that by setting \tn{tracingnesting}.  The standard solution to the
 %   ``File ended'' error is to grab the rescanned tokens as a delimited
-%   argument of an auxiliary, here \cs{@@_set_rescan:NNw}, that performs
-%   the assignment, then let \TeX{} ``execute'' the end of file marker.
-%   As usual in delimited arguments we use \cs{prg_do_nothing:} to avoid
+%   argument of an auxiliary, here \cs{@@_rescan:NNw}, that performs the
+%   assignment, then let \TeX{} ``execute'' the end of file marker.  As
+%   usual in delimited arguments we use \cs{prg_do_nothing:} to avoid
 %   stripping an outer set braces: this is removed by using
 %   \texttt{o}-expanding assignments.  The delimiter cannot appear
 %   within the rescanned token list because it contains twice the same
@@ -1589,6 +1589,19 @@
 %   rescanned result is code that looks further in the input stream for
 %   arguments, it would break.
 %
+%   For multi-line files the only subtlety is that \tn{newlinechar}
+%   should be equal to \tn{endlinechar} because \tn{newlinechar}
+%   characters become new lines and then become \tn{endlinechar}
+%   characters when writing to an abstract file and reading back.  This
+%   equality is ensured by setting \tn{newlinechar} equal to
+%   \tn{endlinechar}.  Prior to this, \tn{endlinechar} is set to $-1$ if
+%   it was $32$ (in particular true after \cs{ExplSyntaxOn}) to avoid
+%   unreasonable line-breaks at every space for instance in error
+%   messages triggered by the user setup.  Another side effect of
+%   reading back from the file is that spaces (catcode $10$) are ignored
+%   at the beginning of lines, and spaces and tabs (character code $32$
+%   and $9$) are ignored at the end of lines.
+%
 %   The two \cs{if_false:} \ldots{} \cs{fi:} are there to prevent
 %   alignment tabs to cause a change of tabular cell while rescanning.
 %   We put the \enquote{opening} one after \cs{group_begin:} so that if
@@ -1596,22 +1609,21 @@
 %   remain balanced.  This is essential in \texttt{e}-type arguments
 %   when \tn{expanded} is not available.
 %    \begin{macrocode}
-\cs_new_protected:Npn \tl_set_rescan:Nnn
-  { \@@_set_rescan:NNnn \tl_set:No }
-\cs_new_protected:Npn \tl_gset_rescan:Nnn
-  { \@@_set_rescan:NNnn \tl_gset:No }
 \cs_new_protected:Npn \tl_rescan:nn #1#2
   {
     \tl_set_rescan:Nnn \l_@@_internal_a_tl {#1} {#2}
     \exp_after:wN \tl_clear:N \exp_after:wN \l_@@_internal_a_tl
     \l_@@_internal_a_tl
   }
+\cs_new_protected:Npn \tl_set_rescan:Nnn
+  { \@@_set_rescan:NNnn \tl_set:No }
+\cs_new_protected:Npn \tl_gset_rescan:Nnn
+  { \@@_set_rescan:NNnn \tl_gset:No }
 \cs_new_protected:Npn \@@_set_rescan:NNnn #1#2#3#4
   {
     \group_begin:
       \if_false: { \fi:
       \int_set_eq:NN \tex_tracingnesting:D \c_zero_int
-      \exp_args:No \tex_everyeof:D { \c_@@_rescan_marker_tl }
       \int_compare:nNnT \tex_endlinechar:D = { 32 }
         { \int_set:Nn \tex_endlinechar:D { -1 } }
       \int_set_eq:NN \tex_newlinechar:D \tex_endlinechar:D
@@ -1621,6 +1633,7 @@
   }
 \cs_new_protected:Npn \@@_set_rescan_multi:nNN #1#2#3
   {
+    \exp_args:No \tex_everyeof:D { \c_@@_rescan_marker_tl }
     \exp_after:wN \@@_rescan:NNw
     \exp_after:wN #2
     \exp_after:wN #3
@@ -1645,27 +1658,14 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_set_rescan:nNN}
-% \begin{macro}{\@@_set_rescan_single:nnNN, \@@_set_rescan_single_aux:nnNN}
-%   This function calls \cs{@@_set_rescan_multi:nNN} or
-%   \cs{@@_set_rescan_single:nnNN} |{ ' }| depending on whether its
-%   argument is a single-line fragment of code/data or is made of
-%   multiple lines by testing for the presence of a \tn{newlinechar}
-%   character.  If \tn{newlinechar} is out of range, the argument is
-%   assumed to be a single line.
-%
-%   The case of multiple lines is a straightforward application of
-%   \tn{scantokens} as described above.  The only subtlety is that
-%   \tn{newlinechar} should be equal to \tn{endlinechar} because
-%   \tn{newlinechar} characters become new lines and then become
-%   \tn{endlinechar} characters when writing to an abstract file and
-%   reading back.  This equality is ensured by setting \tn{newlinechar}
-%   equal to \tn{endlinechar}.  Prior to this, \tn{endlinechar} is set
-%   to $-1$ if it was $32$ (in particular true after \cs{ExplSyntaxOn})
-%   to avoid unreasonable line-breaks at every space for instance in
-%   error messages triggered by the user setup.  Another side effect of
-%   reading back from the file is that spaces (catcode $10$) are
-%   ignored at the beginning of lines, and spaces and tabs (character
-%   code $32$ and $9$) are ignored at the end of lines.
+% \begin{macro}{\@@_set_rescan_single:nnNN, \@@_set_rescan_single_aux:nnnNN}
+% \begin{macro}[rEXP]{\@@_set_rescan_single_aux:w}
+%   The function \cs{@@_set_rescan:nNN} calls \cs{@@_set_rescan_multi:nNN} or
+%   \cs{@@_set_rescan_single:nnNN} |{ ' }| depending on whether its argument
+%   is a single-line fragment of code/data or is made of multiple lines
+%   by testing for the presence of a \tn{newlinechar} character.  If
+%   \tn{newlinechar} is out of range, the argument is assumed to be a
+%   single line.
 %
 %   For a single line, no \tn{endlinechar} should be added, so it is
 %   set to $-1$, and spaces should not be removed.
@@ -1682,13 +1682,27 @@
 %   of starting point was made because this is the start of a very long
 %   range of characters whose standard category is letter or other,
 %   thus minimizing the number of steps needed by the loop (most often
-%   just a single one).  Once a valid character is found, run some code
-%   very similar to \cs{@@_set_rescan_multi:nNN} but with that character
-%   put at the start and end.  The auxiliary \cs{@@_rescan:NNw} must be
-%   redefined to also remove the additional character (with the
-%   appropriate catcode thanks to \cs{char_generate:nn}).  If no valid
-%   character is found (very rare), fall-back on
-%   \cs{@@_set_rescan_multi:nNN}.
+%   just a single one).  If no valid character is found (very rare),
+%   fall-back on \cs{@@_set_rescan_multi:nNN}.
+%
+%   Otherwise, once a valid character is found (let us use |'| in this
+%   explanation) run some code very similar to \cs{@@_set_rescan_multi:nNN}
+%   but with |'| added at both ends of the input.  Of course, we need to
+%   define the auxiliary \cs{@@_set_rescan_single:NNww} on the fly to remove
+%   the additional~|'| that is just before |::| (by which we mean
+%   \cs{c_@@_rescan_marker_tl}).  Note that the argument must be
+%   delimited by |'| with the current catcode; this is done thanks to
+%   \cs{char_generate:nn}.  Yet another issue is that the rescanned
+%   token list may contain a comment character, in which case the |'| we
+%   expected is not there.  We fix this as follows: rather than just
+%   |::| we set \tn{everyeof} to |::|\Arg{code1} |'::|\Arg{code2}
+%   \cs{q_stop}.  The auxiliary \cs{@@_set_rescan_single:NNww} runs the
+%   \texttt{o}-expanding assignment, expanding either \meta{code1} or
+%   \meta{code2} before its the main argument~|#3|.  In the typical case
+%   without comment character, \meta{code1} is expanded, removing the
+%   leading~|'|.  In the rarer case with comment character, \meta{code2}
+%   is expanded, calling \cs{@@_set_rescan_single_aux:w}, which removes the
+%   trailing |::|\Arg{code1} and the leading~|'|.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_set_rescan:nNN #1
   {
@@ -1710,7 +1724,8 @@
     \int_compare:nNnTF
       { \char_value_catcode:n {#1} / 2 } = 6
       {
-        \exp_args:Nf \@@_set_rescan_single_aux:nnNN
+        \exp_args:Nof \@@_set_rescan_single_aux:nnnNN
+          \c_@@_rescan_marker_tl
           { \char_generate:nn {#1} { \char_value_catcode:n {#1} } }
       }
       {
@@ -1722,23 +1737,32 @@
           { \@@_set_rescan_multi:nNN }
       }
   }
-\cs_new_protected:Npn \@@_set_rescan_single_aux:nnNN #1#2#3#4
+\cs_new_protected:Npn \@@_set_rescan_single_aux:nnnNN #1#2#3#4#5
   {
-    \exp_args:Nno \use:nn
-      { \cs_set:Npn \@@_rescan:NNw ##1##2##3 #1 }
-      \c_@@_rescan_marker_tl
+    \tex_everyeof:D
+      {
+        #1 \use_none:n
+        #2 #1 { \exp:w \@@_set_rescan_single_aux:w }
+        \q_stop
+      }
+    \cs_set:Npn \@@_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \q_stop
       {
         \group_end:
-        ##1 ##2 { \use_none:n ##3 }
+        ##1 ##2 { ##4 ##3 }
       }
     \exp_after:wN \@@_rescan:NNw
-    \exp_after:wN #3
     \exp_after:wN #4
-    \tex_scantokens:D { #1 #2 #1 }
+    \exp_after:wN #5
+    \tex_scantokens:D { #2 #3 #2 }
   }
+\exp_args:Nno \use:nn
+  { \cs_new:Npn \@@_set_rescan_single_aux:w #1 }
+  \c_@@_rescan_marker_tl #2
+  { \use_i:nn \exp_end: #1 }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \subsection{Modifying token list variables}
 %
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 1a3c59f13..941c8e8a3 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -385,9 +385,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -402,7 +402,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 4a25760bc..5acffa899 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 5292db288..fc9787ea5 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index eca611979..0d6b19679 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 7334dd6ed..2cae92902 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 1a3c59f13..941c8e8a3 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -385,9 +385,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -402,7 +402,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 4a25760bc..5acffa899 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 5292db288..fc9787ea5 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index eca611979..0d6b19679 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 7334dd6ed..2cae92902 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -384,9 +384,9 @@ Defining \tl_gput_right:cV on line ...
 Defining \tl_gput_right:co on line ...
 Defining \tl_gput_right:cx on line ...
 Defining \c__tl_rescan_marker_tl on line ...
+Defining \tl_rescan:nn on line ...
 Defining \tl_set_rescan:Nnn on line ...
 Defining \tl_gset_rescan:Nnn on line ...
-Defining \tl_rescan:nn on line ...
 Defining \__tl_set_rescan:NNnn on line ...
 Defining \__tl_set_rescan_multi:nNN on line ...
 Defining \__tl_rescan:NNw on line ...
@@ -401,7 +401,8 @@ Defining \tl_gset_rescan:cnn on line ...
 Defining \tl_gset_rescan:cno on line ...
 Defining \__tl_set_rescan:nNN on line ...
 Defining \__tl_set_rescan_single:nnNN on line ...
-Defining \__tl_set_rescan_single_aux:nnNN on line ...
+Defining \__tl_set_rescan_single_aux:nnnNN on line ...
+Defining \__tl_set_rescan_single_aux:w on line ...
 Defining \tl_replace_once:Nnn on line ...
 Defining \tl_greplace_once:Nnn on line ...
 Defining \tl_replace_all:Nnn on line ...
diff --git a/l3kernel/testfiles/m3tl008.lvt b/l3kernel/testfiles/m3tl008.lvt
index 58cb317e2..fe83c4663 100644
--- a/l3kernel/testfiles/m3tl008.lvt
+++ b/l3kernel/testfiles/m3tl008.lvt
@@ -1,5 +1,5 @@
 %
-% Copyright (C) 2011,2012,2015,2018 The LaTeX3 Project
+% Copyright (C) 2011,2012,2015,2018,2019 The LaTeX3 Project
 %
 \documentclass{minimal}
 \input{regression-test}
@@ -103,6 +103,14 @@
   \tl_log:N \l_tmpa_tl
   \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_comment:N \' } { }
   \tl_log:N \l_tmpa_tl
+  \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_comment:N \' } { ~ }
+  \tl_log:N \l_tmpa_tl
+  \tl_set_rescan:Nnx \l_tmpa_tl { \char_set_catcode_comment:N \' } { ~ ab ~ \c_space_tl }
+  \tl_log:N \l_tmpa_tl
+  \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_comment:N \' } { \space ab'cd }
+  \tl_log:N \l_tmpa_tl
+  \tl_set_rescan:Nnn \l_tmpa_tl { \char_set_catcode_comment:N \' } { ~ '''' }
+  \tl_log:N \l_tmpa_tl
 }
 
 \group_begin:
diff --git a/l3kernel/testfiles/m3tl008.tlg b/l3kernel/testfiles/m3tl008.tlg
index a770d761c..050c636d1 100644
--- a/l3kernel/testfiles/m3tl008.tlg
+++ b/l3kernel/testfiles/m3tl008.tlg
@@ -57,6 +57,10 @@ macro:->a ce
 > \l_tmpa_tl=abc.
 > \l_tmpa_tl=abd.
 > \l_tmpa_tl=.
+> \l_tmpa_tl= .
+> \l_tmpa_tl= ab .
+> \l_tmpa_tl=\space ab.
+> \l_tmpa_tl= .
 ============================================================
 ============================================================
 TEST 5: rescan multiple lines





More information about the latex3-commits mailing list