[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Replace quarks by scan marks in l3text (f714ddb1c)
PhelypeOleinik
tex.phelype at gmail.com
Sat Mar 21 00:55:38 CET 2020
Repository : https://github.com/latex3/latex3
On branch : scan-quark
Link : https://github.com/latex3/latex3/commit/f714ddb1c3c059f62a40d26b5527ee409df9c4cb
>---------------------------------------------------------------
commit f714ddb1c3c059f62a40d26b5527ee409df9c4cb
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Fri Mar 20 20:55:38 2020 -0300
Replace quarks by scan marks in l3text
>---------------------------------------------------------------
f714ddb1c3c059f62a40d26b5527ee409df9c4cb
l3kernel/l3text.dtx | 96 +++++++++++++++++++++++++++++----------
l3kernel/testfiles/m3quark001.tlg | 2 +-
2 files changed, 73 insertions(+), 25 deletions(-)
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 8d06641d9..9e3f68c9e 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -252,6 +252,54 @@
%<@@=text>
% \end{macrocode}
%
+% \subsection{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]{\@@_use_i_delimit_by_q_recursion_stop:nw}
+% Functions to gobble up to a quark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_q_recursion_stop:nw
+ #1 #2 \q_@@_recursion_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop_do:Nn}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_test_generate:NNNn \@@_if_recursion_tail_stop_do:Nn
+ \q_@@_recursion_tail \q_@@_recursion_stop { @@ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Utilities}
%
% \begin{macro}[EXP]
@@ -354,9 +402,9 @@
\if_catcode:w + #1 12 \else:
4 \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi:
\exp_after:wN ;
- \token_to_meaning:N #1 \q_stop
+ \token_to_meaning:N #1 \s_@@_stop
}
-\cs_new:Npn \@@_token_to_explicit_auxi:w #1 ; #2 \q_stop
+\cs_new:Npn \@@_token_to_explicit_auxi:w #1 ; #2 \s_@@_stop
{
\char_generate:nn
{
@@ -428,7 +476,7 @@
{
{ \token_if_protected_macro_p:N #1 }
{ \token_if_protected_long_macro_p:N #1 }
- { \token_if_eq_meaning_p:NN \q_recursion_tail #1 }
+ { \token_if_eq_meaning_p:NN \q_@@_recursion_tail #1 }
}
{ \prg_return_false: }
{ \prg_return_true: }
@@ -590,7 +638,7 @@
{
\group_align_safe_begin:
\@@_expand_loop:w #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
\@@_expand_result:n { }
}
% \end{macrocode}
@@ -613,7 +661,7 @@
% recursively, while spaces are just passed through. Thus all of the
% action is in handling \texttt{N}-type tokens.
% \begin{macrocode}
-\cs_new:Npn \@@_expand_loop:w #1 \q_recursion_stop
+\cs_new:Npn \@@_expand_loop:w #1 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#1}
{ \@@_expand_N_type:N }
@@ -622,7 +670,7 @@
{ \@@_expand_group:n }
{ \@@_expand_space:w }
}
- #1 \q_recursion_stop
+ #1 \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_group:n #1
{
@@ -650,7 +698,7 @@
% \begin{macrocode}
\cs_new:Npx \@@_expand_N_type:N #1
{
- \exp_not:N \quark_if_recursion_tail_stop_do:Nn #1
+ \exp_not:N \@@_if_recursion_tail_stop_do:Nn #1
{ \exp_not:N \@@_expand_end:w }
\exp_not:N \bool_lazy_any:nTF
{
@@ -724,16 +772,16 @@
{
\exp_after:wN \@@_expand_math_search:NNN
\exp_after:wN #1 \l_text_math_delims_tl
- \q_recursion_tail \q_recursion_tail
- \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_tail
+ \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_math_search:NNN #1#2#3
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_expand_explicit:N #1 }
\token_if_eq_meaning:NNTF #1 #2
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{
\@@_expand_store:n {#1}
\@@_expand_math_loop:Nw #3
@@ -741,7 +789,7 @@
}
{ \@@_expand_math_search:NNN #1 }
}
-\cs_new:Npn \@@_expand_math_loop:Nw #1#2 \q_recursion_stop
+\cs_new:Npn \@@_expand_math_loop:Nw #1#2 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#2}
{ \@@_expand_math_N_type:NN }
@@ -750,11 +798,11 @@
{ \@@_expand_math_group:Nn }
{ \@@_expand_math_space:Nw }
}
- #1#2 \q_recursion_stop
+ #1#2 \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_math_N_type:NN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_expand_end:w }
\@@_expand_store:n {#2}
\token_if_eq_meaning:NNTF #2 #1
@@ -795,7 +843,7 @@
\exp_after:wN \@@_expand_exclude:NN
\l_text_math_arg_tl
#1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
%</initex>
%<*package>
\exp_args:Ne \@@_expand_exclude:nN
@@ -811,12 +859,12 @@
\cs_new:Npn \@@_expand_exclude:nN #1#2
{
\@@_expand_exclude:NN #2 #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
%</package>
\cs_new:Npn \@@_expand_exclude:NN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
%<*initex>
{ \@@_expand_cs:N #1 }
%</initex>
@@ -825,7 +873,7 @@
%</package>
\cs_if_eq:NNTF #2 #1
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{ \@@_expand_exclude:Nn #1 }
}
{ \@@_expand_exclude:NN #1 }
@@ -844,15 +892,15 @@
{
\exp_after:wN \@@_expand_letterlike:NN \exp_after:wN
#1 \l_text_letterlike_tl
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_letterlike:NN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_expand_cs:N #1 }
\cs_if_eq:NNTF #2 #1
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{
\@@_expand_store:n {#1}
\@@_expand_loop:w
@@ -883,10 +931,10 @@
{ \cs_to_str:N #1 } #1
}
\cs_new:Npn \@@_expand_protect:nN #1#2
- { \@@_expand_protect:Nw #2 #1 \q_nil #1 ~ \q_nil \q_nil \q_stop }
-\cs_new:Npn \@@_expand_protect:Nw #1 #2 ~ \q_nil #3 \q_nil #4 \q_stop
+ { \@@_expand_protect:Nw #2 #1 \q_@@_nil #1 ~ \q_@@_nil \q_@@_nil \s_@@_stop }
+\cs_new:Npn \@@_expand_protect:Nw #1 #2 ~ \q_@@_nil #3 \q_@@_nil #4 \s_@@_stop
{
- \quark_if_nil:nTF {#4}
+ \@@_if_nil:nTF {#4}
{
\cs_if_exist:cTF {#2}
{ \exp_args:Ne \@@_expand_store:n { \exp_not:c {#2} } }
diff --git a/l3kernel/testfiles/m3quark001.tlg b/l3kernel/testfiles/m3quark001.tlg
index 5f3323c99..f81dc8d87 100644
--- a/l3kernel/testfiles/m3quark001.tlg
+++ b/l3kernel/testfiles/m3quark001.tlg
@@ -89,7 +89,7 @@ already been used for a scan mark.
\s__keys_stop \s__fp \s__fp_expr_mark \s__fp_expr_stop \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__sort_mark \s__sort_stop \s__sort_scan_stop \s__tl
-\s__color_stop \s__foo .
+\s__color_stop \s__text_stop \s__foo .
============================================================
============================================================
TEST 14: Use none until s__stop (expect nothing)
More information about the latex3-commits
mailing list.