[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Replace quarks by scan marks in l3file (b115c9b74)
PhelypeOleinik
tex.phelype at gmail.com
Fri Mar 20 01:00:24 CET 2020
Repository : https://github.com/latex3/latex3
On branch : scan-quark
Link : https://github.com/latex3/latex3/commit/b115c9b7448b76fef14365093998c1d3198c5195
>---------------------------------------------------------------
commit b115c9b7448b76fef14365093998c1d3198c5195
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Thu Mar 19 21:00:24 2020 -0300
Replace quarks by scan marks in l3file
>---------------------------------------------------------------
b115c9b7448b76fef14365093998c1d3198c5195
l3kernel/l3file.dtx | 157 +++++++++++++++++++++++++++-----------
l3kernel/testfiles/m3quark001.tlg | 5 +-
2 files changed, 116 insertions(+), 46 deletions(-)
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 51506ece3..8c0738c11 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -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,51 @@
% \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]{\@@_if_nil:n}
+% Branching quark conditional.
+% \begin{macrocode}
+\__kernel_quark_conditional_generate:NNnn \@@_if_nil:n
+ \q_@@_nil { @@ } { 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_test_generate:NNNn \@@_if_recursion_tail_stop:N
+ \q_@@_recursion_tail \q_@@_recursion_stop { @@ }
+\__kernel_quark_test_generate:NNNn \@@_if_recursion_tail_stop_do:nn
+ \q_@@_recursion_tail \q_@@_recursion_stop { @@ }
+% \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 +2482,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 +2495,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 +2539,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,10 +2564,10 @@
% 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}
+ \@@_if_nil:nTF {#3}
{
\exp_args:Ne \__kernel_file_name_trim_spaces_aux:n
{ \tl_trim_spaces:n { #1 \s_stop } }
@@ -2526,10 +2595,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}
+ \@@_if_nil:nTF {#3}
{ #1 }
{ "#1" }
}
@@ -2686,19 +2755,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}
+ \@@_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 \@@_if_nil:nTF {#4}
{
\exp_not:N \@@_ext_check:nn
{ #1 #2 } { #1 #2 \tl_to_str:n { .tex } }
@@ -3309,11 +3378,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 +3396,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 +3411,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 +3518,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 +3527,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}
diff --git a/l3kernel/testfiles/m3quark001.tlg b/l3kernel/testfiles/m3quark001.tlg
index 44c658f27..959538c69 100644
--- a/l3kernel/testfiles/m3quark001.tlg
+++ b/l3kernel/testfiles/m3quark001.tlg
@@ -84,8 +84,9 @@ already been used for a scan mark.
\s__str_stop \s__seq \s__seq_mark \s__seq_stop \s__int_mark \s__int_stop
\s__clist_mark \s__clist_stop \s__char_stop \s__token_stop \s__peek_mark
\s__peek_stop \s__prop \s__prop_mark \s__prop_stop \s__msg_mark \s__msg_stop
-\s__keyval_nil \s__keyval_mark \s__keyval_stop \s__keyval_tail \s__fp
-\s__fp_mark \s__fp_stop \s__fp_invalid \s__fp_underflow \s__fp_overflow
+\s__iow_mark \s__iow_stop \s__file_stop \s__dim_mark \s__dim_stop
+\s__skip_stop \s__keyval_nil \s__keyval_mark \s__keyval_stop \s__keyval_tail
+\s__fp \s__fp_mark \s__fp_stop \s__fp_invalid \s__fp_underflow \s__fp_overflow
\s__fp_division \s__fp_exact \s__fp_tuple \s__tl \s__foo .
============================================================
============================================================
More information about the latex3-commits
mailing list.