[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Replace quarks by scan marks in l3token (506be2bb8)
PhelypeOleinik
tex.phelype at gmail.com
Fri Mar 20 00:26:15 CET 2020
Repository : https://github.com/latex3/latex3
On branch : scan-quark
Link : https://github.com/latex3/latex3/commit/506be2bb8232ea0485efa4fe398ed00682462719
>---------------------------------------------------------------
commit 506be2bb8232ea0485efa4fe398ed00682462719
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Thu Mar 19 20:26:15 2020 -0300
Replace quarks by scan marks in l3token
>---------------------------------------------------------------
506be2bb8232ea0485efa4fe398ed00682462719
l3kernel/l3tl.dtx | 4 +-
l3kernel/l3token.dtx | 88 +++++++++++++++++++++++++++++----------
l3kernel/testfiles/m3quark001.tlg | 8 ++--
3 files changed, 74 insertions(+), 26 deletions(-)
diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index 619ca6f8d..423264fbe 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -1524,7 +1524,8 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[EXP]{\@@_if_recursion_tail_break:nN,\@@_if_recursion_tail_stop:n}
+% \begin{macro}[EXP]{\@@_if_recursion_tail_break:nN}
+% \begin{macro}[pTF]{\@@_if_recursion_tail_stop:n}
% Functions to query recursion quarks.
% \begin{macrocode}
\__kernel_quark_test_generate:NNNn \@@_if_recursion_tail_break:nN
@@ -1533,6 +1534,7 @@
\q_@@_nil { @@ } { TF }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \subsection{Reassigning token list category codes}
%
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index 2c7dac389..23e9ce89d 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -1101,6 +1101,30 @@
%<@@=char>
% \end{macrocode}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_stop}
+% Internal scan mark.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_no_value}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_no_value
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[pTF]{\@@_if_no_value:N}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_conditional_generate:NNnn \@@_if_no_value:N
+ \q_@@_no_value { @@ } { TF }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Manipulating and interrogating character tokens}
%
% \begin{macro}{\char_set_catcode:nn}
@@ -1667,12 +1691,12 @@
\exp_after:wN \exp_after:wN \exp_after:wN \@@_to_nfd:Nw
\exp_after:wN \exp_after:wN \exp_after:wN #1
\cs:w c_@@_nfd_ \token_to_str:N #1 _ tl \cs_end:
- \q_stop
+ \s_@@_stop
}
{ \exp_not:n {#1} }
}
\cs_set_eq:NN \@@_to_nfd:n \char_to_nfd:N
-\cs_new:Npn \@@_to_nfd:Nw #1#2#3 \q_stop
+\cs_new:Npn \@@_to_nfd:Nw #1#2#3 \s_@@_stop
{
\exp_args:Ne \@@_to_nfd:n
{ \char_generate:nn { `#2 } { \@@_change_case_catcode:N #1 } }
@@ -1744,13 +1768,13 @@
{ \char_generate:nn {#1} { \@@_change_case_catcode:N #2 } }
}
\cs_new:Npn \@@_change_case_multi:nN #1#2
- { \@@_change_case_multi:NNNNw #2 #1 \q_no_value \q_no_value \q_stop }
+ { \@@_change_case_multi:NNNNw #2 #1 \q_@@_no_value \q_@@_no_value \s_@@_stop }
\cs_generate_variant:Nn \@@_change_case_multi:nN { v }
-\cs_new:Npn \@@_change_case_multi:NNNNw #1#2#3#4#5 \q_stop
+\cs_new:Npn \@@_change_case_multi:NNNNw #1#2#3#4#5 \s_@@_stop
{
- \quark_if_no_value:NTF #4
+ \@@_if_no_value:NTF #4
{
- \quark_if_no_value:NTF #3
+ \@@_if_no_value:NTF #3
{ \@@_change_case:NN #1 #2 }
{ \@@_change_case:NNN #1 #2#3 }
}
@@ -1865,6 +1889,13 @@
%<@@=token>
% \end{macrocode}
%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\token_to_meaning:N, \token_to_meaning:c}
% \begin{macro}{\token_to_str:N, \token_to_str:c}
% These are all defined in \pkg{l3basics}, as they are needed
@@ -2136,10 +2167,10 @@
{
\exp_not:N \exp_after:wN \exp_not:N \@@_if_macro_p:w
\exp_not:N \token_to_meaning:N ##1 \tl_to_str:n { ma : }
- \exp_not:N \q_stop
+ \exp_not:N \s_@@_stop
}
\cs_new:Npn \exp_not:N \@@_if_macro_p:w
- ##1 \tl_to_str:n { ma } ##2 \c_colon_str ##3 \exp_not:N \q_stop
+ ##1 \tl_to_str:n { ma } ##2 \c_colon_str ##3 \exp_not:N \s_@@_stop
}
{
\str_if_eq:nnTF { #2 } { cro }
@@ -2209,7 +2240,7 @@
\use:x
{
\cs_new:Npn \exp_not:c { @@_delimit_by_ #1 :w }
- ####1 \tl_to_str:n {#1} ####2 \exp_not:N \q_stop
+ ####1 \tl_to_str:n {#1} ####2 \exp_not:N \s_@@_stop
{ ####1 \tl_to_str:n {#1} }
}
}
@@ -2297,7 +2328,7 @@
\exp_not:N \exp_after:wN
\exp_not:c { @@_delimit_by_ #2 :w }
\exp_not:N \token_to_meaning:N ####1
- ? \tl_to_str:n {#2} \exp_not:N \q_stop
+ ? \tl_to_str:n {#2} \exp_not:N \s_@@_stop
}
{ \exp_not:n {#3} }
{ \exp_not:N \prg_return_true: }
@@ -2389,17 +2420,17 @@
{
\exp_not:N \exp_after:wN \exp_not:N \@@_if_primitive:NNw
\exp_not:N \token_to_meaning:N ##1
- \tl_to_str:n { : : : } \exp_not:N \q_stop ##1
+ \tl_to_str:n { : : : } \exp_not:N \s_@@_stop ##1
}
}
\cs_new:Npn \exp_not:N \@@_if_primitive:NNw
- ##1##2 ##3 \c_colon_str ##4 \exp_not:N \q_stop
+ ##1##2 ##3 \c_colon_str ##4 \exp_not:N \s_@@_stop
{
\exp_not:N \tl_if_empty:oTF
{ \exp_not:N \@@_if_primitive_space:w ##3 ~ }
{
\exp_not:N \@@_if_primitive_loop:N ##3
- \c_colon_str \exp_not:N \q_stop
+ \c_colon_str \exp_not:N \s_@@_stop
}
{ \exp_not:N \@@_if_primitive_nullfont:N }
}
@@ -2422,7 +2453,7 @@
\exp_after:wN \@@_if_primitive_loop:N
\fi:
}
-\cs_new:Npn \@@_if_primitive:Nw #1 #2 \q_stop
+\cs_new:Npn \@@_if_primitive:Nw #1 #2 \s_@@_stop
{
\if:w : #1
\exp_after:wN \@@_if_primitive_undefined:N
@@ -2497,6 +2528,21 @@
% \end{macrocode}
% \end{macro}
%
+% \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_none_delimit_by_s_stop:w}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\peek_after:Nw}
% \begin{macro}{\peek_gafter:Nw}
% Simple wrappers for \tn{futurelet}: no arguments absorbed
@@ -2759,7 +2805,7 @@
% \texttt{true} branch, we must detect outer tokens, without impacting
% performance too much for non-outer tokens. The first filter is to
% search for \texttt{outer} in the \tn{meaning} of \cs{l_peek_token}.
-% If that is absent, \cs{use_none_delimit_by_q_stop:w} cleans up, and
+% If that is absent, \cs{@@_use_none_delimit_by_s_stop:w} cleans up, and
% we call \cs{@@_true:w}. Otherwise, the token can be a non-outer
% macro or a primitive mark whose parameter or replacement text
% contains \texttt{outer}, it can be the primitive \tn{outer}, or it
@@ -2772,7 +2818,7 @@
% \cs{@@_token_generic:NNTF} function.
% \begin{macrocode}
\group_begin:
- \cs_set_protected:Npn \@@_tmp:w #1 \q_stop
+ \cs_set_protected:Npn \@@_tmp:w #1 \s_@@_stop
{
\cs_new_protected:Npn \@@_execute_branches_N_type:
{
@@ -2783,18 +2829,18 @@
1 \exp_stop_f:
\exp_after:wN \@@_N_type:w
\token_to_meaning:N \l_peek_token
- \q_mark \@@_N_type_aux:nnw
- #1 \q_mark \use_none_delimit_by_q_stop:w
- \q_stop
+ \s_@@_mark \@@_N_type_aux:nnw
+ #1 \s_@@_mark \@@_use_none_delimit_by_s_stop:w
+ \s_@@_stop
\exp_after:wN \@@_true:w
\else:
\exp_after:wN \@@_false:w
\fi:
}
- \cs_new_protected:Npn \@@_N_type:w ##1 #1 ##2 \q_mark ##3
+ \cs_new_protected:Npn \@@_N_type:w ##1 #1 ##2 \s_@@_mark ##3
{ ##3 {##1} {##2} }
}
- \exp_after:wN \@@_tmp:w \tl_to_str:n { outer } \q_stop
+ \exp_after:wN \@@_tmp:w \tl_to_str:n { outer } \s_@@_stop
\group_end:
\cs_new_protected:Npn \@@_N_type_aux:nnw #1 #2 #3 \fi:
{
diff --git a/l3kernel/testfiles/m3quark001.tlg b/l3kernel/testfiles/m3quark001.tlg
index c490fb15f..0dd1923bb 100644
--- a/l3kernel/testfiles/m3quark001.tlg
+++ b/l3kernel/testfiles/m3quark001.tlg
@@ -82,10 +82,10 @@ LaTeX has been asked to create a new scan mark '\s__foo' but this name has
already been used for a scan mark.
> \g__scan_marks_tl=\s_stop \s__tl_nil \s__tl_mark \s__tl_stop \s__str_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__prop \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 .
+\s__clist_mark \s__clist_stop \s__char_stop \s__token_stop \s__peek_mark
+\s__peek_stop \s__prop \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 .
============================================================
============================================================
TEST 14: Use none until s__stop (expect nothing)
More information about the latex3-commits
mailing list.