[latex3-commits] [git/LaTeX3-latex3-latex3] main: Add 'early' scan marks to record (fixes #1025) (b05cc5e55)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Nov 7 14:29:30 CET 2022
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/b05cc5e554a37385d3cf4523e3b07843ebeb0811
>---------------------------------------------------------------
commit b05cc5e554a37385d3cf4523e3b07843ebeb0811
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Nov 7 13:12:01 2022 +0000
Add 'early' scan marks to record (fixes #1025)
>---------------------------------------------------------------
b05cc5e554a37385d3cf4523e3b07843ebeb0811
l3kernel/l3quark.dtx | 21 ++++++++-------------
l3kernel/testfiles/m3quark001.lvt | 7 ++++++-
l3kernel/testfiles/m3quark001.tlg | 2 ++
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/l3kernel/l3quark.dtx b/l3kernel/l3quark.dtx
index 05291a288..0842d3971 100644
--- a/l3kernel/l3quark.dtx
+++ b/l3kernel/l3quark.dtx
@@ -942,15 +942,6 @@
%<@@=scan>
% \end{macrocode}
%
-% \begin{variable}{\g_@@_marks_tl}
-% \UnitTested
-% The list of all scan marks currently declared.
-% No \pkg{l3tl} yet, so define this by hand.
-% \begin{macrocode}
-\cs_gset:Npn \g_@@_marks_tl { }
-% \end{macrocode}
-% \end{variable}
-%
% \begin{macro}{\scan_new:N}
% \UnitTested
% Check whether the variable is already a scan mark,
@@ -972,26 +963,30 @@
% \end{macro}
%
% \begin{variable}{\s_stop}
+% \begin{variable}{\g_@@_marks_tl}
% \UnitTested
% We only declare one scan mark here, more can be defined
% by specific modules.
% Can't use \cs{scan_new:N} yet because \pkg{l3tl} isn't loaded,
% so define \cs{s_stop} by hand and add it to \cs{g_@@_marks_tl}.
-% We also add \cs{s__quark} (declared earlier) to the pool here.
-% Since it lives in a different namespace, a little \pkg{l3docstrip}
+% We also add the scan marks declared earlier to the pool here.
+% Since they lives in a different namespace, a little \pkg{l3docstrip}
% cheating is necessary.
% \begin{macrocode}
\cs_new_eq:NN \s_stop \scan_stop:
-\cs_gset_nopar:Npx \g_@@_marks_tl
+\cs_gset_nopar:Npn \g_@@_marks_tl
{
- \exp_not:o \g_@@_marks_tl
\s_stop
%<@@=quark>
\s_@@
+%<@@=cs>
+ \s_@@_mark
+ \s_@@_stop
%<@@=scan>
}
% \end{macrocode}
% \end{variable}
+% \end{variable}
%
% \begin{macro}[EXP]{\use_none_delimit_by_s_stop:w}
% \UnitTested
diff --git a/l3kernel/testfiles/m3quark001.lvt b/l3kernel/testfiles/m3quark001.lvt
index 7cd045888..b748aabf0 100644
--- a/l3kernel/testfiles/m3quark001.lvt
+++ b/l3kernel/testfiles/m3quark001.lvt
@@ -1,5 +1,5 @@
%
-% Copyright (C) 2008-2012,2014,2015,2018,2020,2021 The LaTeX Project
+% Copyright (C) 2008-2012,2014,2015,2018,2020-2022 The LaTeX Project
%
\documentclass{minimal}
@@ -92,6 +92,11 @@
\TEST{New~scan~mark,~same~name:~ERROR!}{
\scan_new:N \s__foo
+ % This oddness avoids the mapping stopping due to the internal
+ % scan mark in the tl: it's only an issue at one specific place,
+ % so we can alter the list length to avoid!
+ \tl_gremove_all:Nn \g__scan_marks_tl \s_stop
+ \TYPE \s_stop
\tl_map_function:NN \g__scan_marks_tl \TYPE
}
diff --git a/l3kernel/testfiles/m3quark001.tlg b/l3kernel/testfiles/m3quark001.tlg
index 2289373ce..c952f45c5 100644
--- a/l3kernel/testfiles/m3quark001.tlg
+++ b/l3kernel/testfiles/m3quark001.tlg
@@ -82,6 +82,8 @@ LaTeX has been asked to create a new scan mark '\s__foo' but this name has
already been used for a scan mark.
\s_stop
\s__quark
+\s__cs_mark
+\s__cs_stop
\s__tl_act_stop
\s__tl_nil
\s__tl_mark
More information about the latex3-commits
mailing list.