summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/expl3.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3basics.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3box.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx30
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3clist.dtx13
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3doc.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3expan.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3file.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3final.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3flag.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx16
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx19
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx20
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp.dtx14
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3int.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3keys.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3msg.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3names.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx108
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3quark.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3regex.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3seq.dtx10
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3sort.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3str.dtx18
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3sys.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx5
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl.dtx145
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3token.dtx2
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx2
52 files changed, 315 insertions, 171 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
index fc7bc8fe1c2..7733d54a7a2 100644
--- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
@@ -23,7 +23,7 @@
% for those people who are interested.
%
%<*driver|generic|package>
-\def\ExplFileDate{2019-08-14}%
+\def\ExplFileDate{2019-08-25}%
%</driver|generic|package>
%<*driver>
\documentclass[full]{l3doc}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
index f17f27e12fb..1c74174aeb0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
index 8764b0d589d..8bd1bd8e6c0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
index 3cfdd3985f9..35ab971e153 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
index 81f989d21ad..8067a6ca6a6 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
index 82a756fa782..a92db3ebedf 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -246,6 +246,15 @@
% is~$0$.
% \end{function}
%
+% \begin{function}[pTF, added = 2019-08-25]{\fp_if_nan:n}
+% \begin{syntax}
+% \cs{fp_if_nan:n} \Arg{fpexpr}
+% \end{syntax}
+% Evaluates the \meta{fpexpr} and tests whether the result is exactly
+% \nan{}. The test returns \texttt{false} for any other result, even
+% a tuple containing \nan{}.
+% \end{function}
+%
% \section{Additions to \pkg{l3fparray}}
%
% \begin{function}[added = 2018-05-05]{\fparray_new:Nn}
@@ -326,22 +335,26 @@
% until reaching the end of the file, stores the \meta{lines} in the
% \meta{tl~var} then applies the \meta{code}. The \meta{code} will
% usually make use of the \meta{variable}, but this is not enforced.
-% The assignments to the \meta{variable} are local. \TeX{} ignores
+% The assignments to the \meta{variable} are local.
+% Its value after the loop is the last set of \meta{lines}, or its
+% original value if the \meta{stream} is empty. \TeX{} ignores
% any trailing new-line marker from the file it reads.
% This function is typically faster than \cs{ior_map_inline:Nn}.
% \end{function}
%
% \begin{function}[added = 2019-01-13]{\ior_str_map_variable:NNn}
% \begin{syntax}
-% \cs{ior_str_map_variable:NNn} \meta{stream} \meta{tl~var} \Arg{code}
+% \cs{ior_str_map_variable:NNn} \meta{stream} \meta{variable} \Arg{code}
% \end{syntax}
% For each \meta{line} in the \meta{stream}, stores the \meta{line} in
-% the \meta{tl~var} then applies the \meta{code}. The material is
+% the \meta{variable} then applies the \meta{code}. The material is
% read from the \meta{stream} as a series of tokens with category code
% $12$ (other), with the exception of space characters which are given
% category code $10$ (space). The \meta{code} will usually make use
% of the \meta{variable}, but this is not enforced. The assignments
-% to the \meta{variable} are local. Note that \TeX{} removes trailing
+% to the \meta{variable} are local. Its value after the loop is the
+% last \meta{line}, or its original value if the \meta{stream} is
+% empty. Note that \TeX{} removes trailing
% space and tab characters (character codes 32 and 9) from every line
% upon input. \TeX{} also ignores any trailing new-line marker from
% the file it reads.
@@ -611,7 +624,7 @@
% \end{texnote}
% \end{function}
%
-% \begin{function}[added = 2017-11-28]
+% \begin{function}[added = 2017-11-28, updated = 2019-08-25]
% {
% \prop_set_from_keyval:Nn, \prop_set_from_keyval:cn,
% \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn,
@@ -624,10 +637,10 @@
% \}
% \end{syntax}
% Sets \meta{prop~var} to contain key--value pairs given in the second
-% argument.
+% argument. If duplicate keys appear only one of the values is kept.
% \end{function}
%
-% \begin{function}[added = 2017-11-28]
+% \begin{function}[added = 2017-11-28, updated = 2019-08-25]
% {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn}
% \begin{syntax}
% \cs{prop_const_from_keyval:Nn} \meta{prop~var}
@@ -639,6 +652,7 @@
% Creates a new constant \meta{prop~var} or raises an error if the
% name is already taken. The \meta{prop~var} is set globally to
% contain key--value pairs given in the second argument.
+% If duplicate keys appear only one of the values is kept.
% \end{function}
%
% \section{Additions to \pkg{l3seq}}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
index bcac2b813ea..fa743396b72 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -401,6 +401,9 @@
%
% The functions described in this section apply a specified function
% to each item of a comma list.
+% All mappings are done at the current group level, \emph{i.e.}~any
+% local assignments made by the \meta{function} or \meta{code} discussed
+% below remain in effect after the loop.
%
% When the comma list is given explicitly, as an \texttt{n}-type argument,
% spaces are trimmed around each item.
@@ -448,7 +451,9 @@
% (token list) \meta{variable} and applies the \meta{code}. The
% \meta{code} will usually make use of the \meta{variable}, but this
% is not enforced. The assignments to the \meta{variable} are local.
-% The \meta{items} are returned from left to right.
+% Its value after the loop is the last \meta{item} in the \meta{comma
+% list}, or its original value if there were no \meta{item}. The
+% \meta{items} are returned from left to right.
% \end{function}
%
% \begin{function}[rEXP, updated = 2012-06-29]{\clist_map_break:}
@@ -1694,6 +1699,8 @@
% additionally we store each item in the given variable.
% As for inline mappings, space trimming for the \texttt{n}
% variant is done by storing the comma list in a variable.
+% The quark test is done before assigning the item to the variable:
+% this avoids storing a quark which the user wouldn't expect.
% The strange \cs{use:n} avoids unlikely problems when |#2| would
% contain \cs{q_recursion_stop}.
% \begin{macrocode}
@@ -1715,8 +1722,8 @@
}
\cs_new_protected:Npn \@@_map_variable:Nnw #1#2#3,
{
+ \quark_if_recursion_tail_stop:n {#3}
\tl_set:Nn #1 {#3}
- \quark_if_recursion_tail_stop:N #1
\use:n {#2}
\@@_map_variable:Nnw #1 {#2}
}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
index aca74650f23..fa54e318251 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx
index 247064bee14..4881aae53ed 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
index 9a229be9c95..50219502b02 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index 58827a110da..9c00e79283b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
@@ -79,7 +79,7 @@ and all files in that bundle must be distributed together.
%
% \title{The \cls{l3doc} class}
% \author{\Team}
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
% \maketitle
% \tableofcontents
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
index b24ee78747b..722ed3f484d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
index 34c38df4836..a8101b0f6c1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
index 334375a07f5..017c9954f70 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -241,6 +241,10 @@
% \end{texnote}
% \end{function}
%
+% All mappings are done at the current group level, \emph{i.e.}~any
+% local assignments made by the \meta{function} or \meta{code} discussed
+% below remain in effect after the loop.
+%
% \begin{function}[added = 2012-02-11]{\ior_map_inline:Nn}
% \begin{syntax}
% \cs{ior_map_inline:Nn} \meta{stream} \Arg{inline function}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
index 9ce9adc05c6..13ad327dbc7 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx
index d2683e35357..7b829b4418d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
index 289f8e837a8..0245f807f79 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
% \maketitle
%
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
index 5784ed97bcf..616cce45f36 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -369,6 +369,20 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[EXP]{\@@_kind:w}
+% Expands to $0$ for zeros, $1$ for normal floating point numbers, $2$
+% for infinities, $3$ for \nan{}, $4$ for tuples.
+% \begin{macrocode}
+\cs_new:Npn \@@_kind:w #1
+ {
+ \@@_if_type_fp:NTwFw
+ #1 \@@_use_ii_until_s:nnw
+ \s_@@ { \@@_use_i_until_s:nw 4 }
+ \q_stop
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Overflow, underflow, and exact zero}
%
%^^A todo: the sign of exact zeros should depend on the rounding mode.
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
index e0929efcf5f..4c0e12ffcf8 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
index da7059822ed..cd545aec517 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
index 2d6a76c40de..72c4020d6c1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
index 90e1b1d79f1..d78a0290385 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
index 01aa7777c8a..c0584cde425 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -83,7 +83,7 @@
% \cs{@@_ternary_auxii:NwwN} have to be understood.
% \end{itemize}
%
-% \subsection{Existence test}
+% \subsection{Tests}
%
% \begin{macro}[pTF]{\fp_if_exist:N, \fp_if_exist:c}
% Copies of the \texttt{cs} functions defined in \pkg{l3basics}.
@@ -93,6 +93,21 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[pTF]{\fp_if_nan:n}
+% Evaluate and check if the result is a floating point of the same
+% kind as \nan{}.
+% \begin{macrocode}
+\prg_new_conditional:Npnn \fp_if_nan:n #1 { TF , T , F , p }
+ {
+ \if:w 3 \exp_last_unbraced:Nf \@@_kind:w { \@@_parse:n {#1} }
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Comparison}
%
% \begin{macro}[pTF, EXP]{\fp_compare:n}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
index 9e2c1bdaf1e..b3d7b32bc85 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
index 5337ccdfd72..9c74c70774c 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
index 5610b11fc4c..9bedd90aab2 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -483,14 +483,26 @@
% \@@_round_special:NwwNnn ,
% \@@_round_special_aux:Nw
% }
+% If the number of digits to round to is an integer or infinity all is
+% good; if it is \texttt{nan} then just produce a \texttt{nan};
+% otherwise invalid as we have something like |round(1,3.14)| where
+% the number of digits is not an integer.
% \begin{macrocode}
\cs_new:Npn \@@_round:Nww #1#2 ; #3 ;
{
\@@_small_int:wTF #3; { \@@_round:Nwn #1#2; }
{
- \@@_invalid_operation_tl_o:ff
- { \@@_round_name_from_cs:N #1 }
- { \@@_array_to_clist:n { #2; #3; } }
+ \if:w 3 \@@_kind:w #3 ;
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ { \exp_after:wN \c_nan_fp }
+ {
+ \@@_invalid_operation_tl_o:ff
+ { \@@_round_name_from_cs:N #1 }
+ { \@@_array_to_clist:n { #2; #3; } }
+ }
}
}
\cs_new:Npn \@@_round:Nwn #1 \s_@@ \@@_chk:w #2#3#4; #5
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
index ff1f77ceeed..aad063f831a 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
% \maketitle
%
% \begin{documentation}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
index d8f4755b30b..085641bafd5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
index f8983540573..a74b27f9006 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -1089,6 +1089,7 @@
% $x$~to $n$~places. If $n$~is an integer, this rounds~$x$ to a
% multiple of~$10^{-n}$; if $n=+\infty$, this always yields~$x$; if
% $n=-\infty$, this yields one of $\pm 0$, $\pm\infty$, or~\nan{}; if
+% $n=\nan{}$, this yields \nan{}; if
% $n$~is neither $\pm\infty$ nor an integer, then an \enquote{invalid
% operation} exception is raised. When \meta{fpexpr_2} is omitted,
% $n=0$, \emph{i.e.}, \meta{fpexpr_1} is rounded to an integer. The
@@ -1096,7 +1097,7 @@
% \begin{itemize}
% \item |round| yields the multiple of~$10^{-n}$ closest to~$x$,
% with ties ($x$ half-way between two such multiples) rounded
-% as follows. If $t$ is \texttt{nan} or not given the even
+% as follows. If $t$ is \texttt{nan} (or not given) the even
% multiple is chosen (\enquote{ties to even}), if $t=\pm 0$ the
% multiple closest to $0$ is chosen (\enquote{ties to zero}),
% if $t$ is positive/negative the multiple closest to $\infty$/$-\infty$ is chosen
@@ -1370,9 +1371,10 @@
% \end{syntax}
% Evaluates the \meta{floating point expression} as described for
% \cs{fp_eval:n} and leaves the absolute value of the result in the
-% input stream. If the argument is a tuple, \enquote{invalid
-% operation} occurs, but no other case raises exceptions. Within
-% floating point expressions, |abs()| can be used.
+% input stream. If the argument is $\pm\infty$, \nan{} or a tuple,
+% \enquote{invalid operation} occurs. Within floating point
+% expressions, |abs()| can be used; it accepts $\pm\infty$ and \nan{}
+% as arguments.
% \end{function}
%
% \begin{function}[EXP, added = 2012-09-26, tested = m3fp-convert003]
@@ -1418,7 +1420,7 @@
% \item Add an |array(1,2,3)| and |i=complex(0,1)|.
% \item Provide an experimental |map| function? Perhaps easier to
% implement if it is a single character, |@sin(1,2)|?
-% \item Provide \cs{fp_if_nan:nTF}, and an |isnan| function?
+% \item Provide an |isnan| function analogue of \cs{fp_if_nan:nTF}?
% \item Support keyword arguments?
% \end{itemize}
% \pkg{Pgfmath} also provides box-measurements (depth, height, width), but
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx
index afafba0ce09..5a80f4cfe04 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
index 544f90cdacc..7c0dd3caec8 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx
index ecdad58fa41..a371b6ee635 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx
index ae7f4ac240c..e8d675eebaa 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
index 2d187d698b5..074ca85b6e3 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx
index f1e24059383..90ca8c5d0e7 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index 3cfa869f020..9557fc8a085 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index 627d61f3039..d005a8131f1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
index e31335e15d9..9f0bc82400e 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
index 211dcfe7dd0..5e4fa7732c0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index 7b0fb5aa39f..d79073065dc 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -339,6 +339,10 @@
%
% \section{Mapping to property lists}
%
+% All mappings are done at the current group level, \emph{i.e.}~any
+% local assignments made by the \meta{function} or \meta{code} discussed
+% below remain in effect after the loop.
+%
% \begin{function}[updated = 2013-01-08, rEXP]
% {\prop_map_function:NN, \prop_map_function:cN}
% \begin{syntax}
@@ -634,6 +638,13 @@
% \end{variable}
% \end{variable}
%
+% \begin{variable}{\l_@@_internal_prop}
+% Property list used by \cs{prop_set_from_keyval:Nn} and others.
+% \begin{macrocode}
+\prop_new:N \l_@@_internal_prop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\prop_set_from_keyval:Nn, \prop_set_from_keyval:cn}
% \begin{macro}{\prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn}
% \begin{macro}{\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn}
@@ -647,69 +658,80 @@
% \@@_from_keyval_value:n,
% \@@_from_keyval_value:w
% }
-% Loop through items separated by commas, with \cs{q_mark} to avoid
-% losing braces. After checking for termination, split the item at
-% the first then at the second |=| (which ought to be the first of the
-% trailing~|=|). At both splits, trim spaces and
-% call \cs{@@_from_keyval_key:w}, then \cs{@@_from_keyval_value:w},
-% followed by the trimmed material, \cs{q_nil}, the subsequent part of
-% the item, and the trailing |=|'s and \cs{q_stop}. After finding the
-% \meta{key} just store it after \cs{q_stop}. After finding the
-% \meta{value} ignore completely empty items (both trailing~|=| were
-% used as delimiters and all parts are empty); if the remaining
-% part~|#2| consists exactly of the second trailing~|=| (namely there
-% was exactly one |=|~in the item) then output one key--value pair for
-% the property list; otherwise complain about a missing or extra~|=|.
+% To avoid tracking throughout the loop the variable name and whether
+% the assignment is local/global, do everything in a scratch variable
+% and empty it afterwards to avoid wasting memory. Loop through items
+% separated by commas, with \cs{prg_do_nothing:} to avoid losing
+% braces. After checking for termination, split the item at the first
+% and then at the second |=| (which ought to be the first of the
+% trailing~|=| that we added). For both splits trim spaces and call a
+% function (first \cs{@@_from_keyval_key:w} then
+% \cs{@@_from_keyval_value:w}), followed by the trimmed material,
+% \cs{q_nil}, the subsequent part of the item, and the trailing |=|'s
+% and \cs{q_stop}. After finding the \meta{key} just store it after
+% \cs{q_stop}. After finding the \meta{value} ignore completely empty
+% items (both trailing~|=| were used as delimiters and all parts are
+% empty); if the remaining part~|#2| consists exactly of the second
+% trailing~|=| (namely there was exactly one |=|~in the item) then
+% output one key--value pair for the property list; otherwise complain
+% about a missing or extra~|=|.
% \begin{macrocode}
\cs_new_protected:Npn \prop_set_from_keyval:Nn #1#2
- { \tl_set:Nx #1 { \@@_from_keyval:n {#2} } }
+ {
+ \prop_clear:N \l_@@_internal_prop
+ \@@_from_keyval:n {#2}
+ \prop_set_eq:NN #1 \l_@@_internal_prop
+ \prop_clear:N \l_@@_internal_prop
+ }
\cs_generate_variant:Nn \prop_set_from_keyval:Nn { c }
\cs_new_protected:Npn \prop_gset_from_keyval:Nn #1#2
- { \tl_gset:Nx #1 { \@@_from_keyval:n {#2} } }
+ {
+ \prop_clear:N \l_@@_internal_prop
+ \@@_from_keyval:n {#2}
+ \prop_gset_eq:NN #1 \l_@@_internal_prop
+ \prop_clear:N \l_@@_internal_prop
+ }
\cs_generate_variant:Nn \prop_gset_from_keyval:Nn { c }
\cs_new_protected:Npn \prop_const_from_keyval:Nn #1#2
- { \tl_const:Nx #1 { \@@_from_keyval:n {#2} } }
+ {
+ \prop_clear:N \l_@@_internal_prop
+ \@@_from_keyval:n {#2}
+ \tl_const:Nx #1 { \exp_not:o \l_@@_internal_prop }
+ \prop_clear:N \l_@@_internal_prop
+ }
\cs_generate_variant:Nn \prop_const_from_keyval:Nn { c }
-\cs_new:Npn \@@_from_keyval:n #1
+\cs_new_protected:Npn \@@_from_keyval:n #1
{
- \s_@@
- \@@_from_keyval_loop:w \q_mark #1 ,
+ \@@_from_keyval_loop:w \prg_do_nothing: #1 ,
\q_recursion_tail , \q_recursion_stop
}
-\cs_new:Npn \@@_from_keyval_loop:w #1 ,
+\cs_new_protected:Npn \@@_from_keyval_loop:w #1 ,
{
- \quark_if_recursion_tail_stop:o { \use_none:n #1 }
+ \quark_if_recursion_tail_stop:o {#1}
\@@_from_keyval_split:Nw \@@_from_keyval_key:n
- #1 = = \q_stop { \use_none:n #1 }
- \@@_from_keyval_loop:w \q_mark
+ #1 = = \q_stop {#1}
+ \@@_from_keyval_loop:w \prg_do_nothing:
}
-\cs_new:Npn \@@_from_keyval_split:Nw #1#2 =
- {
- \tl_trim_spaces_apply:oN { \use_none:n #2 } #1
- \q_nil
- }
-\cs_new:Npn \@@_from_keyval_key:n #1
- { \@@_from_keyval_key:w #1 }
-\cs_new:Npn \@@_from_keyval_key:w #1 \q_nil #2 \q_stop
+\cs_new_protected:Npn \@@_from_keyval_split:Nw #1#2 =
+ { \tl_trim_spaces_apply:oN {#2} #1 }
+\cs_new_protected:Npn \@@_from_keyval_key:n #1
+ { \@@_from_keyval_key:w #1 \q_nil }
+\cs_new_protected:Npn \@@_from_keyval_key:w #1 \q_nil #2 \q_stop
{
\@@_from_keyval_split:Nw \@@_from_keyval_value:n
- \q_mark #2 \q_stop {#1}
+ \prg_do_nothing: #2 \q_stop {#1}
}
-\cs_new:Npn \@@_from_keyval_value:n #1
- { \@@_from_keyval_value:w #1 }
-\cs_new:Npn \@@_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4
+\cs_new_protected:Npn \@@_from_keyval_value:n #1
+ { \@@_from_keyval_value:w #1 \q_nil }
+\cs_new_protected:Npn \@@_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4
{
\tl_if_empty:nF { #3 #1 #2 }
{
\str_if_eq:nnTF {#2} { = }
+ { \prop_put:Nnn \l_@@_internal_prop {#3} {#1} }
{
- \exp_not:N \@@_pair:wn \tl_to_str:n {#3}
- \s_@@ { \exp_not:n {#1} }
- }
- {
- \__kernel_msg_expandable_error:nnf
- { kernel } { prop-keyval }
- { \exp_after:wN \exp_stop_f: #4 }
+ \__kernel_msg_error:nnx { kernel } { prop-keyval }
+ { \exp_not:o {#4} }
}
}
}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
index 4828431c13c..9ef207f3462 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx
index db5b3030412..f4f3fb1ddd5 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 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
index 9b57df58637..2a0083bd6af 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -486,6 +486,10 @@
%
% \section{Mapping to sequences}
%
+% All mappings are done at the current group level, \emph{i.e.}~any
+% local assignments made by the \meta{function} or \meta{code} discussed
+% below remain in effect after the loop.
+%
% \begin{function}[rEXP, updated = 2012-06-29]
% {\seq_map_function:NN, \seq_map_function:cN}
% \begin{syntax}
@@ -521,7 +525,9 @@
% Stores each \meta{item} of the \meta{sequence} in turn in the (token
% list) \meta{variable} and applies the \meta{code}. The \meta{code}
% will usually make use of the \meta{variable}, but this is not
-% enforced. The assignments to the \meta{variable} are local. The
+% enforced. The assignments to the \meta{variable} are local. Its
+% value after the loop is the last \meta{item} in the \meta{sequence},
+% or its original value if the \meta{sequence} is empty. The
% \meta{items} are returned from left to right.
% \end{function}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index 2dc86854f70..7f086805832 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx
index 90debbc4743..ddff3a85835 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx
index 56271d4fdd1..1343955f7a4 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
index 437ca6caa05..32dd203cfc4 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -401,6 +401,10 @@
%
% \section{Mapping to strings}
%
+% All mappings are done at the current group level, \emph{i.e.}~any
+% local assignments made by the \meta{function} or \meta{code} discussed
+% below remain in effect after the loop.
+%
% \begin{function}[added = 2017-11-14, rEXP]
% {\str_map_function:NN, \str_map_function:cN}
% \begin{syntax}
@@ -454,7 +458,9 @@
% in turn in the (string or token list) \meta{variable} and applies
% the \meta{code}. The \meta{code} will usually make use of the
% \meta{variable}, but this is not enforced. The assignments to the
-% \meta{variable} are local. See also \cs{str_map_inline:Nn}.
+% \meta{variable} are local. Its value after the loop is the last
+% \meta{character} in the \meta{string}, or its original value if the
+% \meta{string} is empty. See also \cs{str_map_inline:Nn}.
% \end{function}
%
% \begin{function}[added = 2017-11-14]
@@ -467,7 +473,9 @@
% the (string or token list) \meta{variable} and applies the
% \meta{code}. The \meta{code} will usually make use of the
% \meta{variable}, but this is not enforced. The assignments to the
-% \meta{variable} are local. See also \cs{str_map_inline:Nn}.
+% \meta{variable} are local. Its value after the loop is the last
+% \meta{character} in the \meta{string}, or its original value if the
+% \meta{string} is empty. See also \cs{str_map_inline:Nn}.
% \end{function}
%
% \begin{function}[added = 2017-10-08, rEXP]{\str_map_break:}
@@ -1275,6 +1283,10 @@
% times speed up by testing only every $9$-th character for whether it
% is \cs{q_recursion_tail} (also by converting $9$ spaces at a time in
% the \cs{str_map_function:nN} case).
+%
+% For the \texttt{map_variable} functions we use a string assignment
+% to store each character because spaces are made catcode~$12$ before
+% the loop.
% \begin{macrocode}
\cs_new:Npn \str_map_function:nN #1#2
{
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
index d27f71cdf4d..149c5771882 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx
index d75531e26ea..02e08827b44 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -88,6 +88,9 @@
% parameter, 7: superscript, 8: subscript, A: space, B: letter,
% C:other, D:active).
% \end{itemize}
+% As all other mappings the mapping is done at the current group
+% level, \emph{i.e.}~any local assignments made by the \meta{inline
+% function} remain in effect after the loop.
% \end{function}
%
% \end{documentation}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index cb617cc5a25..77444e6d13c 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
@@ -505,6 +505,10 @@
%
% \section{Mapping to token lists}
%
+% All mappings are done at the current group level, \emph{i.e.}~any
+% local assignments made by the \meta{function} or \meta{code} discussed
+% below remain in effect after the loop.
+%
% \begin{function}[updated = 2012-06-29, rEXP]
% {\tl_map_function:NN, \tl_map_function:cN}
% \begin{syntax}
@@ -555,8 +559,10 @@
% Stores each \meta{item} of the \meta{tl~var} in turn in the (token
% list) \meta{variable} and applies the \meta{code}. The \meta{code}
% will usually make use of the \meta{variable}, but this is not
-% enforced. The assignments to the \meta{variable} are local. See
-% also \cs{tl_map_inline:Nn}.
+% enforced. The assignments to the \meta{variable} are local. Its
+% value after the loop is the last \meta{item} in the \meta{tl~var},
+% or its original value if the \meta{tl~var} is blank. See also
+% \cs{tl_map_inline:Nn}.
% \end{function}
%
% \begin{function}[updated = 2012-06-29]{\tl_map_variable:nNn}
@@ -567,6 +573,8 @@
% (token list) \meta{variable} and applies the \meta{code}. The
% \meta{code} will usually make use of the \meta{variable}, but this
% is not enforced. The assignments to the \meta{variable} are local.
+% Its value after the loop is the last \meta{item} in the
+% \meta{tl~var}, or its original value if the \meta{tl~var} is blank.
% See also \cs{tl_map_inline:nn}.
% \end{function}
%
@@ -1558,12 +1566,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 +1583,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 +1597,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 +1617,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 +1641,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 +1666,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 +1690,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 +1732,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 +1745,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}
%
@@ -2379,9 +2411,10 @@
% \begin{macro}{\tl_map_variable:nNn}
% \begin{macro}{\tl_map_variable:NNn, \tl_map_variable:cNn}
% \begin{macro}{\@@_map_variable:Nnn}
-% \cs{tl_map_variable:nNn} \meta{token list} \meta{temp} \meta{action}
-% assigns
-% \meta{temp} to each element and executes \meta{action}.
+% \cs{tl_map_variable:nNn} \meta{token list} \meta{tl~var}
+% \meta{action} assigns \meta{tl~var} to each element and executes
+% \meta{action}. The assignment to \meta{tl~var} is done after the
+% quark test so that this variable does not get set to a quark.
% \begin{macrocode}
\cs_new_protected:Npn \tl_map_variable:nNn #1#2#3
{
@@ -2393,8 +2426,8 @@
{ \exp_args:No \tl_map_variable:nNn }
\cs_new_protected:Npn \@@_map_variable:Nnn #1#2#3
{
+ \quark_if_recursion_tail_break:nN {#3} \tl_map_break:
\tl_set:Nn #1 {#3}
- \quark_if_recursion_tail_break:NN #1 \tl_map_break:
\use:n {#2}
\@@_map_variable:Nnn #1 {#2}
}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
index 55f271526f1..9b9946a4f8c 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx
index 4e278331559..fbaa4659352 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-08-14}
+% \date{Released 2019-08-25}
%
% \maketitle
%