diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3token.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3token.dtx | 93 |
1 files changed, 69 insertions, 24 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index 61565b47c0f..0608820bbac 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1101,6 +1101,29 @@ %<@@=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]{\@@_quark_if_no_value:N} +% Functions to query recursion quarks. +% \begin{macrocode} +\__kernel_quark_new_conditional:Nn \@@_quark_if_no_value:N { TF } +% \end{macrocode} +% \end{macro} +% % \subsection{Manipulating and interrogating character tokens} % % \begin{macro}{\char_set_catcode:nn} @@ -1667,12 +1690,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 +1767,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 + \@@_quark_if_no_value:NTF #4 { - \quark_if_no_value:NTF #3 + \@@_quark_if_no_value:NTF #3 { \@@_change_case:NN #1 #2 } { \@@_change_case:NNN #1 #2#3 } } @@ -1865,6 +1888,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 +2166,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 + \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 \s_@@_stop } { \str_if_eq:nnTF { #2 } { cro } @@ -2200,7 +2230,7 @@ % conditionals which detect whether the \tn{meaning} of their % argument begins with a particular string. Each auxiliary takes an % argument delimited by a string, a second one delimited by -% \cs{q_stop}, and returns the first one and its delimiter. +% \cs{s_@@_stop}, and returns the first one and its delimiter. % This result is eventually compared to another string. % \begin{macrocode} \group_begin: @@ -2209,7 +2239,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 \s_@@_stop { ####1 \tl_to_str:n {#1} } } } @@ -2297,7 +2327,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} \s_@@_stop } { \exp_not:n {#3} } { \exp_not:N \prg_return_true: } @@ -2356,7 +2386,7 @@ % nonexistent depending on \tn{endlinechar}), and takes care % of three of the exceptions: \tn{space}, \tn{italiccorr} % and \tn{hyphen}, whose meaning is at most two characters. -% This leaves a string terminated by some |:|, and \cs{q_stop}. +% This leaves a string terminated by some |:|, and \cs{s_@@_stop}. % % The meaning of each one of the five \tn[no-index]{...mark} primitives % has the form \meta{letters}|:|\meta{user material}. In other words, @@ -2389,17 +2419,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 { : : : } \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 \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 \s_@@_stop } { \exp_not:N \@@_if_primitive_nullfont:N } } @@ -2422,7 +2452,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 +2527,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 +2804,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 +2817,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 +2828,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: { |