summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3file.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3file.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3file.dtx160
1 files changed, 113 insertions, 47 deletions
diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx
index a3e398c2e8..c816d771fb 100644
--- a/macros/latex/contrib/l3kernel/l3file.dtx
+++ b/macros/latex/contrib/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1420,6 +1420,30 @@
% \end{macrocode}
% \end{variable}
%
+% \subsubsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_s_stop:nw}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_nil}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Stream management}
%
% \begin{macro}{\iow_new:N, \iow_new:c}
@@ -1912,15 +1936,15 @@
\tl_set:Nx \l_@@_wrap_tl
{
\exp_after:wN \@@_wrap_fix_newline:w \l_@@_wrap_tl
- ^^J \q_nil ^^J \q_stop
+ ^^J \q_@@_nil ^^J \s_@@_stop
}
\exp_after:wN \@@_wrap_start:w \l_@@_wrap_tl
}
\cs_new:Npn \@@_wrap_fix_newline:w #1 ^^J #2 ^^J
{
#1
- \if_meaning:w \q_nil #2
- \use_i_delimit_by_q_stop:nw
+ \if_meaning:w \q_@@_nil #2
+ \@@_use_i_delimit_by_s_stop:nw
\fi:
\c_@@_wrap_newline_marker_tl
\@@_wrap_fix_newline:w #2 ^^J
@@ -1970,7 +1994,7 @@
}
{ \@@_wrap_line:nw { } ##1 ; }
##2 #1
- \@@_wrap_end_chunk:w 7 6 5 4 3 2 1 0 \q_stop
+ \@@_wrap_end_chunk:w 7 6 5 4 3 2 1 0 \s_@@_stop
}
}
\cs_new_protected:Npn \@@_wrap_next:nw ##1##2 #1
@@ -2066,7 +2090,7 @@
\@@_wrap_next_line:w
}
\cs_new:Npn \@@_wrap_end_chunk:w
- #1 \int_eval:w #2 - #3 ; #4#5 \q_stop
+ #1 \int_eval:w #2 - #3 ; #4#5 \s_@@_stop
{
\if_false: { \fi: }
\exp_args:Nf \@@_wrap_next:nw { \int_eval:n { #2 - #4 } }
@@ -2111,14 +2135,14 @@
\l_@@_line_part_tl
#1
{ ? \@@_wrap_break_end:w }
- \q_mark
+ \s_@@_mark
}
\cs_new:Npn \@@_wrap_break_first:w ##1 #1 ##2
{
\use_none:nn ##2 \@@_wrap_break_none:w
\@@_wrap_break_loop:w ##1 #1 ##2
}
- \cs_new:Npn \@@_wrap_break_none:w ##1##2 #1 ##3 \q_mark ##4 #1
+ \cs_new:Npn \@@_wrap_break_none:w ##1##2 #1 ##3 \s_@@_mark ##4 #1
{
\tl_if_empty:NTF \l_@@_line_tl
{ ##2 ##4 \@@_wrap_line_end:nw { } }
@@ -2130,7 +2154,7 @@
##1 #1
\@@_wrap_break_loop:w ##2 #1 ##3
}
- \cs_new:Npn \@@_wrap_break_end:w ##1 #1 ##2 ##3 #1 ##4 \q_mark
+ \cs_new:Npn \@@_wrap_break_end:w ##1 #1 ##2 ##3 #1 ##4 \s_@@_mark
{ ##1 \@@_wrap_line_end:nw { } ##3 }
}
\exp_args:NV \@@_tmp:w \c_catcode_other_space_tl
@@ -2144,7 +2168,7 @@
% call \cs{@@_wrap_line:nw} to find characters for the next line
% (remembering to account for the indentation).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_wrap_next_line:w #1#2 \q_stop
+\cs_new_protected:Npn \@@_wrap_next_line:w #1#2 \s_@@_stop
{
\tl_clear:N \l_@@_line_tl
\token_if_eq_meaning:NNTF #1 \@@_wrap_end_chunk:w
@@ -2157,7 +2181,7 @@
\@@_wrap_line:nw
{ \l_@@_indent_tl }
\l_@@_line_target_int - \l_@@_indent_int ;
- #1 #2 \q_stop
+ #1 #2 \s_@@_stop
}
}
% \end{macrocode}
@@ -2262,10 +2286,10 @@
\cs_set_protected:Npn \@@_tmp:w #1
{
\cs_new:Npn \@@_wrap_trim:N ##1
- { \exp_after:wN \@@_wrap_trim:w ##1 \q_mark #1 \q_mark \q_stop }
- \cs_new:Npn \@@_wrap_trim:w ##1 #1 \q_mark
- { \@@_wrap_trim_aux:w ##1 \q_mark }
- \cs_new:Npn \@@_wrap_trim_aux:w ##1 \q_mark ##2 \q_stop {##1}
+ { \exp_after:wN \@@_wrap_trim:w ##1 \s_@@_mark #1 \s_@@_mark \s_@@_stop }
+ \cs_new:Npn \@@_wrap_trim:w ##1 #1 \s_@@_mark
+ { \@@_wrap_trim_aux:w ##1 \s_@@_mark }
+ \cs_new:Npn \@@_wrap_trim_aux:w ##1 \s_@@_mark ##2 \s_@@_stop {##1}
}
\exp_args:NV \@@_tmp:w \c_catcode_other_space_tl
% \end{macrocode}
@@ -2314,12 +2338,12 @@
{
\tl_if_blank:nTF {#1}
{
- \cs_set:Npn \@@_tmp:w ##1 " ##2 " ##3 \q_stop
+ \cs_set:Npn \@@_tmp:w ##1 " ##2 " ##3 \s_@@_stop
{ { } {##2} { } }
\seq_gput_right:Nx \g_@@_stack_seq
{
\exp_after:wN \@@_tmp:w \tex_jobname:D
- " \tex_jobname:D " \q_stop
+ " \tex_jobname:D " \s_@@_stop
}
}
{
@@ -2389,6 +2413,48 @@
% \end{macrocode}
% \end{variable}
%
+% \subsubsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_nil}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[pTF]{\@@_quark_if_nil:n}
+% Branching quark conditional.
+% \begin{macrocode}
+\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:n { TF }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{
+% \@@_if_recursion_tail_break:NN,
+% \@@_if_recursion_tail_stop_do:Nn
+% }
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:nn
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[EXP]{\__kernel_file_name_sanitize:n}
% \begin{macro}[EXP]{\__kernel_file_name_expand_loop:w}
% \begin{macro}[EXP]{\__kernel_file_name_expand_N_type:Nw}
@@ -2413,11 +2479,11 @@
\exp_args:Ne \__kernel_file_name_strip_quotes:n
{
\__kernel_file_name_expand_loop:w #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
}
}
-\cs_new:Npn \__kernel_file_name_expand_loop:w #1 \q_recursion_stop
+\cs_new:Npn \__kernel_file_name_expand_loop:w #1 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#1}
{ \__kernel_file_name_expand_N_type:Nw }
@@ -2426,11 +2492,11 @@
{ \__kernel_file_name_expand_group:nw }
{ \__kernel_file_name_expand_space:w }
}
- #1 \q_recursion_stop
+ #1 \q_@@_recursion_stop
}
\cs_new:Npn \__kernel_file_name_expand_N_type:Nw #1
{
- \quark_if_recursion_tail_stop:N #1
+ \@@_if_recursion_tail_stop:N #1
\bool_lazy_and:nnTF
{ \token_if_expandable_p:N #1 }
{
@@ -2470,11 +2536,11 @@
\cs_new:Npn \__kernel_file_name_strip_quotes:n #1
{
\__kernel_file_name_strip_quotes:nnnw {#1} { 0 } { }
- #1 " \q_recursion_tail " \q_recursion_stop
+ #1 " \q_@@_recursion_tail " \q_@@_recursion_stop
}
\cs_new:Npn \__kernel_file_name_strip_quotes:nnnw #1#2#3#4 "
{
- \quark_if_recursion_tail_stop_do:nn {#4}
+ \@@_if_recursion_tail_stop_do:nn {#4}
{ \__kernel_file_name_strip_quotes:nnn {#1} {#2} {#3} }
\__kernel_file_name_strip_quotes:nnnw {#1} { #2 + 1 } { #3#4 }
}
@@ -2495,19 +2561,19 @@
% removed at the end.
% \begin{macrocode}
\cs_new:Npn \__kernel_file_name_trim_spaces:n #1
- { \__kernel_file_name_trim_spaces:nw {#1} #1 . \q_nil . \q_stop }
-\cs_new:Npn \__kernel_file_name_trim_spaces:nw #1#2 . #3 . #4 \q_stop
+ { \__kernel_file_name_trim_spaces:nw {#1} #1 . \q_@@_nil . \s_@@_stop }
+\cs_new:Npn \__kernel_file_name_trim_spaces:nw #1#2 . #3 . #4 \s_@@_stop
{
- \quark_if_nil:nTF {#3}
+ \@@_quark_if_nil:nTF {#3}
{
\exp_args:Ne \__kernel_file_name_trim_spaces_aux:n
- { \tl_trim_spaces:n { #1 \s_stop } }
+ { \tl_trim_spaces:n { #1 \s_@@_stop } }
}
{ \tl_trim_spaces:n {#1} }
}
\cs_new:Npn \__kernel_file_name_trim_spaces_aux:n #1
{ \__kernel_file_name_trim_spaces_aux:w #1 }
-\cs_new:Npn \__kernel_file_name_trim_spaces_aux:w #1 \s_stop {#1}
+\cs_new:Npn \__kernel_file_name_trim_spaces_aux:w #1 \s_@@_stop {#1}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2526,10 +2592,10 @@
% \begin{macro}[EXP]{\__kernel_file_name_quote:nw}
% \begin{macrocode}
\cs_new:Npn \__kernel_file_name_quote:n #1
- { \__kernel_file_name_quote:nw {#1} #1 ~ \q_nil \q_stop }
-\cs_new:Npn \__kernel_file_name_quote:nw #1 #2 ~ #3 \q_stop
+ { \__kernel_file_name_quote:nw {#1} #1 ~ \q_@@_nil \s_@@_stop }
+\cs_new:Npn \__kernel_file_name_quote:nw #1 #2 ~ #3 \s_@@_stop
{
- \quark_if_nil:nTF {#3}
+ \@@_quark_if_nil:nTF {#3}
{ #1 }
{ "#1" }
}
@@ -2686,19 +2752,19 @@
% directory part, saving that. Then check for an extension.
% \begin{macrocode}
\cs_new:Npn \@@_ext_check:n #1
- { \@@_ext_check:nw { / } #1 / \q_nil / \q_stop }
-\cs_new:Npn \@@_ext_check:nw #1 #2 / #3 / #4 \q_stop
+ { \@@_ext_check:nw { / } #1 / \q_@@_nil / \s_@@_stop }
+\cs_new:Npn \@@_ext_check:nw #1 #2 / #3 / #4 \s_@@_stop
{
- \quark_if_nil:nTF {#3}
+ \@@_quark_if_nil:nTF {#3}
{
\exp_args:No \@@_ext_check:nnw
- { \use_none:n #1 } {#2} #2 . \q_nil . \q_stop
+ { \use_none:n #1 } {#2} #2 . \q_@@_nil . \s_@@_stop
}
- { \@@_ext_check:nw { #1 #2 / } #3 / #4 \q_stop }
+ { \@@_ext_check:nw { #1 #2 / } #3 / #4 \s_@@_stop }
}
-\cs_new:Npx \@@_ext_check:nnw #1#2#3 . #4 . #5 \q_stop
+\cs_new:Npx \@@_ext_check:nnw #1#2#3 . #4 . #5 \s_@@_stop
{
- \exp_not:N \quark_if_nil:nTF {#4}
+ \exp_not:N \@@_quark_if_nil:nTF {#4}
{
\exp_not:N \@@_ext_check:nn
{ #1 #2 } { #1 #2 \tl_to_str:n { .tex } }
@@ -3309,11 +3375,11 @@
\cs_new_protected:Npn \file_parse_full_name:nNNN #1#2#3#4
{
\exp_after:wN \@@_parse_full_name_auxi:w
- \tl_to_str:n { #1 " #1 " } \q_stop #2#3#4
+ \tl_to_str:n { #1 " #1 " } \s_@@_stop #2#3#4
}
\cs_generate_variant:Nn \file_parse_full_name:nNNN { V }
\cs_new_protected:Npn \@@_parse_full_name_auxi:w
- #1 " #2 " #3 \q_stop #4#5#6
+ #1 " #2 " #3 \s_@@_stop #4#5#6
{
\@@_parse_full_name_split:nNNNTF {#2} / #4 #5
{ \str_if_empty:NT #4 { \str_set:Nn #4 { / } } }
@@ -3327,7 +3393,7 @@
}
\cs_new_protected:Npn \@@_parse_full_name_split:nNNNTF #1#2#3#4
{
- \cs_set_protected:Npn \@@_tmp:w ##1 ##2 #2 ##3 \q_stop
+ \cs_set_protected:Npn \@@_tmp:w ##1 ##2 #2 ##3 \s_@@_stop
{
\tl_if_empty:nTF {##3}
{
@@ -3342,9 +3408,9 @@
\use_i:nn
}
}
- { \@@_tmp:w { ##1 #2 ##2 } ##3 \q_stop }
+ { \@@_tmp:w { ##1 #2 ##2 } ##3 \s_@@_stop }
}
- \@@_tmp:w { } #1 #2 \q_stop
+ \@@_tmp:w { } #1 #2 \s_@@_stop
}
% \end{macrocode}
% \end{macro}
@@ -3449,7 +3515,7 @@
\tl_set:Nn \ExplFileExtension { [unknown~extension] }
\tl_set:Nn \ExplFileVersion {-1}
}
- { \@@_id_info_auxii:w #1 ~ \q_stop }
+ { \@@_id_info_auxii:w #1 ~ \s_@@_stop }
}
% \end{macrocode}
% Here, |#1| is |Id|, |#2| is the file name, |#3| is the extension,
@@ -3458,19 +3524,19 @@
% |-1| value then |#5| and |#6| are empty.
% \begin{macrocode}
\cs_new_protected:Npn \@@_id_info_auxii:w
- #1 ~ #2.#3 ~ #4 ~ #5 ~ #6 \q_stop
+ #1 ~ #2.#3 ~ #4 ~ #5 ~ #6 \s_@@_stop
{
\tl_set:Nn \ExplFileName {#2}
\tl_set:Nn \ExplFileExtension {#3}
\tl_set:Nn \ExplFileVersion {#4}
\str_if_eq:nnTF {#4} {-1}
{ \tl_set:Nn \ExplFileDate { 0000/00/00 } }
- { \@@_id_info_auxiii:w #5 - 0 - 0 - \q_stop }
+ { \@@_id_info_auxiii:w #5 - 0 - 0 - \s_@@_stop }
}
% \end{macrocode}
% Convert an \textsc{svn}-style date into a \LaTeX{}-style one.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_id_info_auxiii:w #1 - #2 - #3 - #4 \q_stop
+\cs_new_protected:Npn \@@_id_info_auxiii:w #1 - #2 - #3 - #4 \s_@@_stop
{ \tl_set:Nn \ExplFileDate { #1/#2/#3 } }
% \end{macrocode}
% \end{macro}