[latex3-commits] [git/LaTeX3-latex3-latex3] master: Split 'set from file' function internals (0886e71)
Unknown
joseph.wright at morningstar2.co.uk
Sun Jul 22 16:48:29 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/0886e716a0f531ecf0c7079112915a644189f9df
>---------------------------------------------------------------
commit 0886e716a0f531ecf0c7079112915a644189f9df
Author: Unknown <joseph.wright at morningstar2.co.uk>
Date: Sun Jul 22 15:48:29 2018 +0100
Split 'set from file' function internals
This will help with piped input.
>---------------------------------------------------------------
0886e716a0f531ecf0c7079112915a644189f9df
l3kernel/l3candidates.dtx | 51 +++++++++++++++++++++----------
l3kernel/testfiles/m3expl001.luatex.tlg | 2 ++
l3kernel/testfiles/m3expl001.ptex.tlg | 2 ++
l3kernel/testfiles/m3expl001.tlg | 2 ++
l3kernel/testfiles/m3expl001.uptex.tlg | 2 ++
l3kernel/testfiles/m3expl001.xetex.tlg | 2 ++
l3kernel/testfiles/m3expl003.luatex.tlg | 2 ++
l3kernel/testfiles/m3expl003.ptex.tlg | 2 ++
l3kernel/testfiles/m3expl003.tlg | 2 ++
l3kernel/testfiles/m3expl003.uptex.tlg | 2 ++
l3kernel/testfiles/m3expl003.xetex.tlg | 2 ++
11 files changed, 55 insertions(+), 16 deletions(-)
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 029c37a..bfd7182 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -3035,6 +3035,7 @@
% }
% \begin{macro}{\@@_set_from_file:NNnn}
% \begin{macro}{\@@_from_file_do:w}
+% \begin{macro}{\@@_set_from_:nNNn}
% The approach here is similar to that for doing a rescan, and so the same
% internals can be reused. Thus the plan is to insert a pair of tokens of
% the same charcode but different catcodes after the file has been read.
@@ -3053,25 +3054,32 @@
\str_if_empty:NTF \l_@@_file_name_str
{ \__kernel_file_missing:n {#4} }
{
- \group_begin:
- \exp_args:No \tex_everyeof:D
- { \c_@@_rescan_marker_tl \exp_not:N }
- #3 \scan_stop:
- \exp_after:wN \@@_from_file_do:w
- \exp_after:wN \prg_do_nothing:
- \tex_input:D \l_@@_file_name_str \scan_stop:
- \exp_args:NNNo \group_end:
- #1 #2 \l_@@_internal_a_tl
+ \exp_args:NV \@@_set_from:nNNn
+ \l_@@_file_name_str
+ #1 #2 {#3}
}
}
\exp_args:Nno \use:nn
{ \cs_new_protected:Npn \@@_from_file_do:w #1 }
{ \c_@@_rescan_marker_tl }
{ \tl_set:No \l_@@_internal_a_tl {#1} }
+\cs_new_protected:Npn \@@_set_from:nNNn #1#2#3#4
+ {
+ \group_begin:
+ \exp_args:No \tex_everyeof:D
+ { \c_@@_rescan_marker_tl \exp_not:N }
+ #4 \scan_stop:
+ \exp_after:wN \@@_from_file_do:w
+ \exp_after:wN \prg_do_nothing:
+ \tex_input:D #1 \scan_stop:
+ \exp_args:NNNo \group_end:
+ #2 #3 \l_@@_internal_a_tl
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {
@@ -3079,6 +3087,7 @@
% \tl_gset_from_file_x:Nnn, \tl_gset_from_file_x:cnn
% }
% \begin{macro}{\@@_set_from_file_x:NNnn}
+% \begin{macro}{\@@_set_from_x:nNNn}
% When reading a file and allowing expansion of the content, the set up
% only needs to prevent \TeX{} complaining about the end of the file. That
% is done simply, with a group then used to trap the definition needed.
@@ -3097,24 +3106,34 @@
\str_if_empty:NTF \l_@@_file_name_str
{ \__kernel_file_missing:n {#4} }
{
- \group_begin:
- \tex_everyeof:D { \exp_not:N }
- #3 \scan_stop:
- \tl_set:Nx \l_@@_internal_a_tl
- { \tex_input:D \l_@@_file_name_str \c_space_token }
- \exp_args:NNNo \group_end:
- #1 #2 \l_@@_internal_a_tl
+ \exp_args:NV \@@_set_from_x:nNNn
+ \l_@@_file_name_str
+ #1 #2 {#3}
}
}
+\cs_new_protected:Npn \@@_set_from_x:nNNn #1#2#3#4
+ {
+ \group_begin:
+ \tex_everyeof:D { \exp_not:N }
+ #4 \scan_stop:
+ \tl_set:Nx \l_@@_internal_a_tl
+ { \tex_input:D #1 \c_space_token }
+ \exp_args:NNNo \group_end:
+ #2 #3 \l_@@_internal_a_tl
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
% \begin{variable}{\l_@@_file_name_str}
% \begin{macrocode}
\str_new:N \l_@@_file_name_str
% \end{macrocode}
% \end{variable}
%
+% \begin{macrocode}
+% \end{macrocode}
+%
% \subsubsection{Unicode case changing}
%
% The mechanisms needed for case changing are somewhat involved, particularly
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index d1600a2..5614f13 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5858,11 +5858,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index d819211..27a94ab 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5892,11 +5892,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index e5ed5da..3d075d5 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5892,11 +5892,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index b13c2ce..8d0dc04 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5889,11 +5889,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 327b924..8ea9770 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5862,11 +5862,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index d1600a2..5614f13 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5858,11 +5858,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index d819211..27a94ab 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5892,11 +5892,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index e5ed5da..3d075d5 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5892,11 +5892,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index b13c2ce..8d0dc04 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5889,11 +5889,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 327b924..8ea9770 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5862,11 +5862,13 @@ Defining \tl_set_from_file:cnn on line ...
Defining \tl_gset_from_file:cnn on line ...
Defining \__tl_set_from_file:NNnn on line ...
Defining \__tl_from_file_do:w on line ...
+Defining \__tl_set_from:nNNn on line ...
Defining \tl_set_from_file_x:Nnn on line ...
Defining \tl_gset_from_file_x:Nnn on line ...
Defining \tl_set_from_file_x:cnn on line ...
Defining \tl_gset_from_file_x:cnn on line ...
Defining \__tl_set_from_file_x:NNnn on line ...
+Defining \__tl_set_from_x:nNNn on line ...
Defining \l__tl_file_name_str on line ...
Defining \char_lower_case:N on line ...
Defining \char_upper_case:N on line ...
More information about the latex3-commits
mailing list