[latex3-commits] [git/latex3] master: Add temporary variables for regex, ior, iow (fixes #429) (74f01c6)
Bruno Le Floch
bruno at le-floch.fr
Tue Dec 12 04:38:27 CET 2017
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/74f01c60fe4e94f3663cd977d7abec99c5397cde
>---------------------------------------------------------------
commit 74f01c60fe4e94f3663cd977d7abec99c5397cde
Author: Bruno Le Floch <bruno at le-floch.fr>
Date: Mon Dec 11 22:38:27 2017 -0500
Add temporary variables for regex, ior, iow (fixes #429)
I checked that these are the only datatypes in l3kernel for which
temporary variables could make sense and that did not have them.
Excluded are things like quark, msg, flag and maybe a couple others.
>---------------------------------------------------------------
74f01c60fe4e94f3663cd977d7abec99c5397cde
l3kernel/l3file.dtx | 32 ++++++++++++++++++++++++++++++-
l3kernel/l3regex.dtx | 26 +++++++++++++++++++++++++
l3kernel/testfiles/m3expl001.luatex.tlg | 8 ++++++++
l3kernel/testfiles/m3expl001.ptex.tlg | 8 ++++++++
l3kernel/testfiles/m3expl001.tlg | 8 ++++++++
l3kernel/testfiles/m3expl001.uptex.tlg | 8 ++++++++
l3kernel/testfiles/m3expl001.xetex.tlg | 8 ++++++++
l3kernel/testfiles/m3expl003.luatex.tlg | 8 ++++++++
l3kernel/testfiles/m3expl003.ptex.tlg | 8 ++++++++
l3kernel/testfiles/m3expl003.tlg | 8 ++++++++
l3kernel/testfiles/m3expl003.uptex.tlg | 8 ++++++++
l3kernel/testfiles/m3expl003.xetex.tlg | 8 ++++++++
12 files changed, 137 insertions(+), 1 deletion(-)
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index acf8868..59c93bb 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -600,7 +600,7 @@
% and MiK\TeX{} systems.
% \end{variable}
%
-% \subsection{Constant input--output streams}
+% \subsection{Constant input--output streams, and variables}
%
% \begin{variable}{\c_term_ior}
% Constant input stream for reading from the terminal. Reading from this
@@ -611,11 +611,25 @@
% \end{verbatim}
% \end{variable}
%
+% \begin{variable}[added = 2017-12-11]{\g_tmpa_ior, \g_tmpb_ior}
+% Scratch input stream for global use. These are never used by
+% the kernel code, and so are safe for use with any \LaTeX3-defined
+% function. However, they may be overwritten by other non-kernel
+% code and so should only be used for short-term storage.
+% \end{variable}
+%
% \begin{variable}{\c_log_iow, \c_term_iow}
% Constant output streams for writing to the log and to the terminal
% (plus the log), respectively.
% \end{variable}
%
+% \begin{variable}[added = 2017-12-11]{\g_tmpa_iow, \g_tmpb_iow}
+% Scratch output stream for global use. These are never used by
+% the kernel code, and so are safe for use with any \LaTeX3-defined
+% function. However, they may be overwritten by other non-kernel
+% code and so should only be used for short-term storage.
+% \end{variable}
+%
% \subsection{Primitive conditionals}
%
% \begin{function}[EXP]{\if_eof:w}
@@ -1216,6 +1230,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\g_tmpa_ior, \g_tmpb_ior}
+% The usual scratch space.
+% \begin{macrocode}
+\ior_new:N \g_tmpa_ior
+\ior_new:N \g_tmpb_ior
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\ior_open:Nn, \ior_open:cn}
% Use the conditional version, with an error if the file is not found.
% \begin{macrocode}
@@ -1558,6 +1580,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\g_tmpa_iow, \g_tmpb_iow}
+% The usual scratch space.
+% \begin{macrocode}
+\iow_new:N \g_tmpa_iow
+\iow_new:N \g_tmpb_iow
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\@@_new:N}
% As for read streams, copy \tn{newwrite} in package mode, making sure
% that it is not \tn{outer}.
diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 80aa7a2..41b3102 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -663,6 +663,22 @@
% locally to \meta{tl~var}.
% \end{function}
%
+% \subsection{Constants and variables}
+%
+% \begin{variable}[added = 2017-12-11]{\l_tmpa_regex, \l_tmpb_regex}
+% Scratch regex for local assignment. These are never used by
+% the kernel code, and so are safe for use with any \LaTeX3-defined
+% function. However, they may be overwritten by other non-kernel
+% code and so should only be used for short-term storage.
+% \end{variable}
+%
+% \begin{variable}[added = 2017-12-11]{\g_tmpa_regex, \g_tmpb_regex}
+% Scratch regex for global assignment. These are never used by
+% the kernel code, and so are safe for use with any \LaTeX3-defined
+% function. However, they may be overwritten by other non-kernel
+% code and so should only be used for short-term storage.
+% \end{variable}
+%
% \subsection{Bugs, misfeatures, future work, and other possibilities}
%
% The following need to be done now.
@@ -5587,6 +5603,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\l_tmpa_regex, \l_tmpb_regex, \g_tmpa_regex, \g_tmpb_regex}
+% The usual scratch space.
+% \begin{macrocode}
+\regex_new:N \l_tmpa_regex
+\regex_new:N \l_tmpb_regex
+\regex_new:N \g_tmpa_regex
+\regex_new:N \g_tmpb_regex
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\regex_set:Nn, \regex_gset:Nn, \regex_const:Nn}
% Compile, then store the result in the user variable with the
% appropriate assignment function.
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 7ddbe9e..f1d9026 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2975,6 +2975,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3016,6 +3018,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4939,6 +4943,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 38682a0..bd7025b 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -2963,6 +2963,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3004,6 +3006,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4929,6 +4933,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index a272626..e148e06 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -2963,6 +2963,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3004,6 +3006,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4929,6 +4933,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 9643152..f844d07 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -2963,6 +2963,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3004,6 +3006,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4927,6 +4931,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 65cf462..cdc9d10 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2973,6 +2973,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3014,6 +3016,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4917,6 +4921,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 7ddbe9e..f1d9026 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2975,6 +2975,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3016,6 +3018,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4939,6 +4943,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 38682a0..bd7025b 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -2963,6 +2963,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3004,6 +3006,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4929,6 +4933,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index a272626..e148e06 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -2963,6 +2963,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3004,6 +3006,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4929,6 +4933,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 9643152..f844d07 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -2963,6 +2963,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3004,6 +3006,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4927,6 +4931,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 65cf462..cdc9d10 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2973,6 +2973,8 @@ Defining \l__ior_stream_tl on line ...
Defining \g__ior_streams_prop on line ...
Defining \ior_new:N on line ...
Defining \ior_new:c on line ...
+Defining \g_tmpa_ior on line ...
+Defining \g_tmpb_ior on line ...
Defining \ior_open:Nn on line ...
Defining \ior_open:cn on line ...
Defining \ior_open:NnT on line ...
@@ -3014,6 +3016,8 @@ Defining \l__iow_stream_tl on line ...
Defining \g__iow_streams_prop on line ...
Defining \iow_new:N on line ...
Defining \iow_new:c on line ...
+Defining \g_tmpa_iow on line ...
+Defining \g_tmpb_iow on line ...
Defining \__iow_new:N on line ...
Defining \iow_open:Nn on line ...
Defining \iow_open:cn on line ...
@@ -4917,6 +4921,10 @@ Defining \__regex_replacement_c_T:w on line ...
Defining \__regex_replacement_c_U:w on line ...
Defining \__regex_replacement_error:NNN on line ...
Defining \regex_new:N on line ...
+Defining \l_tmpa_regex on line ...
+Defining \l_tmpb_regex on line ...
+Defining \g_tmpa_regex on line ...
+Defining \g_tmpb_regex on line ...
Defining \regex_set:Nn on line ...
Defining \regex_gset:Nn on line ...
Defining \regex_const:Nn on line ...
More information about the latex3-commits
mailing list