diff options
Diffstat (limited to 'Master/texmf-dist/source')
58 files changed, 1936 insertions, 832 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 3c90cc81a3e..a24e520f458 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> %</driver|generic|package|2ekernel> -\def\ExplFileDate{2020-05-05}% +\def\ExplFileDate{2020-05-11}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1334,6 +1334,17 @@ { \sys_everyjob: } % \end{macrocode} % +% \begin{variable}{\s_@@_stop} +% Internal scan marks. This code has to be reload-safe, so this one +% has to be guarded with \cs{if_cs_exist:N} (\cs{cs_if_exist:NF}) wouldn't +% do because it returns false for control sequences equal to \cs{scan_stop:}. +% \begin{macrocode} +\reverse_if:N \if_cs_exist:N \s_@@_stop + \scan_new:N \s_@@_stop +\fi: +% \end{macrocode} +% \end{variable} +% % \begin{macro}{\@pushfilename, \@popfilename} % \begin{macro}{\@@_status_pop:w} % The idea here is to use \LaTeXe{}'s \tn{@pushfilename} and @@ -1372,14 +1383,14 @@ \__kernel_file_input_pop: \tl_if_empty:NTF \l_@@_status_stack_tl { \ExplSyntaxOff } - { \exp_after:wN \@@_status_pop:w \l_@@_status_stack_tl \q_stop } + { \exp_after:wN \@@_status_pop:w \l_@@_status_stack_tl \s_@@_stop } } % \end{macrocode} % The pop auxiliary function removes the first item from the stack, % saves the rest of the stack and then does the test. The flag here % is not a proper \texttt{bool}, so a low-level test is used. % \begin{macrocode} -\cs_gset_protected:Npn \@@_status_pop:w #1#2 \q_stop +\cs_gset_protected:Npn \@@_status_pop:w #1#2 \s_@@_stop { \tl_set:Nn \l_@@_status_stack_tl {#2} \int_if_odd:nTF {#1} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3.ins b/Master/texmf-dist/source/latex/l3kernel/l3.ins index 86d4ac52801..04d1e18a343 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3.ins @@ -65,9 +65,9 @@ and all files in that bundle must be distributed together. \from{l3names.dtx} {package} \from{l3basics.dtx} {package} \from{l3expan.dtx} {package} + \from{l3quark.dtx} {package} \from{l3tl.dtx} {package} \from{l3str.dtx} {package} - \from{l3quark.dtx} {package} \from{l3seq.dtx} {package} \from{l3int.dtx} {package} \from{l3flag.dtx} {package} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index fee2e0fdfa2..188477adcf5 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 5784ade6f52..22b7a75d15d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1368,6 +1368,7 @@ \tex_let:D \if_charcode:w \tex_if:D \tex_let:D \if_catcode:w \tex_ifcat:D \tex_let:D \if_meaning:w \tex_ifx:D +\tex_let:D \if_bool:N \tex_ifodd:D % \end{macrocode} % \end{macro} % @@ -1693,7 +1694,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro} +% \begin{macro}[EXP] % { % \use_i_delimit_by_q_nil:nw , % \use_i_delimit_by_q_stop:nw , @@ -1846,6 +1847,14 @@ % two arguments are absorbed then the code would work. % \end{macro} % +% \begin{macro}[EXP]{\@@_use_none_delimit_by_q_recursion_stop:w} +% Private version of \cs{use_none_delimit_by_q_recursion_stop:w}. +% \begin{macrocode} +\cs_set:Npn \@@_use_none_delimit_by_q_recursion_stop:w + #1 \q_@@_recursion_stop { } +% \end{macrocode} +% \end{macro} +% % \begin{macro} % { % \prg_set_conditional:Npnn , @@ -1981,17 +1990,17 @@ \exp_not:N \@@_generate_conditional:NNnnnnNw \exp_not:n { #4 #5 {#1} {#2} {#6} } \@@_generate_conditional_test:w - #8 \q_mark + #8 \s_@@_mark \@@_generate_conditional_fast:nw - \prg_return_true: \else: \prg_return_false: \fi: \q_mark + \prg_return_true: \else: \prg_return_false: \fi: \s_@@_mark \use_none:n \exp_not:n { {#8} \use_i_ii:nnn } \tl_to_str:n {#7} - \exp_not:n { , \q_recursion_tail , \q_recursion_stop } + \exp_not:n { , \q_@@_recursion_tail , \q_@@_recursion_stop } } } \cs_set:Npn \@@_generate_conditional_test:w - #1 \prg_return_true: \else: \prg_return_false: \fi: \q_mark #2 + #1 \prg_return_true: \else: \prg_return_false: \fi: \s_@@_mark #2 { #2 {#1} } \cs_set:Npn \@@_generate_conditional_fast:nw #1#2 \exp_not:n #3 { \exp_not:n { {#1} \use_i:nn } } @@ -2006,8 +2015,8 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_generate_conditional:NNnnnnNw #1#2#3#4#5#6#7#8 , { - \if_meaning:w \q_recursion_tail #8 - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \if_meaning:w \q_@@_recursion_tail #8 + \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \fi: \use:c { @@_generate_ #8 _form:wNNnnnnN } \tl_if_empty:nF {#8} @@ -2017,7 +2026,7 @@ {#8} { \token_to_str:c { #3 : #4 } } } \use_none:nnnnnnnn - \q_stop + \s_@@_stop #1 #2 {#3} {#4} {#5} {#6} #7 \@@_generate_conditional:NNnnnnNw #1 #2 {#3} {#4} {#5} {#6} #7 } @@ -2052,7 +2061,7 @@ % nesting of conditionals. % \begin{macrocode} \cs_set_protected:Npn \@@_generate_p_form:wNNnnnnN - #1 \q_stop #2#3#4#5#6#7#8 + #1 \s_@@_stop #2#3#4#5#6#7#8 { \if_meaning:w e #3 \exp_after:wN \use_i:nn @@ -2071,7 +2080,7 @@ } } \cs_set_protected:Npn \@@_generate_T_form:wNNnnnnN - #1 \q_stop #2#3#4#5#6#7#8 + #1 \s_@@_stop #2#3#4#5#6#7#8 { #8 { \exp_args:Nc #2 { #4 : #5 T } #6 } @@ -2079,7 +2088,7 @@ { #7 \exp_after:wN \use_ii:nn \fi: \use_none:n } } \cs_set_protected:Npn \@@_generate_F_form:wNNnnnnN - #1 \q_stop #2#3#4#5#6#7#8 + #1 \s_@@_stop #2#3#4#5#6#7#8 { #8 { \exp_args:Nc #2 { #4 : #5 F } #6 } @@ -2087,7 +2096,7 @@ { #7 \exp_after:wN \use_none:nn \fi: \use:n } } \cs_set_protected:Npn \@@_generate_TF_form:wNNnnnnN - #1 \q_stop #2#3#4#5#6#7#8 + #1 \s_@@_stop #2#3#4#5#6#7#8 { #8 { \exp_args:Nc #2 { #4 : #5 TF } #6 } @@ -2104,8 +2113,8 @@ % The setting-equal functions. Split both functions and feed % \Arg{name_1} \Arg{signature_1} \meta{boolean_1} % \Arg{name_2} \Arg{signature_2} \meta{boolean_2} -% \meta{copying~function} \meta{conditions} |,| \cs{q_recursion_tail} -% |,| \cs{q_recursion_stop} +% \meta{copying~function} \meta{conditions} |,| \cs{q_@@_recursion_tail} +% |,| \cs{q_@@_recursion_stop} % to a first auxiliary. % \begin{macrocode} \cs_set_protected:Npn \prg_set_eq_conditional:NNn @@ -2121,7 +2130,7 @@ \cs_split_function:N #3 \exp_not:N #1 \tl_to_str:n {#4} - \exp_not:n { , \q_recursion_tail , \q_recursion_stop } + \exp_not:n { , \q_@@_recursion_tail , \q_@@_recursion_stop } } } % \end{macrocode} @@ -2156,19 +2165,19 @@ \if_meaning:w \c_false_bool #3 \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \fi: \if_meaning:w \c_false_bool #6 \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#4} } - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \fi: \@@_set_eq_conditional_loop:nnnnNw {#1} {#2} {#4} {#5} } \cs_set_protected:Npn \@@_set_eq_conditional_loop:nnnnNw #1#2#3#4#5#6 , { - \if_meaning:w \q_recursion_tail #6 - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \if_meaning:w \q_@@_recursion_tail #6 + \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \fi: \use:c { @@_set_eq_conditional_ #6 _form:wNnnnn } \tl_if_empty:nF {#6} @@ -2178,17 +2187,17 @@ {#6} { \token_to_str:c { #1 : #2 } } } \use_none:nnnnnn - \q_stop + \s_@@_stop #5 {#1} {#2} {#3} {#4} \@@_set_eq_conditional_loop:nnnnNw {#1} {#2} {#3} {#4} #5 } -\cs_set:Npn \@@_set_eq_conditional_p_form:wNnnnn #1 \q_stop #2#3#4#5#6 +\cs_set:Npn \@@_set_eq_conditional_p_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6 { #2 { #3 _p : #4 } { #5 _p : #6 } } -\cs_set:Npn \@@_set_eq_conditional_TF_form:wNnnnn #1 \q_stop #2#3#4#5#6 +\cs_set:Npn \@@_set_eq_conditional_TF_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6 { #2 { #3 : #4 TF } { #5 : #6 TF } } -\cs_set:Npn \@@_set_eq_conditional_T_form:wNnnnn #1 \q_stop #2#3#4#5#6 +\cs_set:Npn \@@_set_eq_conditional_T_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6 { #2 { #3 : #4 T } { #5 : #6 T } } -\cs_set:Npn \@@_set_eq_conditional_F_form:wNnnnn #1 \q_stop #2#3#4#5#6 +\cs_set:Npn \@@_set_eq_conditional_F_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6 { #2 { #3 : #4 F } { #5 : #6 F } } % \end{macrocode} % \end{macro} @@ -2335,12 +2344,12 @@ % First ensure that we actually get a properly evaluated string by % expanding \cs{cs_to_str:N} twice. If the function contained a % colon, the auxiliary takes as |#1| the function name, delimited by -% the first colon, then the signature |#2|, delimited by \cs{q_mark}, -% then \cs{c_true_bool} as |#3|, and |#4| cleans up until \cs{q_stop}. -% Otherwise, the |#1| contains the function name and \cs{q_mark} +% the first colon, then the signature |#2|, delimited by \cs{s_@@_mark}, +% then \cs{c_true_bool} as |#3|, and |#4| cleans up until \cs{s_@@_stop}. +% Otherwise, the |#1| contains the function name and \cs{s_@@_mark} % \cs{c_true_bool}, |#2| is empty, |#3| is \cs{c_false_bool}, and |#4| % cleans up. The second -% auxiliary trims the trailing \cs{q_mark} from the function name if +% auxiliary trims the trailing \cs{s_@@_mark} from the function name if % present (that is, if the original function had no colon). % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1 @@ -2349,13 +2358,13 @@ { \exp_after:wN \exp_after:wN \exp_after:wN \@@_split_function_auxi:w - \cs_to_str:N ##1 \q_mark \c_true_bool - #1 \q_mark \c_false_bool \q_stop + \cs_to_str:N ##1 \s_@@_mark \c_true_bool + #1 \s_@@_mark \c_false_bool \s_@@_stop } \cs_set:Npn \@@_split_function_auxi:w - ##1 #1 ##2 \q_mark ##3##4 \q_stop - { \@@_split_function_auxii:w ##1 \q_mark \q_stop {##2} ##3 } - \cs_set:Npn \@@_split_function_auxii:w ##1 \q_mark ##2 \q_stop + ##1 #1 ##2 \s_@@_mark ##3##4 \s_@@_stop + { \@@_split_function_auxii:w ##1 \s_@@_mark \s_@@_stop {##2} ##3 } + \cs_set:Npn \@@_split_function_auxii:w ##1 \s_@@_mark ##2 \s_@@_stop { {##1} } } \exp_after:wN \@@_tmp:w \token_to_str:N : @@ -3158,7 +3167,7 @@ \use:x { \exp_not:n { \cs_new:Npn \@@_prefix_arg_replacement:wN #1 } - \tl_to_str:n { macro : } \exp_not:n { #2 -> #3 \q_stop #4 } + \tl_to_str:n { macro : } \exp_not:n { #2 -> #3 \s_@@_stop #4 } } { #4 {#1} {#2} {#3} } \cs_new:Npn \cs_prefix_spec:N #1 @@ -3166,7 +3175,7 @@ \token_if_macro:NTF #1 { \exp_after:wN \@@_prefix_arg_replacement:wN - \token_to_meaning:N #1 \q_stop \use_i:nnn + \token_to_meaning:N #1 \s_@@_stop \use_i:nnn } { \scan_stop: } } @@ -3175,7 +3184,7 @@ \token_if_macro:NTF #1 { \exp_after:wN \@@_prefix_arg_replacement:wN - \token_to_meaning:N #1 \q_stop \use_ii:nnn + \token_to_meaning:N #1 \s_@@_stop \use_ii:nnn } { \scan_stop: } } @@ -3184,7 +3193,7 @@ \token_if_macro:NTF #1 { \exp_after:wN \@@_prefix_arg_replacement:wN - \token_to_meaning:N #1 \q_stop \use_iii:nnn + \token_to_meaning:N #1 \s_@@_stop \use_iii:nnn } { \scan_stop: } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 224163be1bc..4ff6267be1c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index 3c8e9d93f2f..7c6b12dd787 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 7ae1a7afe84..c97fb26e258 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1001,8 +1001,8 @@ \cs_new:Npn \@@_expandable_error_module:nn #1#2 { \exp_after:wN \exp_after:wN - \exp_after:wN \use_none_delimit_by_q_stop:w - \use:n { \::error ! ~ #2 : ~ #1 } \q_stop + \exp_after:wN \@@_use_none_delimit_by_s_stop:w + \use:n { \::error ! ~ #2 : ~ #1 } \s_@@_stop } % \end{macrocode} % \end{macro} @@ -1079,6 +1079,14 @@ % \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, noTF]{\bool_case_true:n, \bool_case_false:n} % \begin{macro}{\@@_case:NnTF} % \begin{macro}{\@@_case_true:w, \@@_case_false:w, \@@_case_end:nw} @@ -1104,7 +1112,7 @@ \cs_new:Npn \@@_case:NnTF #1#2#3#4 { \bool_if:NTF #1 \@@_case_true:w \@@_case_false:w - #2 #1 { } \q_mark {#3} \q_mark {#4} \q_stop + #2 #1 { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop } \cs_new:Npn \@@_case_true:w #1#2 { @@ -1118,7 +1126,7 @@ { \@@_case_false:w } { \@@_case_end:nw {#2} } } -\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop +\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop { \exp_end: #1 #4 } % \end{macrocode} % \end{macro} @@ -1131,6 +1139,13 @@ %<@@=prop> % \end{macrocode} % +% \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{macro}[EXP] % {\prop_rand_key_value:N, \prop_rand_key_value:c} % \begin{macro}[EXP]{\@@_rand_item:w} @@ -1146,14 +1161,14 @@ { \exp_after:wN \@@_rand_item:w \int_value:w \int_rand:nn { 1 } { \prop_count:N #1 } - #1 \q_stop + #1 \s_@@_stop } } \cs_generate_variant:Nn \prop_rand_key_value:N { c } \cs_new:Npn \@@_rand_item:w #1 \s_@@ \@@_pair:wn #2 \s_@@ #3 { \int_compare:nNnF {#1} > 1 - { \use_i_delimit_by_q_stop:nw { \exp_not:n { {#2} {#3} } } } + { \@@_use_i_delimit_by_s_stop:nw { \exp_not:n { {#2} {#3} } } } \exp_after:wN \@@_rand_item:w \int_value:w \int_eval:n { #1 - 1 } \s_@@ } @@ -1189,25 +1204,25 @@ % worrying about which is longer. % \begin{macrocode} \cs_new:Npn \seq_mapthread_function:NNN #1#2#3 - { \exp_after:wN \@@_mapthread_function:wNN #2 \q_stop #1 #3 } -\cs_new:Npn \@@_mapthread_function:wNN \s_@@ #1 \q_stop #2#3 + { \exp_after:wN \@@_mapthread_function:wNN #2 \s_@@_stop #1 #3 } +\cs_new:Npn \@@_mapthread_function:wNN \s_@@ #1 \s_@@_stop #2#3 { - \exp_after:wN \@@_mapthread_function:wNw #2 \q_stop #3 + \exp_after:wN \@@_mapthread_function:wNw #2 \s_@@_stop #3 #1 { ? \prg_break: } { } \prg_break_point: } -\cs_new:Npn \@@_mapthread_function:wNw \s_@@ #1 \q_stop #2 +\cs_new:Npn \@@_mapthread_function:wNw \s_@@ #1 \s_@@_stop #2 { \@@_mapthread_function:Nnnwnn #2 #1 { ? \prg_break: } { } - \q_stop + \s_@@_stop } -\cs_new:Npn \@@_mapthread_function:Nnnwnn #1#2#3#4 \q_stop #5#6 +\cs_new:Npn \@@_mapthread_function:Nnnwnn #1#2#3#4 \s_@@_stop #5#6 { \use_none:n #2 \use_none:n #5 #1 {#3} {#6} - \@@_mapthread_function:Nnnwnn #1 #4 \q_stop + \@@_mapthread_function:Nnnwnn #1 #4 \s_@@_stop } \cs_generate_variant:Nn \seq_mapthread_function:NNN { Nc , c , cc } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index ec24d2de47c..0b011f80e0e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -94,8 +94,7 @@ % than their sequence analogues for large lists. However, these % functions work slowly for \enquote{unsafe} items that must be braced, % and may produce errors when their argument contains |{|, |}| or |#| -% (assuming the usual \TeX{} category codes apply). In addition, comma -% lists cannot store quarks \cs{q_mark} or \cs{q_stop}. The sequence +% (assuming the usual \TeX{} category codes apply). The sequence % data type should thus certainly be preferred to comma lists to store % such items. % @@ -785,6 +784,41 @@ % \end{macrocode} % \end{variable} % +% \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, +% \@@_use_i_delimit_by_s_stop:nw +% } +% Functions to gobble up to a scan mark. +% \begin{macrocode} +\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { } +\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1} +% \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:n} +% Functions to query recursion quarks. +% \begin{macrocode} +\__kernel_quark_new_test:N \@@_if_recursion_tail_break:nN +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:n +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_tmp:w} % A temporary function for various purposes. % \begin{macrocode} @@ -826,11 +860,11 @@ { \exp_after:wN \@@_sanitize:Nn \exp_after:wN \c_empty_tl \exp:w \@@_trim_next:w \prg_do_nothing: - #1 , \q_recursion_tail , \q_recursion_stop + #1 , \q_@@_recursion_tail , \q_@@_recursion_stop } \cs_new:Npn \@@_sanitize:Nn #1#2 { - \quark_if_recursion_tail_stop:n {#2} + \@@_if_recursion_tail_stop:n {#2} #1 \@@_wrap_item:w #2 , \exp_after:wN \@@_sanitize:Nn \exp_after:wN , \exp:w \@@_trim_next:w \prg_do_nothing: @@ -850,7 +884,7 @@ % \end{itemize} % All \pkg{l3clist} functions go through the same test when they need % to determine whether to brace an item, so it is not a problem that -% this test has false positives such as \enquote{\cs{q_mark} +% this test has false positives such as \enquote{\cs{s_@@_mark} % \texttt{?}}. If the argument starts or end with a space or contains % a comma then one of the three arguments of \cs{@@_if_wrap:w} will % have its end delimiter (partly) in one of the three copies of |#1| @@ -865,7 +899,8 @@ \tl_if_empty:oTF { \@@_if_wrap:w - \q_mark ? #1 ~ \q_mark ? ~ #1 \q_mark , ~ \q_mark #1 , + \s_@@_mark ? #1 ~ \s_@@_mark ? ~ #1 + \s_@@_mark , ~ \s_@@_mark #1 , } { \tl_if_head_is_group:nTF { #1 { } } @@ -882,7 +917,7 @@ } { \prg_return_true: } } -\cs_new:Npn \@@_if_wrap:w #1 \q_mark ? ~ #2 ~ \q_mark #3 , { } +\cs_new:Npn \@@_if_wrap:w #1 \s_@@_mark ? ~ #2 ~ \s_@@_mark #3 , { } % \end{macrocode} % \end{macro} % \end{macro} @@ -1180,10 +1215,10 @@ \if_meaning:w #1 \c_empty_clist \tl_set:Nn #2 { \q_no_value } \else: - \exp_after:wN \@@_get:wN #1 , \q_stop #2 + \exp_after:wN \@@_get:wN #1 , \s_@@_stop #2 \fi: } -\cs_new_protected:Npn \@@_get:wN #1 , #2 \q_stop #3 +\cs_new_protected:Npn \@@_get:wN #1 , #2 \s_@@_stop #3 { \tl_set:Nn #3 {#1} } \cs_generate_variant:Nn \clist_get:NN { c } % \end{macrocode} @@ -1199,8 +1234,8 @@ % An empty clist leads to \cs{q_no_value}, otherwise grab until the % first comma and assign to the variable. The second argument of % \cs{@@_pop:wwNNN} is a comma list ending in a comma and -% \cs{q_mark}, unless the original clist contained exactly one item: -% then the argument is just \cs{q_mark}. The next auxiliary picks +% \cs{s_@@_mark}, unless the original clist contained exactly one item: +% then the argument is just \cs{s_@@_mark}. The next auxiliary picks % either \cs{exp_not:n} or \cs{use_none:n} as |#2|, ensuring that the % result can safely be an empty comma list. % \begin{macrocode} @@ -1213,21 +1248,21 @@ \if_meaning:w #2 \c_empty_clist \tl_set:Nn #3 { \q_no_value } \else: - \exp_after:wN \@@_pop:wwNNN #2 , \q_mark \q_stop #1#2#3 + \exp_after:wN \@@_pop:wwNNN #2 , \s_@@_mark \s_@@_stop #1#2#3 \fi: } -\cs_new_protected:Npn \@@_pop:wwNNN #1 , #2 \q_stop #3#4#5 +\cs_new_protected:Npn \@@_pop:wwNNN #1 , #2 \s_@@_stop #3#4#5 { \tl_set:Nn #5 {#1} #3 #4 { \@@_pop:wN \prg_do_nothing: #2 \exp_not:o - , \q_mark \use_none:n - \q_stop + , \s_@@_mark \use_none:n + \s_@@_stop } } -\cs_new:Npn \@@_pop:wN #1 , \q_mark #2 #3 \q_stop { #2 {#1} } +\cs_new:Npn \@@_pop:wN #1 , \s_@@_mark #2 #3 \s_@@_stop { #2 {#1} } \cs_generate_variant:Nn \clist_pop:NN { c } \cs_generate_variant:Nn \clist_gpop:NN { c } % \end{macrocode} @@ -1246,7 +1281,7 @@ \if_meaning:w #1 \c_empty_clist \prg_return_false: \else: - \exp_after:wN \@@_get:wN #1 , \q_stop #2 + \exp_after:wN \@@_get:wN #1 , \s_@@_stop #2 \prg_return_true: \fi: } @@ -1260,7 +1295,7 @@ \if_meaning:w #2 \c_empty_clist \prg_return_false: \else: - \exp_after:wN \@@_pop:wwNNN #2 , \q_mark \q_stop #1#2#3 + \exp_after:wN \@@_pop:wwNNN #2 , \s_@@_mark \s_@@_stop #1#2#3 \prg_return_true: \fi: } @@ -1364,13 +1399,13 @@ % the expanded comma list, and another copy of the \meta{item}. % The loop is controlled by the argument grabbed by % \cs{@@_remove_all:w}: when the item was found, -% the \cs{q_mark} delimiter used is the one inserted by -% \cs{@@_tmp:w}, and \cs{use_none_delimit_by_q_stop:w} +% the \cs{s_@@_mark} delimiter used is the one inserted by +% \cs{@@_tmp:w}, and \cs{@@_use_none_delimit_by_s_stop:w} % is deleted. At the end, the final \meta{item} is % grabbed, and the argument of \cs{@@_tmp:w} contains -% \cs{q_mark}: in that case, \cs{@@_remove_all:w} -% removes the second \cs{q_mark} (inserted by \cs{@@_tmp:w}), -% and lets \cs{use_none_delimit_by_q_stop:w} act. +% \cs{s_@@_mark}: in that case, \cs{@@_remove_all:w} +% removes the second \cs{s_@@_mark} (inserted by \cs{@@_tmp:w}), +% and lets \cs{@@_use_none_delimit_by_s_stop:w} act. % % No brace is lost because items are always grabbed with a leading comma. % The result of the first assignment has an extra leading comma, @@ -1396,13 +1431,13 @@ \cs_set:Npn \@@_tmp:w ##1 , #4 , { ##1 - , \q_mark , \use_none_delimit_by_q_stop:w , + , \s_@@_mark , \@@_use_none_delimit_by_s_stop:w , \@@_remove_all: } #2 #3 { \exp_after:wN \@@_remove_all: - #3 , \q_mark , #4 , \q_stop + #3 , \s_@@_mark , #4 , \s_@@_stop } \clist_if_empty:NF #3 { @@ -1416,7 +1451,7 @@ } \cs_new:Npn \@@_remove_all: { \exp_after:wN \@@_remove_all:w \@@_tmp:w , } -\cs_new:Npn \@@_remove_all:w #1 , \q_mark , #2 , { \exp_not:n {#1} } +\cs_new:Npn \@@_remove_all:w #1 , \s_@@_mark , #2 , { \exp_not:n {#1} } \cs_generate_variant:Nn \clist_remove_all:Nn { c } \cs_generate_variant:Nn \clist_gremove_all:Nn { c } % \end{macrocode} @@ -1448,19 +1483,19 @@ % \begin{macro}[EXP]{\clist_reverse:n} % \begin{macro}[EXP]{\@@_reverse:wwNww, \@@_reverse_end:ww} % The reversed token list is built one item at a time, and stored -% between \cs{q_stop} and \cs{q_mark}, in the form of |?| followed by +% between \cs{s_@@_stop} and \cs{s_@@_mark}, in the form of |?| followed by % zero or more instances of \enquote{\meta{item}\texttt{,}}. We start from a comma % list \enquote{\meta{item_1}\texttt{,\ldots,}\meta{item_n}}. During the loop, % the auxiliary \cs{@@_reverse:wwNww} receives \enquote{\texttt{?}\meta{item_i}} as % |#1|, \enquote{\meta{item_{i+1}}\texttt{,\ldots,}\meta{item_n}} as |#2|, -% \cs{@@_reverse:wwNww} as |#3|, what remains until \cs{q_stop} as +% \cs{@@_reverse:wwNww} as |#3|, what remains until \cs{s_@@_stop} as % |#4|, and \enquote{\meta{item_{i-1}}\texttt{,\ldots,}\meta{item_1}\texttt{,}} as |#5|. % The auxiliary moves |#1| just before |#5|, with a comma, and calls % itself (|#3|). After the last item is moved, \cs{@@_reverse:wwNww} -% receives \enquote{\cs{q_mark} \cs{@@_reverse:wwNww} \texttt{!}} as its argument +% receives \enquote{\cs{s_@@_mark} \cs{@@_reverse:wwNww} \texttt{!}} as its argument % |#1|, thus \cs{@@_reverse_end:ww} as its argument |#3|. This second % auxiliary cleans up until the marker~|!|, removes the trailing comma -% (introduced when the first item was moved after \cs{q_stop}), and +% (introduced when the first item was moved after \cs{s_@@_stop}), and % leaves its argument~|#1| within \cs{exp_not:n}. There is also a % need to remove a leading comma, hence \cs{exp_not:o} and % \cs{use_none:n}. @@ -1468,14 +1503,14 @@ \cs_new:Npn \clist_reverse:n #1 { \@@_reverse:wwNww ? #1 , - \q_mark \@@_reverse:wwNww ! , - \q_mark \@@_reverse_end:ww - \q_stop ? \q_mark + \s_@@_mark \@@_reverse:wwNww ! , + \s_@@_mark \@@_reverse_end:ww + \s_@@_stop ? \s_@@_mark } \cs_new:Npn \@@_reverse:wwNww - #1 , #2 \q_mark #3 #4 \q_stop ? #5 \q_mark - { #3 ? #2 \q_mark #3 #4 \q_stop #1 , #5 \q_mark } -\cs_new:Npn \@@_reverse_end:ww #1 ! #2 , \q_mark + #1 , #2 \s_@@_mark #3 #4 \s_@@_stop ? #5 \s_@@_mark + { #3 ? #2 \s_@@_mark #3 #4 \s_@@_stop #1 , #5 \s_@@_mark } +\cs_new:Npn \@@_reverse_end:ww #1 ! #2 , \s_@@_mark { \exp_not:o { \use_none:n #2 } } % \end{macrocode} % \end{macro} @@ -1511,14 +1546,14 @@ % item is non-blank, exit: the second auxiliary grabs % \cs{prg_return_false:} as |#2|, unless every item in % the comma list was blank and the loop actually got broken -% by the trailing |\q_mark \prg_return_false:| item. +% by the trailing \cs{s_@@_mark} \cs{prg_return_false:} item. % \begin{macrocode} \prg_new_conditional:Npnn \clist_if_empty:n #1 { p , T , F , TF } { \@@_if_empty_n:w ? #1 - , \q_mark \prg_return_false: - , \q_mark \prg_return_true: - \q_stop + , \s_@@_mark \prg_return_false: + , \s_@@_mark \prg_return_true: + \s_@@_stop } \cs_new:Npn \@@_if_empty_n:w #1 , { @@ -1526,7 +1561,7 @@ { \@@_if_empty_n:w ? } { \@@_if_empty_n:wNw } } -\cs_new:Npn \@@_if_empty_n:wNw #1 \q_mark #2#3 \q_stop {#2} +\cs_new:Npn \@@_if_empty_n:wNw #1 \s_@@_mark #2#3 \s_@@_stop {#2} % \end{macrocode} % \end{macro} % \end{macro} @@ -1595,7 +1630,7 @@ % If the variable is empty, the mapping is skipped (otherwise, % that comma-list would be seen as consisting of one empty item). % Then loop over the comma-list, grabbing one comma-delimited -% item at a time. The end is marked by \cs{q_recursion_tail}. +% item at a time. The end is marked by \cs{q_@@_recursion_tail}. % The auxiliary function \cs{@@_map_function:Nw} is also used % in \cs{clist_map_inline:Nn}. % \begin{macrocode} @@ -1604,13 +1639,13 @@ \clist_if_empty:NF #1 { \exp_last_unbraced:NNo \@@_map_function:Nw #2 #1 - , \q_recursion_tail , + , \q_@@_recursion_tail , \prg_break_point:Nn \clist_map_break: { } } } \cs_new:Npn \@@_map_function:Nw #1#2 , { - \quark_if_recursion_tail_break:nN {#2} \clist_map_break: + \@@_if_recursion_tail_break:nN {#2} \clist_map_break: #1 {#2} \@@_map_function:Nw #1 } @@ -1634,12 +1669,12 @@ \cs_new:Npn \clist_map_function:nN #1#2 { \exp_after:wN \@@_map_function_n:Nn \exp_after:wN #2 - \exp:w \@@_trim_next:w \prg_do_nothing: #1 , \q_recursion_tail , + \exp:w \@@_trim_next:w \prg_do_nothing: #1 , \q_@@_recursion_tail , \prg_break_point:Nn \clist_map_break: { } } \cs_new:Npn \@@_map_function_n:Nn #1 #2 { - \quark_if_recursion_tail_break:nN {#2} \clist_map_break: + \@@_if_recursion_tail_break:nN {#2} \clist_map_break: \@@_map_unbrace:Nw #1 #2, \exp_after:wN \@@_map_function_n:Nn \exp_after:wN #1 \exp:w \@@_trim_next:w \prg_do_nothing: @@ -1675,7 +1710,7 @@ { @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1 {#2} \exp_last_unbraced:Nco \@@_map_function:Nw { @@_map_ \int_use:N \g__kernel_prg_map_int :w } - #1 , \q_recursion_tail , + #1 , \q_@@_recursion_tail , \prg_break_point:Nn \clist_map_break: { \int_gdecr:N \g__kernel_prg_map_int } } @@ -1702,7 +1737,7 @@ % The quark test is done before assigning the item to the variable: % this avoids storing a quark which the user wouldn't expect. % The strange \cs{use:n} avoids unlikely problems when |#2| would -% contain \cs{q_recursion_stop}. +% contain \cs{q_@@_recursion_stop}. % \begin{macrocode} \cs_new_protected:Npn \clist_map_variable:NNn #1#2#3 { @@ -1711,7 +1746,7 @@ \exp_args:Nno \use:nn { \@@_map_variable:Nnw #2 {#3} } #1 - , \q_recursion_tail , \q_recursion_stop + , \q_@@_recursion_tail , \q_@@_recursion_stop \prg_break_point:Nn \clist_map_break: { } } } @@ -1722,7 +1757,7 @@ } \cs_new_protected:Npn \@@_map_variable:Nnw #1#2#3, { - \quark_if_recursion_tail_stop:n {#3} + \@@_if_recursion_tail_stop:n {#3} \tl_set:Nn #1 {#3} \use:n {#2} \@@_map_variable:Nnw #1 {#2} @@ -1769,13 +1804,13 @@ { 0 \exp_not:N \@@_count:w \c_space_tl - #1 \exp_not:n { , \q_recursion_tail , \q_recursion_stop } + #1 \exp_not:n { , \q_@@_recursion_tail , \q_@@_recursion_stop } } } \cs_new:Npn \@@_count:n #1 { + 1 } \cs_new:Npx \@@_count:w #1 , { - \exp_not:n { \exp_args:Nf \quark_if_recursion_tail_stop:n } {#1} + \exp_not:n { \exp_args:Nf \@@_if_recursion_tail_stop:n } {#1} \exp_not:N \tl_if_blank:nF {#1} { + 1 } \exp_not:N \@@_count:w \c_space_tl } @@ -1801,15 +1836,15 @@ % quarks), 5: the rest of the comma list, 6: a \meta{continuation} % function (\texttt{use_ii} or \texttt{use_iii} with its % \meta{separator} argument), 7: junk, and 8: the temporary result, -% which is built in a brace group following \cs{q_stop}. The +% which is built in a brace group following \cs{q_@@_stop}. The % \meta{separator} and the first of the three items are placed in the % result, then we use the \meta{continuation}, placing the remaining % two items after it. When we begin this loop, the three items really -% belong to the comma list, the first \cs{q_mark} is taken as a +% belong to the comma list, the first \cs{q_@@_mark} is taken as a % delimiter to the \texttt{use_ii} function, and the continuation is % \texttt{use_ii} itself. When we reach the last two items of the -% original token list, \cs{q_mark} is taken as a third item, and now -% the second \cs{q_mark} serves as a delimiter to \texttt{use_ii}, +% original token list, \cs{q_@@_mark} is taken as a third item, and now +% the second \cs{q_@@_mark} serves as a delimiter to \texttt{use_ii}, % switching to the other \meta{continuation}, \texttt{use_iii}, which % uses the \meta{separator between final two}. % \begin{macrocode} @@ -1826,9 +1861,9 @@ { \exp_after:wN \@@_use:nwwwwnwn \exp_after:wN { \exp_after:wN } #1 , - \q_mark , { \@@_use:nwwwwnwn {#3} } - \q_mark , { \@@_use:nwwn {#4} } - \q_stop { } + \s_@@_mark , { \@@_use:nwwwwnwn {#3} } + \s_@@_mark , { \@@_use:nwwn {#4} } + \s_@@_stop { } } } { @@ -1839,9 +1874,9 @@ \cs_generate_variant:Nn \clist_use:Nnnn { c } \cs_new:Npn \@@_use:wwn #1 , #2 , #3 { \exp_not:n { #1 #3 #2 } } \cs_new:Npn \@@_use:nwwwwnwn - #1#2 , #3 , #4 , #5 \q_mark , #6#7 \q_stop #8 - { #6 {#3} , {#4} , #5 \q_mark , {#6} #7 \q_stop { #8 #1 #2 } } -\cs_new:Npn \@@_use:nwwn #1#2 , #3 \q_stop #4 + #1#2 , #3 , #4 , #5 \s_@@_mark , #6#7 \s_@@_stop #8 + { #6 {#3} , {#4} , #5 \s_@@_mark , {#6} #7 \s_@@_stop { #8 #1 #2 } } +\cs_new:Npn \@@_use:nwwn #1#2 , #3 \s_@@_stop #4 { \exp_not:n { #4 #1 #2 } } \cs_new:Npn \clist_use:Nn #1#2 { \clist_use:Nnnn #1 {#2} {#2} {#2} } @@ -1877,21 +1912,21 @@ \int_compare:nNnTF {#2} < 0 { \int_compare:nNnTF {#2} < { - #1 } - { \use_none_delimit_by_q_stop:w } + { \@@_use_none_delimit_by_s_stop:w } { \exp_args:Nf #4 { \int_eval:n { #2 + 1 + #1 } } } } { \int_compare:nNnTF {#2} > {#1} - { \use_none_delimit_by_q_stop:w } + { \@@_use_none_delimit_by_s_stop:w } { #4 {#2} } } - { } , #3 , \q_stop + { } , #3 , \s_@@_stop } \cs_generate_variant:Nn \@@_item:nnnN { ffo, ff } \cs_new:Npn \@@_item_N_loop:nw #1 #2, { \int_compare:nNnTF {#1} = 0 - { \use_i_delimit_by_q_stop:nw { \exp_not:n {#2} } } + { \@@_use_i_delimit_by_s_stop:nw { \exp_not:n {#2} } } { \exp_args:Nf \@@_item_N_loop:nw { \int_eval:n { #1 - 1 } } } } \cs_generate_variant:Nn \clist_item:Nn { c } @@ -1936,7 +1971,7 @@ } } } -\cs_new:Npn \@@_item_n_end:n #1 #2 \q_stop +\cs_new:Npn \@@_item_n_end:n #1 #2 \s_@@_stop { \tl_trim_spaces_apply:nN {#1} \@@_item_n_strip:n } \cs_new:Npn \@@_item_n_strip:n #1 { \@@_item_n_strip:w #1 , } \cs_new:Npn \@@_item_n_strip:w #1 , { \exp_not:n {#1} } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index fb7d09bcc7e..47fca974655 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx index 124d07bccd2..0555edc19cb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -147,6 +147,13 @@ % \end{macrocode} % \end{macro} % +% \begin{variable}{\s_@@_stop} +% Internal scan marks. +% \begin{macrocode} +\scan_new:N \s_@@_stop +% \end{macrocode} +% \end{variable} +% % \begin{macro}{\@@_select:n, \@@_select:V} % \begin{macro}{\@@_select:w} % \begin{macro} @@ -156,17 +163,17 @@ % higher-level experimental material. % \begin{macrocode} \cs_new_protected:Npn \@@_select:n #1 - { \@@_select:w #1 \q_stop } + { \@@_select:w #1 \s_@@_stop } \cs_generate_variant:Nn \@@_select:n { V } -\cs_new_protected:Npn \@@_select:w #1 ~ #2 \q_stop - { \use:c { @@_select_ #1 :w } #2 \q_stop } -\cs_new_protected:Npn \@@_select_cmyk:w #1 ~ #2 ~ #3 ~ #4 \q_stop +\cs_new_protected:Npn \@@_select:w #1 ~ #2 \s_@@_stop + { \use:c { @@_select_ #1 :w } #2 \s_@@_stop } +\cs_new_protected:Npn \@@_select_cmyk:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop { \@@_backend_cmyk:nnnn {#1} {#2} {#3} {#4} } -\cs_new_protected:Npn \@@_select_gray:w #1 \q_stop +\cs_new_protected:Npn \@@_select_gray:w #1 \s_@@_stop { \@@_backend_gray:n {#1} } -\cs_new_protected:Npn \@@_select_rgb:w #1 ~ #2 ~ #3 \q_stop +\cs_new_protected:Npn \@@_select_rgb:w #1 ~ #2 ~ #3 \s_@@_stop { \@@_backend_rgb:nnn {#1} {#2} {#3} } -\cs_new_protected:Npn \@@_select_spot:w #1 ~ #2 \q_stop +\cs_new_protected:Npn \@@_select_spot:w #1 ~ #2 \s_@@_stop { \@@_backend_spot:nn {#1} {#2} } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx index 2e80e1b8a36..df79d6a031d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -131,6 +131,37 @@ \ProvidesExplFile{l3debug.def}{2019-04-06}{}{L3 Debugging support} % \end{macrocode} % +% \begin{variable}{\s_@@_stop} +% Internal scan marks. +% \begin{macrocode} +\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_@@_recursion_tail,\q_@@_recursion_stop} +% Internal 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_stop:N} +% Functions to query recursion quarks. +% \begin{macrocode} +\cs_new:Npn \@@_use_none_delimit_by_q_recursion_stop:w + #1 \q_@@_recursion_stop { } +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\debug_on:n, \debug_off:n, \@@_all_on:, \@@_all_off:} % \begin{macrocode} \cs_set_protected:Npn \debug_on:n #1 @@ -314,9 +345,9 @@ { \exp_args:NNf \@@_chk_var_scope_aux:Nn #1 { \cs_to_str:N #2 } } \cs_new_protected:Npn \@@_chk_var_scope_aux:Nn #1#2 { - \if:w _ \use_i:nn \use_i_delimit_by_q_stop:nw #2 ? ? \q_stop + \if:w _ \use_i:nn \@@_use_i_delimit_by_s_stop:nw #2 ? ? \s_@@_stop \exp_after:wN \@@_chk_var_scope_aux:NNn - \use_i_delimit_by_q_stop:nw #2 ? \q_stop + \@@_use_i_delimit_by_s_stop:nw #2 ? \s_@@_stop #1 {#2} \else: \exp_args:Nc \@@_chk_var_scope_aux:NNn @@ -489,16 +520,16 @@ \cs_new:Npn \@@_build_parm_text:n #1 { \@@_arg_list_from_signature:nNN { 1 } \c_false_bool #1 - \q_recursion_tail \q_recursion_stop + \q_@@_recursion_tail \q_@@_recursion_stop } \cs_new:Npn \@@_build_arg_list:n #1 { \@@_arg_list_from_signature:nNN { 1 } \c_true_bool #1 - \q_recursion_tail \q_recursion_stop + \q_@@_recursion_tail \q_@@_recursion_stop } \cs_new:Npn \@@_arg_list_from_signature:nNN #1 #2 #3 { - \quark_if_recursion_tail_stop:N #3 + \@@_if_recursion_tail_stop:N #3 \@@_arg_check_invalid:N #3 \bool_if:NT #2 { \@@_arg_if_braced:NT #3 { \use_none:n } } \use:n { \c_hash_str \int_eval:n {#1} } @@ -523,7 +554,7 @@ \exp_end: } \cs_new:Npn \@@_parm_terminate:w - { \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \exp:w } + { \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \exp:w } \prg_new_conditional:Npnn \@@_arg_if_braced:N #1 { T } { \exp_args:Nf \@@_arg_if_braced:n { \@@_get_base_form:N #1 } } \cs_new:Npn \@@_arg_if_braced:n #1 @@ -649,7 +680,7 @@ ####2 \tl_to_str:n { -> } ####3 \c_backslash_str \tl_to_str:n { __debug_ } \cs_to_str:N #1 - ####4 \exp_not:N \q_mark + ####4 \s_@@_stop { \exp_not:N \exp_args:Nx \exp_not:N \tex_scantokens:D { @@ -663,7 +694,7 @@ } } } - \exp_after:wN \@@_tmp:w \cs_meaning:N #1 \q_mark + \exp_after:wN \@@_tmp:w \cs_meaning:N #1 \s_@@_stop } % \end{macrocode} % Some functions, however, won't work with the signature reading setup @@ -1380,7 +1411,7 @@ \__kernel_chk_expr:nNnN {##1} \tex_glueexpr:D { } \skip_if_finite:n ; \prg_return_false: - #1 ; \prg_return_true: \q_stop + #1 ; \prg_return_true: \s_@@_stop } } \exp_args:No \@@_tmp:w { \tl_to_str:n { fil } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index ab3f7a3dee8..f84e9faea3a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -109,15 +109,23 @@ % \end{macrocode} % \end{variable} % +% \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]{\@@_date_compare:nNnTF, \@@_date_compare_aux:w} % Expects |#1| and |#3| to be dates in the format YYYY-MM-DD (but % accepts YYYY or YYYY-MM too, filling in zeros for the missing data). % Compares them using |#2| (one of |<|, |=|, |>|). % \begin{macrocode} \cs_new:Npn \@@_date_compare:nNnTF #1#2#3 - { \@@_date_compare_aux:w #1 -0-0- \q_mark #2 #3 -0-0- \q_stop } + { \@@_date_compare_aux:w #1 -0-0- \s_@@_mark #2 #3 -0-0- \s_@@_stop } \cs_new:Npn \@@_date_compare_aux:w - #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop + #1 - #2 - #3 - #4 \s_@@_mark #5 #6 - #7 - #8 - #9 \s_@@_stop { \int_compare:nNnTF {#1} = {#6} { @@ -155,7 +163,7 @@ \exp_args:Nf \@@_date_compare:nNnTF { \exp_after:wN \@@_minus_six_months:w - \ExplLoaderFileDate -0-0- \q_stop + \ExplLoaderFileDate -0-0- \s_@@_stop } < {#1} { \bool_set_true:N \l_@@_grace_period_bool @@ -164,7 +172,7 @@ { \use_ii:nn } } } -\cs_new:Npn \@@_minus_six_months:w #1 - #2 - #3 - #4 \q_stop +\cs_new:Npn \@@_minus_six_months:w #1 - #2 - #3 - #4 \s_@@_stop { \int_compare:nNnTF {#2} > 6 { #1 - \int_eval:n { #2 - 6 } - #3 } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 94217cd8c52..9ef8771afb4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -79,7 +79,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % \maketitle % \tableofcontents % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index ab79ecabf17..044e3fbab5f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index 7eb3465b7c3..0841f43fc44 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -2165,6 +2165,35 @@ %<@@=cs> % \end{macrocode} % +% \begin{variable}{\s_@@_mark,\s_@@_stop} +% Internal scan marks. No \pkg{l3quark} yet, so do things by hand. +% \begin{macrocode} +\cs_new_eq:NN \s_@@_mark \scan_stop: +\cs_new_eq:NN \s_@@_stop \scan_stop: +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\q_@@_recursion_stop} +% Internal recursion quarks. No \pkg{l3quark} yet, so do things by hand. +% \begin{macrocode} +\cs_new:Npn \q_@@_recursion_stop { \q_@@_recursion_stop } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[EXP]{ +% \@@_use_none_delimit_by_s_stop:w, +% \@@_use_i_delimit_by_s_stop:nw, +% \@@_use_none_delimit_by_q_recursion_stop:w +% } +% Internal scan marks. +% \begin{macrocode} +\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { } +\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1} +\cs_new:Npn \@@_use_none_delimit_by_q_recursion_stop:w + #1 \q_@@_recursion_stop { } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\cs_generate_variant:Nn, \cs_generate_variant:cn} % \begin{arguments} % \item Base form of a function; \emph{e.g.},~\cs{tl_set:Nn} @@ -2189,7 +2218,7 @@ \exp_not:N #1 \tl_to_str:n {#2} , \exp_not:N \scan_stop: , - \exp_not:N \q_recursion_stop + \exp_not:N \q_@@_recursion_stop } } \cs_new_protected:Npn \cs_generate_variant:cn @@ -2217,7 +2246,7 @@ % \verb*|\protected |, \verb*|\protected\long |, |\first|, |\top|, % |\bot|, |\splittop|, or |\splitbot|, with |\| replaced by the % appropriate escape character. If |pr| appears in the part before -% |ma|, the first \cs{q_mark} is taken as an argument of the |wwNw| +% |ma|, the first \cs{s_@@_mark} is taken as an argument of the |wwNw| % auxiliary, and |#3| is \cs{cs_new_protected:Npx}, otherwise it % is \cs{cs_new:Npx}. % \begin{macrocode} @@ -2229,20 +2258,20 @@ \exp_not:N \else: \exp_not:N \exp_after:wN \exp_not:N \@@_generate_variant:ww \exp_not:N \token_to_meaning:N #1 \tl_to_str:n { ma } - \exp_not:N \q_mark - \exp_not:N \q_mark \cs_new_protected:Npx + \s_@@_mark + \s_@@_mark \cs_new_protected:Npx \tl_to_str:n { pr } - \exp_not:N \q_mark \cs_new:Npx - \exp_not:N \q_stop + \s_@@_mark \cs_new:Npx + \s_@@_stop \exp_not:N \fi: } \exp_last_unbraced:NNNNo \cs_new_protected:Npn \@@_generate_variant:ww - #1 { \tl_to_str:n { ma } } #2 \q_mark + #1 { \tl_to_str:n { ma } } #2 \s_@@_mark { \@@_generate_variant:wwNw #1 } \exp_last_unbraced:NNNNo \cs_new_protected:Npn \@@_generate_variant:wwNw - #1 { \tl_to_str:n { pr } } #2 \q_mark #3 #4 \q_stop + #1 { \tl_to_str:n { pr } } #2 \s_@@_mark #3 #4 \s_@@_stop { \cs_set_eq:NN \@@_tmp:w #3 } % \end{macrocode} % \end{macro} @@ -2265,7 +2294,7 @@ \if_meaning:w \c_false_bool #3 \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \fi: \@@_generate_variant:Nnnw #4 {#1}{#2} } @@ -2312,8 +2341,8 @@ % We compare the base and variant signatures one character at a time % within |x|-expansion. The result is given to % \cs{@@_generate_variant:wwNN} (defined later) in the form -% \meta{processed variant signature} \cs{q_mark} \meta{errors} -% \cs{q_stop} \meta{base function} \meta{new function}. If all went +% \meta{processed variant signature} \cs{s_@@_mark} \meta{errors} +% \cs{s_@@_stop} \meta{base function} \meta{new function}. If all went % well, \meta{errors} is empty; otherwise, it is a kernel error % message and some clean-up code. % @@ -2325,7 +2354,7 @@ \cs_new_protected:Npn \@@_generate_variant:Nnnw #1#2#3#4 , { \if_meaning:w \scan_stop: #4 - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \fi: \use:x { @@ -2333,11 +2362,11 @@ \@@_generate_variant_loop:nNwN { } #4 \@@_generate_variant_loop_end:nwwwNNnn - \q_mark + \s_@@_mark #3 ~ { ~ { } \fi: \@@_generate_variant_loop_long:wNNnn } ~ { } - \q_stop + \s_@@_stop \exp_not:N #1 {#2} {#4} } \@@_generate_variant:Nnnw #1 {#2} {#3} @@ -2407,7 +2436,7 @@ % argument: this empty brace group produces the correct signature for % the full variant. % \begin{macrocode} -\cs_new:Npn \@@_generate_variant_loop:nNwN #1#2#3 \q_mark #4 +\cs_new:Npn \@@_generate_variant_loop:nNwN #1#2#3 \s_@@_mark #4 { \if:w #2 #4 \exp_after:wN \@@_generate_variant_loop_same:w @@ -2426,7 +2455,7 @@ #1 \prg_do_nothing: #2 - \@@_generate_variant_loop:nNwN { } #3 \q_mark + \@@_generate_variant_loop:nNwN { } #3 \s_@@_mark } \cs_new:Npn \@@_generate_variant_loop_base:N #1 { @@ -2454,46 +2483,45 @@ #1 \prg_do_nothing: #2#3#4 { #3 { #1 \@@_generate_variant_same:N #2 } } \cs_new:Npn \@@_generate_variant_loop_end:nwwwNNnn - #1#2 \q_mark #3 ~ #4 \q_stop #5#6#7#8 + #1#2 \s_@@_mark #3 ~ #4 \s_@@_stop #5#6#7#8 { \scan_stop: \scan_stop: \fi: - \exp_not:N \q_mark - \exp_not:N \q_stop + \s_@@_mark \s_@@_stop \exp_not:N #6 \exp_not:c { #7 : #8 #1 #3 } } -\cs_new:Npn \@@_generate_variant_loop_long:wNNnn #1 \q_stop #2#3#4#5 +\cs_new:Npn \@@_generate_variant_loop_long:wNNnn #1 \s_@@_stop #2#3#4#5 { \exp_not:n { - \q_mark + \s_@@_mark \__kernel_msg_error:nnxx { kernel } { variant-too-long } {#5} { \token_to_str:N #3 } \use_none:nnn - \q_stop + \s_@@_stop #3 #3 } } \cs_new:Npn \@@_generate_variant_loop_invalid:NNwNNnn - #1#2 \fi: \fi: \fi: #3 \q_stop #4#5#6#7 + #1#2 \fi: \fi: \fi: #3 \s_@@_stop #4#5#6#7 { \fi: \fi: \fi: \exp_not:n { - \q_mark + \s_@@_mark \__kernel_msg_error:nnxxxx { kernel } { invalid-variant } {#7} { \token_to_str:N #5 } {#1} {#2} \use_none:nnn - \q_stop + \s_@@_stop #5 #5 } } \cs_new:Npn \@@_generate_variant_loop_special:NNwNNnn - #1#2#3 \q_stop #4#5#6#7 + #1#2#3 \s_@@_stop #4#5#6#7 { - #3 \q_stop #4 #5 {#6} {#7} + #3 \s_@@_stop #4 #5 {#6} {#7} \exp_not:n { \__kernel_msg_error:nnxxxx @@ -2534,7 +2562,7 @@ % combining the |\exp_args:N #3| variant and the base function. % \begin{macrocode} \cs_new_protected:Npn \@@_generate_variant:wwNN - #1 \q_mark #2 \q_stop #3#4 + #1 \s_@@_mark #2 \s_@@_stop #3#4 { #2 \cs_if_free:NT #4 @@ -2568,20 +2596,20 @@ \cs_new_protected:Npx \@@_generate_internal_variant:n #1 { \exp_not:N \@@_generate_internal_variant:wwnNwn - #1 \exp_not:N \q_mark + #1 \s_@@_mark { \cs_set_eq:NN \exp_not:N \@@_tmp:w \cs_new_protected:Npx } \cs_new_protected:cpn \use:x - \token_to_str:N x \exp_not:N \q_mark + \token_to_str:N x \s_@@_mark { } \cs_new:cpn \exp_not:N \tex_expanded:D - \exp_not:N \q_stop + \s_@@_stop {#1} } \exp_last_unbraced:NNNNo \cs_new_protected:Npn \@@_generate_internal_variant:wwnNwn #1 - { \token_to_str:N x } #2 \q_mark #3#4#5#6 \q_stop #7 + { \token_to_str:N x } #2 \s_@@_mark #3#4#5#6 \s_@@_stop #7 { #3 \cs_if_free:cT { exp_args:N #7 } @@ -2600,7 +2628,7 @@ \exp_after:wN \@@_generate_internal_test_aux:w \exp_after:wN #1 \fi: ##3 - \q_mark + \s_@@_mark { \use:x { @@ -2609,12 +2637,12 @@ } } #1 - \q_mark + \s_@@_mark { \exp_not:n { \@@_generate_internal_one_go:NNn ##1 ##2 {##3} } } - \q_stop + \s_@@_stop } \cs_new_protected:Npn \@@_generate_internal_test_aux:w - ##1 #1 ##2 \q_mark ##3 ##4 \q_stop {##3} + ##1 #1 ##2 \s_@@_mark ##3 ##4 \s_@@_stop {##3} \cs_if_exist:NTF \tex_expanded:D { \cs_new_eq:NN \@@_generate_internal_test:Nw @@ -2722,20 +2750,20 @@ \if_meaning:w \c_false_bool #3 \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } - \use_i_delimit_by_q_stop:nw + \@@_use_i_delimit_by_s_stop:nw \fi: \exp_after:wN \@@_generate_variant:w - \tl_to_str:n {#5} , \scan_stop: , \q_recursion_stop - \use_none_delimit_by_q_stop:w \q_mark {#1} {#2} {#4} \q_stop + \tl_to_str:n {#5} , \scan_stop: , \q_@@_recursion_stop + \@@_use_none_delimit_by_s_stop:w \s_@@_mark {#1} {#2} {#4} \s_@@_stop } \cs_new_protected:Npn \@@_generate_variant:w - #1 , #2 \q_mark #3#4#5 + #1 , #2 \s_@@_mark #3#4#5 { \if_meaning:w \scan_stop: #1 \scan_stop: - \if_meaning:w \q_nil #1 \q_nil + \if_meaning:w \q_@@_nil #1 \q_@@_nil \use_i:nnn \fi: - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \else: \cs_if_exist_use:cTF { @@_generate_variant_#1_form:nnn } { {#3} {#4} {#5} } @@ -2745,7 +2773,7 @@ {#1} { \token_to_str:c { #3 : #4 } } } \fi: - \@@_generate_variant:w #2 \q_mark {#3} {#4} {#5} + \@@_generate_variant:w #2 \s_@@_mark {#3} {#4} {#5} } \cs_new_protected:Npn \@@_generate_variant_p_form:nnn #1#2 { \cs_generate_variant:cn { #1 _p : #2 } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index a3e398c2e8b..c816d771fbe 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/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} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx index 4cd9eead10b..d48aac03f51 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index 8309ffad516..7a76d293869 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3format.ins b/Master/texmf-dist/source/latex/l3kernel/l3format.ins index a4f728a0d07..99e9389728f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3format.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3format.ins @@ -62,9 +62,9 @@ and all files in that bundle must be distributed together. \from{l3names.dtx} {initex} \from{l3basics.dtx} {initex} \from{l3expan.dtx} {initex} + \from{l3quark.dtx} {initex} \from{l3tl.dtx} {initex} \from{l3str.dtx} {initex} - \from{l3quark.dtx} {initex} \from{l3seq.dtx} {initex} % ======== FORMAT ONLY ========= \from{l3alloc.dtx} {initex} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index ce09c026277..725abc23b9e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index 44b55728cd9..02817722757 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -245,12 +245,27 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\s_@@_mark, \s_@@_stop} +% \begin{variable}{\s_@@_expr_mark, \s_@@_expr_stop} % Aliases of \cs{tex_relax:D}, used to terminate expressions. % \begin{macrocode} +\scan_new:N \s_@@_expr_mark +\scan_new:N \s_@@_expr_stop +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\s_@@_mark, \s_@@_stop} +% Generic scan marks used throughout the module. +% \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{macro} @@ -378,7 +393,7 @@ \@@_if_type_fp:NTwFw #1 \@@_use_ii_until_s:nnw \s_@@ { \@@_use_i_until_s:nw 4 } - \q_stop + \s_@@_stop } % \end{macrocode} % \end{macro} @@ -540,12 +555,12 @@ % % \begin{macro}[EXP]{\@@_if_type_fp:NTwFw} % Used as \cs{@@_if_type_fp:NTwFw} \meta{marker} \Arg{true code} -% \cs{s_@@} \Arg{false code} \cs{q_stop}, this test whether the +% \cs{s_@@} \Arg{false code} \cs{s_@@_stop}, this test whether the % \meta{marker} is \cs{s_@@} or not and runs the appropriate % \meta{code}. The very unusual syntax is for optimization purposes % as that function is used for all floating point operations. % \begin{macrocode} -\cs_new:Npn \@@_if_type_fp:NTwFw #1 \s_@@ #2 #3 \q_stop {#2} +\cs_new:Npn \@@_if_type_fp:NTwFw #1 \s_@@ #2 #3 \s_@@_stop {#2} % \end{macrocode} % \end{macro} % @@ -562,7 +577,7 @@ \@@_if_type_fp:NTwFw #1 \@@_array_if_all_fp_loop:w \s_@@ { \prg_break:n \use_iii:nnn } - \q_stop + \s_@@_stop } % \end{macrocode} % \end{macro} @@ -579,17 +594,17 @@ \@@_if_type_fp:NTwFw #1 { } \s_@@ { \@@_type_from_scan_other:N #1 } - \q_stop + \s_@@_stop } \cs_new:Npx \@@_type_from_scan_other:N #1 { \exp_not:N \exp_after:wN \exp_not:N \@@_type_from_scan:w - \exp_not:N \token_to_str:N #1 \exp_not:N \q_mark - \tl_to_str:n { s_@@ _? } \exp_not:N \q_mark \exp_not:N \q_stop + \exp_not:N \token_to_str:N #1 \s_@@_mark + \tl_to_str:n { s_@@ _? } \s_@@_mark \s_@@_stop } \exp_last_unbraced:NNNNo \cs_new:Npn \@@_type_from_scan:w #1 - { \tl_to_str:n { s_@@ } } #2 \q_mark #3 \q_stop {#2} + { \tl_to_str:n { s_@@ } } #2 \s_@@_mark #3 \s_@@_stop {#2} % \end{macrocode} % \end{macro} % @@ -614,7 +629,7 @@ \cs_end: #2 #3 } - \q_stop + \s_@@_stop } \exp_last_unbraced:NNNNo \cs_new:Npn \@@_change_func_type_aux:w #1 { \tl_to_str:n { @@ } } { } @@ -631,7 +646,7 @@ % \end{macro} % % \begin{macro}[EXP]{\@@_exp_after_any_f:Nnw, \@@_exp_after_any_f:nw} -% \begin{macro}[EXP]{\@@_exp_after_stop_f:nw} +% \begin{macro}[EXP]{\@@_exp_after_expr_stop_f:nw} % The |Nnw| function simply dispatches to the appropriate % \cs[no-index]{@@_exp_after\ldots{}_f:nw} with \enquote{\ldots{}} % (either empty or |_|\meta{type}) extracted from |#1|, which should @@ -649,10 +664,10 @@ \@@_if_type_fp:NTwFw #2 \@@_exp_after_f:nw \s_@@ { \@@_exp_after_any_f:Nnw #2 } - \q_stop + \s_@@_stop {#1} #2 } -\cs_new_eq:NN \@@_exp_after_stop_f:nw \use_none:nn +\cs_new_eq:NN \@@_exp_after_expr_stop_f:nw \use_none:nn % \end{macrocode} % \end{macro} % \end{macro} @@ -667,7 +682,7 @@ % \meta{fp_1} |;|\\ % \ldots{}\\ % \meta{fp_n} |;|\\ -% \cs{s_@@_stop} +% \cs{s_@@_expr_stop} % \end{quote} % \begin{macrocode} \cs_new:Npn \@@_exp_after_tuple_o:w @@ -679,7 +694,7 @@ \exp_after:wN \@@_tuple_chk:w \exp_after:wN { \exp:w \exp_end_continue_f:w - \@@_exp_after_array_f:w #2 \s_@@_stop + \@@_exp_after_array_f:w #2 \s_@@_expr_stop \exp_after:wN } \exp_after:wN ; \exp:w \exp_end_continue_f:w #1 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index 65165842fca..55823ba7fb2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index e070533c591..fc629937c47 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -111,11 +111,11 @@ \cs_new:Npn \@@_trim_zeros:w #1 ; { \@@_trim_zeros_loop:w #1 - ; \@@_trim_zeros_loop:w 0; \@@_trim_zeros_dot:w .; \s_stop + ; \@@_trim_zeros_loop:w 0; \@@_trim_zeros_dot:w .; \s_@@_stop } \cs_new:Npn \@@_trim_zeros_loop:w #1 0; #2 { #2 #1 ; #2 } \cs_new:Npn \@@_trim_zeros_dot:w #1 .; { \@@_trim_zeros_end:w #1 ; } -\cs_new:Npn \@@_trim_zeros_end:w #1 ; #2 \s_stop { #1 } +\cs_new:Npn \@@_trim_zeros_end:w #1 ; #2 \s_@@_stop { #1 } % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index 00ff6675023..a1defe98894 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -704,7 +704,7 @@ ; #2#3#4 0000 0000 ; } \cs_new:Npn \@@_exp_Taylor_ii:ww #1; #2; - { \@@_exp_Taylor_loop:www 10 ; #1 ; #1 ; \s_stop } + { \@@_exp_Taylor_loop:www 10 ; #1 ; #1 ; \s_@@_stop } \cs_new:Npn \@@_exp_Taylor_loop:www #1; #2; #3; { \if_int_compare:w #1 = 1 \exp_stop_f: @@ -719,7 +719,7 @@ #2 ; } } -\cs_new:Npn \@@_exp_Taylor_break:Nww #1 #2; #3 \s_stop +\cs_new:Npn \@@_exp_Taylor_break:Nww #1 #2; #3 \s_@@_stop { \@@_fixed_add_one:wN #2 ; } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index 2c906bf4802..8904c442005 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index 632346bc4a8..a503e3a3d49 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -125,8 +125,8 @@ { \if_charcode:w 0 \@@_if_type_fp:NTwFw - #1 { \use_i_delimit_by_q_stop:nw #3 \q_stop } - \s_@@ 1 \q_stop + #1 { \@@_use_i_delimit_by_s_stop:nw #3 \s_@@_stop } + \s_@@ 1 \s_@@_stop \prg_return_false: \else: \prg_return_true: @@ -181,8 +181,8 @@ \cs_new:Npn \@@_compare_back_any:ww #1#2; #3 { \@@_if_type_fp:NTwFw - #1 { \@@_if_type_fp:NTwFw #3 \use_i:nn \s_@@ \use_ii:nn \q_stop } - \s_@@ \use_ii:nn \q_stop + #1 { \@@_if_type_fp:NTwFw #3 \use_i:nn \s_@@ \use_ii:nn \s_@@_stop } + \s_@@ \use_ii:nn \s_@@_stop \@@_compare_back:ww { \cs:w @@ -416,9 +416,9 @@ % \begin{macrocode} \cs_new:Npn \@@_step:wwwN #1#2; #3#4; #5#6; #7 { - \@@_if_type_fp:NTwFw #1 { } \s_@@ \prg_break: \q_stop - \@@_if_type_fp:NTwFw #3 { } \s_@@ \prg_break: \q_stop - \@@_if_type_fp:NTwFw #5 { } \s_@@ \prg_break: \q_stop + \@@_if_type_fp:NTwFw #1 { } \s_@@ \prg_break: \s_@@_stop + \@@_if_type_fp:NTwFw #3 { } \s_@@ \prg_break: \s_@@_stop + \@@_if_type_fp:NTwFw #5 { } \s_@@ \prg_break: \s_@@_stop \use_i:nnnn { \@@_step_fp:wwwN #1#2; #3#4; #5#6; #7 } \prg_break_point: \use:n @@ -683,15 +683,15 @@ \if_meaning:w \@@_parse_infix_::N #5 \if_charcode:w 0 \@@_if_type_fp:NTwFw - #2 { \use_i:nn \use_i_delimit_by_q_stop:nw #3 \q_stop } - \s_@@ 1 \q_stop + #2 { \use_i:nn \@@_use_i_delimit_by_s_stop:nw #3 \s_@@_stop } + \s_@@ 1 \s_@@_stop \exp_after:wN \exp_after:wN \exp_after:wN \@@_ternary_auxii:NwwN \else: \exp_after:wN \exp_after:wN \exp_after:wN \@@_ternary_auxi:NwwN \fi: \exp_after:wN #1 \exp:w \exp_end_continue_f:w - \@@_exp_after_array_f:w #4 \s_@@_stop + \@@_exp_after_array_f:w #4 \s_@@_expr_stop \exp_after:wN @ \exp:w \@@_parse_operand:Nw \c_@@_prec_colon_int @@ -702,7 +702,7 @@ \exp_after:wN \@@_parse_continue:NwN \exp_after:wN #1 \exp:w \exp_end_continue_f:w - \@@_exp_after_array_f:w #4 \s_@@_stop + \@@_exp_after_array_f:w #4 \s_@@_expr_stop \exp_after:wN #5 \exp_after:wN #1 \fi: @@ -712,7 +712,7 @@ \exp_after:wN \@@_parse_continue:NwN \exp_after:wN #1 \exp:w \exp_end_continue_f:w - \@@_exp_after_array_f:w #2 \s_@@_stop + \@@_exp_after_array_f:w #2 \s_@@_expr_stop #4 #1 } \cs_new:Npn \@@_ternary_auxii:NwwN #1#2@#3@#4 @@ -720,7 +720,7 @@ \exp_after:wN \@@_parse_continue:NwN \exp_after:wN #1 \exp:w \exp_end_continue_f:w - \@@_exp_after_array_f:w #3 \s_@@_stop + \@@_exp_after_array_f:w #3 \s_@@_expr_stop #4 #1 } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index 8c5a03bd24f..978d4dfe7f3 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -468,7 +468,7 @@ % \item If the next token is a control sequence with the meaning of % \cs{scan_stop:}, it can be: \cs{s_@@}, in which case our job is % done, as what follows is an internal floating point number, or -% \cs{s_@@_mark}, in which case the expression has come to an early +% \cs{s_@@_expr_mark}, in which case the expression has come to an early % end, as we are still looking for a number here, or something else, % in which case we consider the control sequence to be a bad % variable resulting from \texttt{c}-expansion. @@ -499,7 +499,7 @@ % operator. This goes as follows. % \begin{itemize} % \item If the next token is a control sequence, it could be the -% special marker \cs{s_@@_mark}, and +% special marker \cs{s_@@_expr_mark}, and % otherwise it is a case of juxtaposing numbers, such as % |2\c_zero_int|, with an implied multiplication. % \item If the next token is a letter, it is also a case of @@ -741,7 +741,7 @@ % \begin{macro}[EXP] % { % \@@_parse_one_fp:NN, -% \@@_exp_after_mark_f:nw, +% \@@_exp_after_expr_mark_f:nw, % \@@_exp_after_?_f:nw % } % This function receives a \meta{precedence} and a control sequence @@ -750,8 +750,8 @@ % \item \cs{s_@@} starts a floating point number, and we call % \cs{@@_exp_after_f:nw}, which |f|-expands after the floating % point. -% \item \cs{s_@@_mark} is a premature end, we call -% \cs{@@_exp_after_mark_f:nw}, which triggers an |fp-early-end| +% \item \cs{s_@@_expr_mark} is a premature end, we call +% \cs{@@_exp_after_expr_mark_f:nw}, which triggers an |fp-early-end| % error. % \item For a control sequence not containing \cs[no-index]{s_@@}, we call % \cs{@@_exp_after_?_f:nw}, causing a |bad-variable| error. @@ -776,7 +776,7 @@ \exp_after:wN #1 \exp:w \@@_parse_expand:w } } -\cs_new:Npn \@@_exp_after_mark_f:nw #1 +\cs_new:Npn \@@_exp_after_expr_mark_f:nw #1 { \int_case:nnF { \exp_after:wN \use_i:nnn \use_none:nnn #1 } { @@ -877,11 +877,11 @@ ; \exp_not:N \@@_parse_one_register_dim:ww \tl_to_str:n { pt } ; \exp_not:N \@@_parse_one_register_mu:www . \tl_to_str:n { pt } ; \exp_not:N \@@_parse_one_register_int:www - \exp_not:N \q_stop + \s_@@_stop } \exp_args:Nno \use:nn { \cs_new:Npn \@@_parse_one_register_auxii:wwwNw #1 . #2 } - { \tl_to_str:n { pt } #3 ; #4#5 \q_stop } + { \tl_to_str:n { pt } #3 ; #4#5 \s_@@_stop } { #4 #1.#2; } \exp_args:Nno \use:nn { \cs_new:Npn \@@_parse_one_register_mu:www #1 } @@ -1837,12 +1837,12 @@ % \begin{macrocode} \cs_new:Npn \@@_parse_apply_unary:NNNwN #1#2#3#4@#5 { - \@@_parse_apply_unary_chk:NwNw #4 @ ; . \q_stop + \@@_parse_apply_unary_chk:NwNw #4 @ ; . \s_@@_stop \@@_parse_apply_unary_type:NNN #3 #2 #4 @ \exp:w \exp_end_continue_f:w #5 #1 } -\cs_new:Npn \@@_parse_apply_unary_chk:NwNw #1#2 ; #3#4 \q_stop +\cs_new:Npn \@@_parse_apply_unary_chk:NwNw #1#2 ; #3#4 \s_@@_stop { \if_meaning:w @ #3 \else: \token_if_eq_meaning:NNTF . #3 @@ -1947,7 +1947,7 @@ \exp_not:N \token_if_eq_meaning:NNTF #3 \exp_not:c { @@_parse_infix_):N } { - \exp_not:N \@@_exp_after_array_f:w #2 \s_@@_stop + \exp_not:N \@@_exp_after_array_f:w #2 \s_@@_expr_stop \exp_not:N \exp_after:wN \exp_not:N \@@_parse_infix_after_paren:NN \exp_not:N \exp_after:wN #1 @@ -2116,7 +2116,7 @@ % in two steps. The \cs{@@_parse_operand:Nw} function performs % computations until reaching an operation with precedence % \cs{c_@@_prec_end_int} or less, namely, the end of the expression. The -% marker \cs{s_@@_mark} indicates that the next token is an already +% marker \cs{s_@@_expr_mark} indicates that the next token is an already % parsed version of an infix operator, and \cs{@@_parse_infix_end:N} % has infinitely negative precedence. Finally, clean up a % (well-defined) set of extra tokens and stop the initial expansion @@ -2129,12 +2129,12 @@ \exp:w \@@_parse_operand:Nw \c_@@_prec_end_int \@@_parse_expand:w #1 - \s_@@_mark \@@_parse_infix_end:N - \s_@@_stop + \s_@@_expr_mark \@@_parse_infix_end:N + \s_@@_expr_stop \exp_end: } \cs_new:Npn \@@_parse_after:ww - #1@ \@@_parse_infix_end:N \s_@@_stop #2 { #2 #1 } + #1@ \@@_parse_infix_end:N \s_@@_expr_stop #2 { #2 #1 } \cs_new:Npn \@@_parse_o:n #1 { \exp:w @@ -2142,8 +2142,8 @@ \exp:w \@@_parse_operand:Nw \c_@@_prec_end_int \@@_parse_expand:w #1 - \s_@@_mark \@@_parse_infix_end:N - \s_@@_stop + \s_@@_expr_mark \@@_parse_infix_end:N + \s_@@_expr_stop { \exp_end_continue_f:w \@@_exp_after_any_f:nw { \exp_after:wN \exp_stop_f: } @@ -2265,7 +2265,7 @@ { \if_catcode:w \scan_stop: \exp_not:N #2 \if_int_compare:w - \@@_str_if_eq:nn { \s_@@_mark } { \exp_not:N #2 } + \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } = 0 \exp_stop_f: \exp_after:wN \exp_after:wN \exp_after:wN \@@_parse_infix_mark:NNN @@ -2317,7 +2317,7 @@ { \if_catcode:w \scan_stop: \exp_not:N #2 \if_int_compare:w - \@@_str_if_eq:nn { \s_@@_mark } { \exp_not:N #2 } + \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } = 0 \exp_stop_f: \exp_after:wN \exp_after:wN \exp_after:wN \@@_parse_infix_mark:NNN @@ -2349,7 +2349,7 @@ % \subsubsection{Closing parentheses and commas} % % \begin{macro}[EXP]{\@@_parse_infix_mark:NNN} -% As an infix operator, \cs{s_@@_mark} means that the next +% As an infix operator, \cs{s_@@_expr_mark} means that the next % token~(|#3|) has already gone through \cs{@@_parse_infix:NN} and % should be provided the precedence~|#1|. The scan mark~|#2| is % discarded. @@ -2764,7 +2764,7 @@ \cs_new:Npn \@@_parse_function_one_two:nnw #1#2#3 { \@@_if_type_fp:NTwFw - #3 { } \s_@@ \@@_parse_function_one_two_error_o:w \q_stop + #3 { } \s_@@ \@@_parse_function_one_two_error_o:w \s_@@_stop \@@_parse_function_one_two_aux:nnw {#1} {#2} #3 } \cs_new:Npn \@@_parse_function_one_two_error_o:w #1#2#3#4 @ @@ -2786,7 +2786,7 @@ \fi: \@@_parse_function_one_two_error_o:w } - \q_stop + \s_@@_stop \@@_parse_function_one_two_auxii:nnw {#1} {#2} #3; #4 } \cs_new:Npn \@@_parse_function_one_two_auxii:nnw #1#2#3; #4; #5 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index 8ff26feeddc..11bf7d311d1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index 89453a55ca1..a5b0bc64859 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index 441a2e94360..51d25a090ee 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index 1a34892a4b2..156485e6286 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index b781dda55de..f9bcbee4677 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx index 74c09b293cc..d41c366b739 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index 6ec7cd65285..faab276e44a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1053,6 +1053,37 @@ % \end{macro} % \end{macro} % +% \begin{variable}{\s_@@_mark,\s_@@_stop} +% Scan marks used throughout the module. +% \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} +% Function to gobble until a scan mark. +% \begin{macrocode} +\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { } +% \end{macrocode} +% \end{macro} +% +% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop} +% Quarks for recursion. +% \begin{macrocode} +\quark_new:N \q_@@_recursion_tail +\quark_new:N \q_@@_recursion_stop +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[EXP]{\@@_if_recursion_tail_stop_do:Nn,\@@_if_recursion_tail_stop:N} +% Functions to query quarks. +% \begin{macrocode} +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:Nn +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N +% \end{macrocode} +% \end{macro} +% % \subsection{Integer expressions} % % \begin{macro}{\int_eval:n} @@ -1469,7 +1500,7 @@ \@@_compare_error: } \cs_new:Npn \@@_compare_error:Nw - #1#2 \q_stop + #1#2 \s_@@_stop { { } \c_zero_int \fi: @@ -1525,7 +1556,7 @@ % \cs{@@_compare:w} receives as its argument an integer, a relation % symbol, and some more tokens. We then setup the loop, which is % ended by the two odd-looking items |e| and |{=nd_}|, with a trailing -% \cs{q_stop} used to grab the entire argument when necessary. +% \cs{s_@@_stop} used to grab the entire argument when necessary. % \begin{macrocode} \prg_new_conditional:Npnn \int_compare:n #1 { p , T , F , TF } { @@ -1535,7 +1566,7 @@ \cs_new:Npn \@@_compare:w #1 \@@_compare_error: { \exp_after:wN \if_false: \int_value:w - \@@_compare:Nw #1 e { = nd_ } \q_stop + \@@_compare:Nw #1 e { = nd_ } \s_@@_stop } % \end{macrocode} % The goal here is to find an \meta{operand} and a \meta{comparison}. @@ -1552,13 +1583,13 @@ % \cs{scan_stop:}, ignored thanks to \tn{unexpanded}, and % \cs{@@_compare_error:Nw} raises an error. % \begin{macrocode} -\cs_new:Npn \@@_compare:Nw #1#2 \q_stop +\cs_new:Npn \@@_compare:Nw #1#2 \s_@@_stop { \exp_after:wN \@@_compare:NNw - \@@_to_roman:w - 0 #2 \q_mark - #1#2 \q_stop + \@@_to_roman:w - 0 #2 \s_@@_mark + #1#2 \s_@@_stop } -\cs_new:Npn \@@_compare:NNw #1#2#3 \q_mark +\cs_new:Npn \@@_compare:NNw #1#2#3 \s_@@_mark { \__kernel_exp_not:w \use:c @@ -1585,7 +1616,7 @@ % and call \cs{@@_compare:Nw} to look for additional operands, after % evaluating the following expression. % \begin{macrocode} -\cs_new:cpn { @@_compare_end_=:NNw } #1#2#3 e #4 \q_stop +\cs_new:cpn { @@_compare_end_=:NNw } #1#2#3 e #4 \s_@@_stop { {#3} \exp_stop_f: \prg_return_false: \else: \prg_return_true: \fi: @@ -1593,7 +1624,7 @@ \cs_new:Npn \@@_compare:nnN #1#2#3 { {#2} \exp_stop_f: - \prg_return_false: \exp_after:wN \use_none_delimit_by_q_stop:w + \prg_return_false: \exp_after:wN \@@_use_none_delimit_by_s_stop:w \fi: #1 #2 #3 \exp_after:wN \@@_compare:Nw \int_value:w \@@_eval:w } @@ -1665,14 +1696,14 @@ \exp_args:Nf \@@_case:nnTF { \int_eval:n {#1} } {#2} { } { } } \cs_new:Npn \@@_case:nnTF #1#2#3#4 - { \@@_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop } + { \@@_case:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop } \cs_new:Npn \@@_case:nw #1#2#3 { \int_compare:nNnTF {#1} = {#2} { \@@_case_end:nw {#3} } { \@@_case:nw {#1} } } -\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop +\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop { \exp_end: #1 #4 } % \end{macrocode} % \end{macro} @@ -2261,10 +2292,10 @@ % \subsection{Converting from other formats to integers} % % \begin{macro}[rEXP]{\@@_pass_signs:wn, \@@_pass_signs_end:wn} -% Called as \cs{@@_pass_signs:wn} \meta{signs and digits} \cs{q_stop} +% Called as \cs{@@_pass_signs:wn} \meta{signs and digits} \cs{s_@@_stop} % \Arg{code}, this function leaves in the input stream any sign it % finds, then inserts the \meta{code} before the first non-sign token -% (and removes \cs{q_stop}). More precisely, it deletes any~|+| and +% (and removes \cs{s_@@_stop}). More precisely, it deletes any~|+| and % passes any~|-| to the input stream, hence should be called in an % integer expression. % \begin{macrocode} @@ -2277,7 +2308,7 @@ \exp_after:wN #1 \fi: } -\cs_new:Npn \@@_pass_signs_end:wn #1 \q_stop #2 { #2 #1 } +\cs_new:Npn \@@_pass_signs_end:wn #1 \s_@@_stop #2 { #2 #1 } % \end{macrocode} % \end{macro} % @@ -2295,13 +2326,13 @@ \int_eval:n { \exp_after:wN \@@_pass_signs:wn \tl_to_str:n {#1} - \q_stop { \@@_from_alph:nN { 0 } } - \q_recursion_tail \q_recursion_stop + \s_@@_stop { \@@_from_alph:nN { 0 } } + \q_@@_recursion_tail \q_@@_recursion_stop } } \cs_new:Npn \@@_from_alph:nN #1#2 { - \quark_if_recursion_tail_stop_do:Nn #2 {#1} + \@@_if_recursion_tail_stop_do:Nn #2 {#1} \exp_args:Nf \@@_from_alph:nN { \int_eval:n { #1 * 26 + \@@_from_alph:N #2 } } } @@ -2327,13 +2358,13 @@ \int_eval:n { \exp_after:wN \@@_pass_signs:wn \tl_to_str:n {#1} - \q_stop { \@@_from_base:nnN { 0 } {#2} } - \q_recursion_tail \q_recursion_stop + \s_@@_stop { \@@_from_base:nnN { 0 } {#2} } + \q_@@_recursion_tail \q_@@_recursion_stop } } \cs_new:Npn \@@_from_base:nnN #1#2#3 { - \quark_if_recursion_tail_stop_do:Nn #3 {#1} + \@@_if_recursion_tail_stop_do:Nn #3 {#1} \exp_args:Nf \@@_from_base:nnN { \int_eval:n { #1 * #2 + \@@_from_base:N #3 } } {#2} @@ -2409,16 +2440,16 @@ ( 0 \exp_after:wN \@@_from_roman:NN \tl_to_str:n {#1} - \q_recursion_tail \q_recursion_tail \q_recursion_stop + \q_@@_recursion_tail \q_@@_recursion_tail \q_@@_recursion_stop ) } } \cs_new:Npn \@@_from_roman:NN #1#2 { - \quark_if_recursion_tail_stop:N #1 + \@@_if_recursion_tail_stop:N #1 \int_if_exist:cF { c_@@_from_roman_ #1 _int } { \@@_from_roman_error:w } - \quark_if_recursion_tail_stop_do:Nn #2 + \@@_if_recursion_tail_stop_do:Nn #2 { + \use:c { c_@@_from_roman_ #1 _int } } \int_if_exist:cF { c_@@_from_roman_ #2 _int } { \@@_from_roman_error:w } @@ -2436,7 +2467,7 @@ \@@_from_roman:NN #2 } } -\cs_new:Npn \@@_from_roman_error:w #1 \q_recursion_stop #2 +\cs_new:Npn \@@_from_roman_error:w #1 \q_@@_recursion_stop #2 { #2 * 0 - 1 } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx index 900151aa0c4..1c68482f551 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx index fa09742458f..d5cc6170ad4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -329,6 +329,104 @@ % and variable mappings. % \end{variable} % +% \begin{function}{\__kernel_quark_new_test:N} +% \begin{syntax} +% \cs{__kernel_quark_new_test:N} \cs[no-index]{\meta{name}:\meta{arg spec}} +% \end{syntax} +% Defines a quark-test function \cs[no-index]{\meta{name}:\meta{arg spec}} +% which tests if its argument is \cs[no-index]{q__\meta{namespace}_recursion_tail}, +% then acts accordingly, as described below for each possible +% \meta{arg spec}. +% +% The \meta{namespace} is determined as the first (nonempty) +% |_|-delimited word in \meta{name} and is used internally +% in the definition of auxiliaries. The function +% \cs{__kernel_quark_new_test:N} does \emph{not} define +% the \cs[no-index]{q__\meta{namespace}_recursion_tail} and +% \cs[no-index]{q__\meta{namespace}_recursion_stop} quarks. +% They should be manually defined with \cs{quark_new:N}. +% +% There are $6$ different types of quark-test functions. Which one is +% defined depends on the \meta{arg spec}, which \emph{must} be one of +% the options listed now. Four of them are modeled after +% \cs[no-index]{quark_if_recursion_tail:(N|n)} and +% \cs[no-index]{quark_if_recursion_tail_do:(N|n)n}. +% \begin{description} +% \def\makelabel#1{\texttt{#1}} +% \item[n] defines \cs[no-index]{\meta{name}:n} such that it +% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_recursion_tail}, and +% if so consumes all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop} +% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop:n}). +% \item[nn] defines \cs[no-index]{\meta{name}:nn} such that it +% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_recursion_tail}, and +% if so consumes all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop}, +% then executes the code |#2| after that +% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop_do:nn}). +% \item[N] defines \cs[no-index]{\meta{name}:N} such that it +% checks if |#1| is \cs[no-index]{q__\meta{namespace}_recursion_tail}, and if so consumes +% all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop} +% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop:N}). +% \item[Nn] defines \cs[no-index]{\meta{name}:Nn} such that it +% checks if |#1| is \cs[no-index]{q__\meta{namespace}_recursion_tail}, and if so consumes +% all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop}, then executes +% the code |#2| after that +% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop_do:Nn}). +% \end{description} +% The last two are modeled after +% \cs[no-index]{quark_if_recursion_tail_break:(n|N)N}, and in those +% cases the quark \cs[no-index]{q__\meta{namespace}_recursion_stop} is +% not used (and thus needs not be defined). +% \begin{description} +% \def\makelabel#1{\texttt{#1}} +% \item[nN] defines \cs[no-index]{\meta{name}:nN} such that it +% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_recursion_tail}, and +% if so uses the \cs[no-index]{\meta{type}_map_break:} function |#2|. +% \item[NN] defines \cs[no-index]{\meta{name}:NN} such that it +% checks if |#1| is \cs[no-index]{q__\meta{namespace}_recursion_tail}, and if so uses +% the \cs[no-index]{\meta{type}_map_break:} function |#2|. +% \end{description} +% Any other signature, as well as a function without signature +% are errors, and in such case the definition is aborted. +% \end{function} +% +% \begin{function}{\__kernel_quark_new_conditional:Nn} +% \begin{syntax} +% \cs{__kernel_quark_new_conditional:Nn} \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:\meta{arg spec}} \Arg{conditions} +% \end{syntax} +% Defines a collection of quark conditionals that test if their +% argument is the quark \cs[no-index]{q__\meta{namespace}_\meta{name}} +% and perform suitable actions. The \meta{conditions} are a +% comma-separated list of one or more of |p|, |T|, |F|, and |TF|, and +% one conditional is defined for each \meta{condition} in the list, as +% described for \cs{prg_new_conditional:Npnn}. The conditionals are +% defined using \cs{prg_new_conditional:Npnn}, so that their name is +% obtained by adding |p|, |T|, |F|, or |TF| to the base name +% \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:\meta{arg spec}}. +% +% The first argument of \cs{__kernel_quark_new_conditional:Nn} must +% contain |_quark_if_| and |:|, as these markers are used to determine +% the \meta{name} of the quark +% \cs[no-index]{q__\meta{namespace}_\meta{name}} to be tested. This +% quark should be manually defined with \cs{quark_new:N}, as +% \cs{__kernel_quark_new_conditional:Nn} does \emph{not} define it. +% +% The function \cs{__kernel_quark_new_conditional:Nn} can define $2$ +% different types of quark conditionals. Which one is defined depends +% on the \meta{arg spec}, which \emph{must} be one of the following +% options, modeled after \cs[no-index]{quark_if_nil:(N|n)(TF)}. +% \begin{description} +% \def\makelabel#1{\texttt{#1}} +% \item[n] defines \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:n(TF)} such that it +% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_\meta{name}}, and +% executes the proper conditional branch. +% \item[N] defines \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:N(TF)} such that it +% checks if |#1| is \cs[no-index]{q__\meta{namespace}_\meta{name}}, and +% executes the proper conditional branch. +% \end{description} +% Any other signature, as well as a function without signature +% are errors, and in such case the definition is aborted. +% \end{function} +% % \begin{variable}{\c__kernel_randint_max_int} % Maximal allowed argument to \cs{__kernel_randint:n}. Equal to % $2^{17}-1$. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index f00f95309c2..b3630af0b16 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -976,9 +976,7 @@ % argument. % \begin{macrocode} \cs_new:Npn \keyval_parse:NNn ##1 ##2 ##3 - { - \@@_loop_active:NNw ##1 ##2 \s_@@_mark ##3 #1 \s_@@_tail #1 - } + { \@@_loop_active:NNw ##1 ##2 \s_@@_mark ##3 #1 \s_@@_tail #1 } % \end{macrocode} % \end{macro} % @@ -1043,16 +1041,14 @@ % control to \cs[no-index]{@@_key_val:nnN}. % \begin{macrocode} \cs_new:Npn \@@_split_active:w ##1 #2 + { \@@_trim:nN { ##1 } \@@_split_active:nw \s_@@_mark } + \cs_new:Npn \@@_split_active:nw ##1 ##2 #2 ##3 \s_@@_stop { - \@@_trim:nN { ##1 } \@@_split_active:nw \s_@@_mark + \@@_if_empty:w \s_@@_mark ##3 \s_@@_stop + \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn + { \@@_misplaced_equal_error: \use_none:n } + { \@@_trim:nN { ##2 } \@@_key_val:nnN { ##1 } } } - \cs_new:Npn \@@_split_active:nw ##1 ##2 #2 ##3 \s_@@_stop - { - \@@_if_empty:w \s_@@_mark ##3 \s_@@_stop - \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn - { \@@_misplaced_equal_error: \use_none:n } - { \@@_trim:nN { ##2 } \@@_key_val:nnN { ##1 } } - } % \end{macrocode} % \end{macro} % \end{macro} @@ -1062,9 +1058,7 @@ % active equals sign and then runs the test for an empty argument. % \begin{macrocode} \cs_new:Npn \@@_if_has_equal_active:w ##1 #2 - { - \@@_if_empty:w \s_@@_mark - } + { \@@_if_empty:w \s_@@_mark } % \end{macrocode} % \end{macro} % @@ -1089,14 +1083,14 @@ \s_@@_mark \s_@@_tail \@@_loop_other:NNw #1 , \s_@@_tail , \@@_loop_active:NNw #2 \s_@@_mark - {} + { } \cs_new:Npn \@@_end_loop_other:w \s_@@_mark \s_@@_tail \@@_if_has_equal_other:w #1 = \s_@@_stop \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn #2 \@@_loop_other:NNw #3 \s_@@_mark - {} + { } % \end{macrocode} % \end{macro} % @@ -1106,16 +1100,14 @@ % equals signs of category other. % \begin{macrocode} \cs_new:Npn \@@_split_other:w #1 = + { \@@_trim:nN { #1 } \@@_split_other:nw \s_@@_mark } +\cs_new:Npn \@@_split_other:nw #1 #2 = #3 \s_@@_stop { - \@@_trim:nN { #1 } \@@_split_other:nw \s_@@_mark + \@@_if_empty:w \s_@@_mark #3 \s_@@_stop + \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn + { \@@_misplaced_equal_error: \use_none:n } + { \@@_trim:nN { #2 } \@@_key_val:nnN { #1 } } } - \cs_new:Npn \@@_split_other:nw #1 #2 = #3 \s_@@_stop - { - \@@_if_empty:w \s_@@_mark #3 \s_@@_stop - \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn - { \@@_misplaced_equal_error: \use_none:n } - { \@@_trim:nN { #2 } \@@_key_val:nnN { #1 } } - } % \end{macrocode} % \end{macro} % \end{macro} @@ -1126,9 +1118,7 @@ % them. % \begin{macrocode} \cs_new:Npn \@@_key:nN #1 #2 - { - \exp_not:n { #2 { #1 } } - } + { \exp_not:n { #2 { #1 } } } % \end{macrocode} % \end{macro} % @@ -1166,9 +1156,7 @@ \cs_new:Npn \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn #1 #2 { #2 } \cs_new:Npn \@@_blank_true:w \s_@@_mark \s_@@_stop \use:n #1 {} \cs_new:Npn \@@_empty_key:w \s_@@_mark \s_@@_stop \exp_not:n #1 - { - \@@_misplaced_equal_error: - } + { \@@_misplaced_equal_error: } % \end{macrocode} % \end{macro} % @@ -1176,9 +1164,7 @@ % Another test that works by gobbling tokens until a specific one is hit. % \begin{macrocode} \cs_new:Npn \@@_if_has_equal_other:w #1 = - { - \@@_if_empty:w \s_@@_mark - } + { \@@_if_empty:w \s_@@_mark } % \end{macrocode} % \end{macro} % @@ -1189,9 +1175,7 @@ % doesn't have to be fast anyway. % \begin{macrocode} \cs_new:Npn \@@_misplaced_equal_error: - { - \__kernel_msg_expandable_error:nn { kernel } { misplaced-equals-sign } - } + { \__kernel_msg_expandable_error:nn { kernel } { misplaced-equals-sign } } % \end{macrocode} % \end{macro} % @@ -1360,7 +1344,7 @@ % be explicitly no-value, it must be a token list. % \begin{macrocode} \tl_new:N \l_@@_relative_tl -\tl_set:Nn \l_@@_relative_tl { \q_no_value } +\tl_set:Nn \l_@@_relative_tl { \q_@@_no_value } % \end{macrocode} % \end{variable} % @@ -1412,6 +1396,46 @@ % \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,\q_@@_no_value} +% Internal quarks. +% \begin{macrocode} +\quark_new:N \q_@@_nil +\quark_new:N \q_@@_no_value +% \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 } +\__kernel_quark_new_conditional:Nn \@@_quark_if_no_value: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_stop:n} +% Functions to query recursion quarks. +% \begin{macrocode} +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:n +% \end{macrocode} +% \end{macro} +% % \subsection{The key defining mechanism} % % \begin{macro}{\keys_define:nn} @@ -1461,7 +1485,7 @@ \str_if_empty:NF \l_@@_property_str { \__kernel_msg_error:nnxx { kernel } { key-property-unknown } - { \l_@@_property_str } { \l_keys_path_str } + { \l_@@_property_str } { \l_keys_path_str } } } } @@ -1480,9 +1504,9 @@ { \str_set:Nx \l_@@_property_str { \@@_trim_spaces:n {#1} } \exp_after:wN \@@_property_find:w \l_@@_property_str . . - \q_stop {#1} + \s_@@_stop {#1} } -\cs_new_protected:Npn \@@_property_find:w #1 . #2 . #3 \q_stop #4 +\cs_new_protected:Npn \@@_property_find:w #1 . #2 . #3 \s_@@_stop #4 { \tl_if_blank:nTF {#3} { @@ -1496,18 +1520,18 @@ { \str_if_empty:NF \l_@@_module_str { \l_@@_module_str / } - \tl_trim_spaces:n {#1} + \tl_trim_spaces:n {#1} } \str_set:Nn \l_@@_property_str { . #2 } } { \str_set:Nx \l_keys_path_str { \l_@@_module_str / #1 . #2 } - \@@_property_search:w #3 \q_stop + \@@_property_search:w #3 \s_@@_stop } \tl_set_eq:NN \l_keys_path_tl \l_keys_path_str } } -\cs_new_protected:Npn \@@_property_search:w #1 . #2 \q_stop +\cs_new_protected:Npn \@@_property_search:w #1 . #2 \s_@@_stop { \str_if_eq:nnTF {#2} { . } { @@ -1516,7 +1540,7 @@ } { \str_set:Nx \l_keys_path_str { \l_keys_path_str . #1 } - \@@_property_search:w #2 \q_stop + \@@_property_search:w #2 \s_@@_stop } } % \end{macrocode} @@ -1536,18 +1560,18 @@ \bool_if:NTF \l_@@_no_value_bool { \exp_after:wN \@@_define_code:w - \l_@@_property_str \q_stop + \l_@@_property_str \s_@@_stop { \use:c { \c_@@_props_root_str \l_@@_property_str } } { \__kernel_msg_error:nnxx { kernel } { key-property-requires-value } { \l_@@_property_str } { \l_keys_path_str } - } + } } { \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} } } \exp_last_unbraced:NNNNo - \cs_new:Npn \@@_define_code:w #1 \c_colon_str #2 \q_stop + \cs_new:Npn \@@_define_code:w #1 \c_colon_str #2 \s_@@_stop { \tl_if_empty:nTF {#2} } % \end{macrocode} % \end{macro} @@ -1800,7 +1824,7 @@ \exp_after:wN \@@_find_key_module:NNw \exp_after:wN \l_@@_tmpa_tl \exp_after:wN \l_@@_tmpb_tl - \l_keys_path_str / \q_stop + \l_keys_path_str / \s_@@_stop \@@_cmd_set:nx { \l_keys_path_str } { \exp_not:c { prop_ #2 put:Nnn } @@ -2277,7 +2301,7 @@ \bool_set_false:N \exp_not:N \l_@@_filtered_bool \bool_set_false:N \exp_not:N \l_@@_selective_bool \tl_set:Nn \exp_not:N \l_@@_relative_tl - { \exp_not:N \q_no_value } + { \exp_not:N \q_@@_no_value } \@@_set:nn \exp_not:n { {#1} {#2} } \bool_if:NT \l_@@_only_known_bool { \bool_set_true:N \exp_not:N \l_@@_only_known_bool } @@ -2328,7 +2352,7 @@ \cs_new_protected:Npn \keys_set_known:nnN #1#2#3 { \exp_args:No \@@_set_known:nnnnN - \l_@@_unused_clist { \q_no_value } {#1} {#2} #3 + \l_@@_unused_clist { \q_@@_no_value } {#1} {#2} #3 } \cs_generate_variant:Nn \keys_set_known:nnN { nV , nv , no } \cs_new_protected:Npn \keys_set_known:nnnN #1#2#3#4 @@ -2345,7 +2369,7 @@ \tl_set:Nn \l_@@_unused_clist {#1} } \cs_new_protected:Npn \keys_set_known:nn #1#2 - { \@@_set_known:nnn { \q_no_value } {#1} {#2} } + { \@@_set_known:nnn { \q_@@_no_value } {#1} {#2} } \cs_generate_variant:Nn \keys_set_known:nn { nV , nv , no } \cs_new_protected:Npn \@@_set_known:nnn #1#2#3 { @@ -2406,7 +2430,7 @@ { \exp_args:No \@@_set_filter:nnnnnN \l_@@_unused_clist - { \q_no_value } {#1} {#2} {#3} #4 + { \q_@@_no_value } {#1} {#2} {#3} #4 } \cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno } \cs_new_protected:Npn \keys_set_filter:nnnnN #1#2#3#4#5 @@ -2423,7 +2447,7 @@ \tl_set:Nn \l_@@_unused_clist {#1} } \cs_new_protected:Npn \keys_set_filter:nnn #1#2#3 - {\@@_set_filter:nnnn { \q_no_value } {#1} {#2} {#3} } + {\@@_set_filter:nnnn { \q_@@_no_value } {#1} {#2} {#3} } \cs_generate_variant:Nn \keys_set_filter:nnn { nnV , nnv , nno } \cs_new_protected:Npn \@@_set_filter:nnnn #1#2#3#4 { @@ -2452,7 +2476,7 @@ \bool_set_false:N \exp_not:N \l_@@_filtered_bool \bool_set_true:N \exp_not:N \l_@@_selective_bool \tl_set:Nn \exp_not:N \l_@@_relative_tl - { \exp_not:N \q_no_value } + { \exp_not:N \q_@@_no_value } \@@_set_selective:nnn \exp_not:n { {#1} {#2} {#3} } \bool_if:NT \l_@@_only_known_bool { \bool_set_true:N \exp_not:N \l_@@_only_known_bool } @@ -2522,7 +2546,7 @@ \exp_after:wN \@@_find_key_module:NNw \exp_after:wN \l_@@_module_str \exp_after:wN \l_keys_key_str - \l_keys_path_str / \q_stop + \l_keys_path_str / \s_@@_stop \tl_set_eq:NN \l_keys_key_tl \l_keys_key_str \@@_value_or_default:n {#3} \bool_if:NTF \l_@@_selective_bool @@ -2531,7 +2555,7 @@ \str_set:Nn \l_@@_module_str {#1} } \cs_generate_variant:Nn \@@_set_keyval:nnn { o } -\cs_new_protected:Npn \@@_find_key_module:NNw #1#2#3 / #4 \q_stop +\cs_new_protected:Npn \@@_find_key_module:NNw #1#2#3 / #4 \s_@@_stop { \tl_if_blank:nTF {#4} { \str_set:Nn #2 {#3} } @@ -2541,7 +2565,7 @@ \str_if_empty:NF #1 { / } #3 } - \@@_find_key_module:NNw #1#2 #4 \q_stop + \@@_find_key_module:NNw #1#2 #4 \s_@@_stop } } % \end{macrocode} @@ -2722,12 +2746,12 @@ % When there is no relative path, things here are easy: just save the key % name and value. When we are working with a relative path, first we % need to turn it into a string: that can't happen earlier as we need -% to store \cs{q_no_value}. Then, use a standard delimited approach to fish +% to store \cs{q_@@_no_value}. Then, use a standard delimited approach to fish % out the partial path. % \begin{macrocode} \cs_new_protected:Npn \@@_store_unused: { - \quark_if_no_value:NTF \l_@@_relative_tl + \@@_quark_if_no_value:NTF \l_@@_relative_tl { \clist_put_right:Nx \l_@@_unused_clist { @@ -2758,7 +2782,7 @@ \cs_set_protected:Npn \@@_store_unused:w ####1 \l_@@_relative_tl / ####2 \l_@@_relative_tl / - ####3 \exp_not:N \q_stop + ####3 \s_@@_stop } { \tl_if_blank:nF {##1} @@ -2778,7 +2802,7 @@ { \@@_store_unused:w \l_keys_path_str \l_@@_relative_tl / \l_@@_relative_tl / - \exp_not:N \q_stop + \s_@@_stop } } \cs_new_protected:Npn \@@_store_unused:w { } @@ -2824,9 +2848,9 @@ % Used to strip off the ending part of the key path after the last~|/|. % \begin{macrocode} \cs_new:Npn \@@_parent:n #1 - { \@@_parent:w #1 / / \q_stop { } } + { \@@_parent:w #1 / / \s_@@_stop { } } \cs_generate_variant:Nn \@@_parent:n { o } -\cs_new:Npn \@@_parent:w #1 / #2 / #3 \q_stop #4 +\cs_new:Npn \@@_parent:w #1 / #2 / #3 \s_@@_stop #4 { \tl_if_blank:nTF {#2} { @@ -2834,7 +2858,7 @@ { \use_none:n #4 } } { - \@@_parent:w #2 / #3 \q_stop { #4 / #1 } + \@@_parent:w #2 / #3 \s_@@_stop { #4 / #1 } } } % \end{macrocode} @@ -2854,22 +2878,22 @@ \cs_new:Npn \@@_trim_spaces:n #1 { \exp_after:wN \@@_trim_spaces_auxi:w \tl_to_str:n {#1} - / \q_nil \q_stop + / \q_@@_nil \s_@@_stop } -\cs_new:Npn \@@_trim_spaces_auxi:w #1 / #2 \q_stop +\cs_new:Npn \@@_trim_spaces_auxi:w #1 / #2 \s_@@_stop { - \quark_if_nil:nTF {#2} + \@@_quark_if_nil:nTF {#2} { \tl_trim_spaces:n {#1} } { \@@_trim_spaces_auxii:w #1 / #2 } } -\cs_new:Npn \@@_trim_spaces_auxii:w #1 / #2 / \q_nil +\cs_new:Npn \@@_trim_spaces_auxii:w #1 / #2 / \q_@@_nil { \tl_trim_spaces:n {#1} - \@@_trim_spaces_auxiii:w #2 / \q_recursion_tail / \q_recursion_stop + \@@_trim_spaces_auxiii:w #2 / \q_@@_recursion_tail / \q_@@_recursion_stop } \cs_set:Npn \@@_trim_spaces_auxiii:w #1 / { - \quark_if_recursion_tail_stop:n {#1} + \@@_if_recursion_tail_stop:n {#1} / \tl_trim_spaces:n { #1 } \@@_trim_spaces_auxiii:w } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx index f1505be1b1c..1c017035de8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index c3a5ec49857..5b3c8243fe0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index 8dd4c2df83d..feb233bf54c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -525,6 +525,23 @@ % \end{macrocode} % \end{variable} % +% \subsection{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_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} +% % \subsection{Creating messages} % % Messages are created and used separately, so there two parts to @@ -1207,15 +1224,15 @@ { \tl_if_in:nnTF { ^^J #1 } { ^^J > ~ } { - \tl_if_in:nnTF { #1 \q_mark } { . \q_mark } + \tl_if_in:nnTF { #1 \s_@@_mark } { . \s_@@_mark } { \@@_show_dot:w } { \@@_show:w } - ^^J #1 \q_stop + ^^J #1 \s_@@_stop } { \@@_show:nn { ? #1 } { } } } - \cs_new:Npn \@@_show_dot:w #1 ^^J > ~ #2 . \q_stop + \cs_new:Npn \@@_show_dot:w #1 ^^J > ~ #2 . \s_@@_stop { \@@_show:nn {#1} {#2} } - \cs_new:Npn \@@_show:w #1 ^^J > ~ #2 \q_stop + \cs_new:Npn \@@_show:w #1 ^^J > ~ #2 \s_@@_stop { \@@_show:nn {#1} {#2} } \cs_new_protected:Npn \@@_show:nn #1#2 { @@ -1338,16 +1355,16 @@ { \seq_clear:N \l_@@_hierarchy_seq \@@_use_hierarchy:nwwN { } - #1 \q_mark \@@_use_hierarchy:nwwN - / \q_mark \use_none_delimit_by_q_stop:w - \q_stop + #1 \s_@@_mark \@@_use_hierarchy:nwwN + / \s_@@_mark \@@_use_none_delimit_by_s_stop:w + \s_@@_stop \@@_use_redirect_module:n { } } } -\cs_new_protected:Npn \@@_use_hierarchy:nwwN #1#2 / #3 \q_mark #4 +\cs_new_protected:Npn \@@_use_hierarchy:nwwN #1#2 / #3 \s_@@_mark #4 { \seq_put_left:Nn \l_@@_hierarchy_seq {#1} - #4 { #1 / #2 } #3 \q_mark #4 + #4 { #1 / #2 } #3 \s_@@_mark #4 } % \end{macrocode} % At this point, the items of \cs{l_@@_hierarchy_seq} are the @@ -1798,6 +1815,18 @@ \__kernel_msg_new:nnnn { kernel } { quote-in-shell } { Quotes~in~shell~command~'#1'. } { Shell~commands~cannot~contain~quotes~("). } +\__kernel_msg_new:nnnn { kernel } { invalid-quark-function } + { Quark~test~function~'#1'~is~invalid. } + { + \c__msg_coding_error_text_tl + LaTeX~has~been~asked~to~create~quark~test~function~'#1'~ + \tl_if_empty:nTF {#2} + { but~that~name~ } + { with~signature~'#2',~but~that~signature~ } + is~not~valid. + } +\__kernel_msg_new:nnn { kernel } { invalid-quark } + { Invalid~quark~variable~'#1'. } \__kernel_msg_new:nnnn { kernel } { scanmark-already-defined } { Scan~mark~#1~already~defined. } { @@ -1984,7 +2013,7 @@ % is an extra subtlety: if the user inserts tokens for error recovery, % they should be kept. Thus we also use an odd space character % (with category code $7$) and keep tokens until that space character, -% dropping everything else until \cs{q_stop}. The \cs{exp_end:} prevents +% dropping everything else until \cs{s_@@_stop}. The \cs{exp_end:} prevents % losing braces around the user-inserted text if any, and stops the % expansion of \cs{exp:w}. The group is used to prevent % |\LaTeX3~error:| from being globally equal to \cs{scan_stop:}. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 1ff80abdbf0..2878654f585 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index 1ea045aa74d..d14576f08c0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -778,8 +778,9 @@ % \begin{macro}{\if_bool:N} % \begin{macro}{\if_predicate:w} % Those two primitive \TeX{} conditionals are synonyms. +% \cs{if_bool:N} is defined in \pkg{l3basics}, as it's needed +% earlier to define quark test functions. % \begin{macrocode} -\cs_new_eq:NN \if_bool:N \tex_ifodd:D \cs_new_eq:NN \if_predicate:w \tex_ifodd:D % \end{macrocode} % \end{macro} @@ -916,6 +917,31 @@ % \end{macro} % \end{macro} % +% \subsection{Internal auxiliaries} +% +% \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_new_test:N \@@_if_recursion_tail_stop_do:nn +% \end{macrocode} +% \end{macro} +% % \begin{macro}[pTF]{\bool_if:N, \bool_if:c} % \UnitTested % Straight forward here. We could optimize here if we wanted to as @@ -1213,7 +1239,7 @@ % \texttt{false} expression, then the result is \texttt{true}. % \begin{macrocode} \cs_new:Npn \bool_lazy_all_p:n #1 - { \@@_lazy_all:n #1 \q_recursion_tail \q_recursion_stop } + { \@@_lazy_all:n #1 \q_@@_recursion_tail \q_@@_recursion_stop } \prg_new_conditional:Npnn \bool_lazy_all:n #1 { T , F , TF } { \if_predicate:w \bool_lazy_all_p:n {#1} @@ -1224,9 +1250,9 @@ } \cs_new:Npn \@@_lazy_all:n #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \c_true_bool } + \@@_if_recursion_tail_stop_do:nn {#1} { \c_true_bool } \bool_if:nF {#1} - { \use_i_delimit_by_q_recursion_stop:nw { \c_false_bool } } + { \@@_use_i_delimit_by_q_recursion_stop:nw { \c_false_bool } } \@@_lazy_all:n } % \end{macrocode} @@ -1260,7 +1286,7 @@ % \texttt{true} expression, then the result is \texttt{false}. % \begin{macrocode} \cs_new:Npn \bool_lazy_any_p:n #1 - { \@@_lazy_any:n #1 \q_recursion_tail \q_recursion_stop } + { \@@_lazy_any:n #1 \q_@@_recursion_tail \q_@@_recursion_stop } \prg_new_conditional:Npnn \bool_lazy_any:n #1 { T , F , TF } { \if_predicate:w \bool_lazy_any_p:n {#1} @@ -1271,9 +1297,9 @@ } \cs_new:Npn \@@_lazy_any:n #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \c_false_bool } + \@@_if_recursion_tail_stop_do:nn {#1} { \c_false_bool } \bool_if:nT {#1} - { \use_i_delimit_by_q_recursion_stop:nw { \c_true_bool } } + { \@@_use_i_delimit_by_q_recursion_stop:nw { \c_true_bool } } \@@_lazy_any:n } % \end{macrocode} @@ -1606,10 +1632,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macrocode} -%<@@=prg> -% \end{macrocode} -% % \begin{variable}{\g__kernel_prg_map_int} % A nesting counter for mapping. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index 9cc9111f345..c586164260d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -617,6 +617,34 @@ % \end{macrocode} % \end{variable} % +% \subsection{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{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_stop:n} +% \begin{macro}[EXP]{\@@_if_recursion_tail_stop:o} +% Functions to query recursion quarks. +% \begin{macrocode} +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:n +\cs_generate_variant:Nn \@@_if_recursion_tail_stop:n { o } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Allocation and initialisation} % % \begin{macro}[tested = m3prop001]{\prop_new:N, \prop_new:c} @@ -718,9 +746,9 @@ % trailing~|=| that we added). For both splits trim spaces and call a % function (first \cs{@@_from_keyval_key:w} then % \cs{@@_from_keyval_value:w}), followed by the trimmed material, -% \cs{q_nil}, the subsequent part of the item, and the trailing |=|'s -% and \cs{q_stop}. After finding the \meta{key} just store it after -% \cs{q_stop}. After finding the \meta{value} ignore completely empty +% \cs{s_@@_mark}, the subsequent part of the item, and the trailing |=|'s +% and \cs{s_@@_stop}. After finding the \meta{key} just store it after +% \cs{s_@@_stop}. After finding the \meta{value} ignore completely empty % items (both trailing~|=| were used as delimiters and all parts are % empty); if the remaining part~|#2| consists exactly of the second % trailing~|=| (namely there was exactly one |=|~in the item) then @@ -754,27 +782,27 @@ \cs_new_protected:Npn \@@_from_keyval:n #1 { \@@_from_keyval_loop:w \prg_do_nothing: #1 , - \q_recursion_tail , \q_recursion_stop + \q_@@_recursion_tail , \q_@@_recursion_stop } \cs_new_protected:Npn \@@_from_keyval_loop:w #1 , { - \quark_if_recursion_tail_stop:o {#1} + \@@_if_recursion_tail_stop:o {#1} \@@_from_keyval_split:Nw \@@_from_keyval_key:n - #1 = = \q_stop {#1} + #1 = = \s_@@_stop {#1} \@@_from_keyval_loop:w \prg_do_nothing: } \cs_new_protected:Npn \@@_from_keyval_split:Nw #1#2 = { \tl_trim_spaces_apply:oN {#2} #1 } \cs_new_protected:Npn \@@_from_keyval_key:n #1 - { \@@_from_keyval_key:w #1 \q_nil } -\cs_new_protected:Npn \@@_from_keyval_key:w #1 \q_nil #2 \q_stop + { \@@_from_keyval_key:w #1 \s_@@_mark } +\cs_new_protected:Npn \@@_from_keyval_key:w #1 \s_@@_mark #2 \s_@@_stop { \@@_from_keyval_split:Nw \@@_from_keyval_value:n - \prg_do_nothing: #2 \q_stop {#1} + \prg_do_nothing: #2 \s_@@_stop {#1} } \cs_new_protected:Npn \@@_from_keyval_value:n #1 - { \@@_from_keyval_value:w #1 \q_nil } -\cs_new_protected:Npn \@@_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4 + { \@@_from_keyval_value:w #1 \s_@@_mark } +\cs_new_protected:Npn \@@_from_keyval_value:w #1 \s_@@_mark #2 \s_@@_stop #3#4 { \tl_if_empty:nF { #3 #1 #2 } { @@ -808,7 +836,7 @@ % \begin{quote} % \cs{cs_set:Npn} \cs{@@_split_aux:w} |#1| \\ % \quad \cs{@@_pair:wn} \meta{key} \cs{s_@@} |#2| \\ -% \quad |#3| \cs{q_mark} |#4| |#5| \cs{q_stop} \\ +% \quad |#3| \cs{s_@@_mark} |#4| |#5| \cs{s_@@_stop} \\ % \quad |{| |#4| \Arg{true code} \Arg{false code} |}| % \end{quote} % @@ -829,10 +857,10 @@ \cs_new_protected:Npn \@@_split_aux:NnTF #1#2#3#4 { \cs_set:Npn \@@_split_aux:w ##1 - \@@_pair:wn #2 \s_@@ ##2 ##3 \q_mark ##4 ##5 \q_stop + \@@_pair:wn #2 \s_@@ ##2 ##3 \s_@@_mark ##4 ##5 \s_@@_stop { ##4 {#3} {#4} } - \exp_after:wN \@@_split_aux:w #1 \q_mark \use_i:nn - \@@_pair:wn #2 \s_@@ { } \q_mark \use_ii:nn \q_stop + \exp_after:wN \@@_split_aux:w #1 \s_@@_mark \use_i:nn + \@@_pair:wn #2 \s_@@ { } \s_@@_mark \use_ii:nn \s_@@_stop } \cs_new:Npn \@@_split_aux:w { } % \end{macrocode} @@ -1147,7 +1175,7 @@ % most often empty. When the \meta{key} is found in the list, % \cs{@@_if_in:N} receives \cs{@@_pair:wn}, and if it is % found as the extra item, the function receives -% \cs{q_recursion_tail}, easily recognizable. +% \cs{q_@@_recursion_tail}, easily recognizable. % % Here, \cs{prop_map_function:NN} is not sufficient for the mapping, % since it can only map a single token, and cannot carry the key that @@ -1157,7 +1185,7 @@ { \exp_last_unbraced:Noo \@@_if_in:nwwn { \tl_to_str:n {#2} } #1 \@@_pair:wn \tl_to_str:n {#2} \s_@@ { } - \q_recursion_tail + \q_@@_recursion_tail \prg_break_point: } \cs_new:Npn \@@_if_in:nwwn #1#2 \@@_pair:wn #3 \s_@@ #4 @@ -1168,7 +1196,7 @@ } \cs_new:Npn \@@_if_in:N #1 { - \if_meaning:w \q_recursion_tail #1 + \if_meaning:w \q_@@_recursion_tail #1 \prg_return_false: \else: \prg_return_true: diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index a6c66f1561e..f513fcb026a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -399,9 +399,25 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\quark_if_recursion_tail_stop:N} +% \begin{variable}{\s_@@} +% Private scan mark used in \pkg{l3quark}. We don't have \pkg{l3scan} +% yet, so we declare the scan mark here and add it to the scan mark pool +% later. +% \begin{macrocode} +\cs_new_eq:NN \s_@@ \scan_stop: +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\q_@@_nil} +% Private quark use for some tests. +% \begin{macrocode} +\quark_new:N \q_@@_nil +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[EXP]{\quark_if_recursion_tail_stop:N} % \UnitTested -% \begin{macro}{\quark_if_recursion_tail_stop_do:Nn} +% \begin{macro}[EXP]{\quark_if_recursion_tail_stop_do:Nn} % \UnitTested % When doing recursions, it is easy to spend a lot of time testing if the % end marker has been found. To avoid this, a dedicated end marker is used @@ -429,13 +445,13 @@ % \end{macro} % \end{macro} % -% \begin{macro} +% \begin{macro}[EXP] % {\quark_if_recursion_tail_stop:n, \quark_if_recursion_tail_stop:o} % \UnitTested -% \begin{macro} +% \begin{macro}[EXP] % {\quark_if_recursion_tail_stop_do:nn, \quark_if_recursion_tail_stop_do:on} % \UnitTested -% \begin{macro}{\@@_if_recursion_tail:w} +% \begin{macro}[EXP]{\@@_if_recursion_tail:w} % See \cs{quark_if_nil:nTF} for the details. Expanding % \cs{@@_if_recursion_tail:w} once in front of the tokens chosen here % gives an empty result if and only if |#1|~is exactly @@ -464,8 +480,8 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\quark_if_recursion_tail_break:NN} -% \begin{macro}{\quark_if_recursion_tail_break:nN} +% \begin{macro}[EXP]{\quark_if_recursion_tail_break:NN} +% \begin{macro}[EXP]{\quark_if_recursion_tail_break:nN} % Analogues of the \cs[index=quark_if_recursion_tail_stop:n] % {quark_if_recursion_tail_stop\ldots{}} functions. % Break the mapping using |#2|. @@ -574,6 +590,353 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\__kernel_quark_new_test:N} +% The function \cs{__kernel_quark_new_test:N} defines |#1| in a +% similar way as \cs[no-index]{quark_if_recursion_tail_...} functions +% (as described below), using +% \cs[no-index]{q__\meta{namespace}_recursion_tail} as the test quark +% and \cs[no-index]{q__\meta{namespace}_recursion_stop} as the +% delimiter quark, where the \meta{namespace} is determined as the +% first |_|-delimited part in~|#1|. +% +% There are six possible function types which this function can define, +% and which is defined depends on the signature of the function being +% defined: +% \begin{description} +% \def\makelabel#1{\texttt{:#1}~} +% \item[n] gives an analogue of \cs{quark_if_recursion_tail_stop:n} +% \item[nn] gives an analogue of \cs{quark_if_recursion_tail_stop_do:nn} +% \item[nN] gives an analogue of \cs{quark_if_recursion_tail_break:nN} +% \item[N] gives an analogue of \cs{quark_if_recursion_tail_stop:N} +% \item[Nn] gives an analogue of \cs{quark_if_recursion_tail_stop_do:Nn} +% \item[NN] gives an analogue of \cs{quark_if_recursion_tail_break:NN} +% \end{description} +% Any other signature causes an error, as does a function without signature. +% +% \begin{macro}{\__kernel_quark_new_conditional:Nn} +% Similar to \cs{__kernel_quark_new_test:N}, but defines quark +% branching conditionals like \cs{quark_if_nil:nTF} that test for the +% quark \cs[no-index]{q__\meta{namespace}_\meta{name}}. +% The \meta{namespace} and \meta{name} are determined from the +% conditional~|#1|, which must take the rather rigid form +% \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:\meta{arg spec}}. +% There are only two cases for the \meta{arg spec} here: +% \begin{description} +% \def\makelabel#1{\texttt{:#1}~} +% \item[n] gives an analogue of \cs[no-index]{quark_if_nil:n(TF)} +% \item[N] gives an analogue of \cs[no-index]{quark_if_nil:N(TF)} +% \end{description} +% Any other signature causes an error, as does a function without signature. +% We use low-level emptiness tests as \pkg{l3tl} is not available yet when these +% functions are used; thankfully we only care about whether strings +% are empty so a simple \cs{if_meaning:w} \cs{q_nil} \meta{string} +% \cs{q_nil} suffices. +% +% \begin{macro}{\@@_new_test:NNNn, \@@_new_test:Nccn, +% \@@_new_test_aux:nnNNnnnn} +% \begin{macro}{\@@_new_conditional:Nnnn, \@@_new_conditional:Nxxn} +% \begin{macrocode} +\cs_new_protected:Npn \__kernel_quark_new_test:N #1 + { \@@_new_test_aux:Nx #1 { \@@_module_name:N #1 } } +\cs_new_protected:Npn \@@_new_test_aux:Nn #1 #2 + { + \if_meaning:w \q_nil #2 \q_nil + \__kernel_msg_error:nnx { kernel } { invalid-quark-function } + { \token_to_str:N #1 } + \else: + \@@_new_test:Nccn #1 + { q__#2_recursion_tail } { q__#2_recursion_stop } { __#2 } + \fi: + } +\cs_generate_variant:Nn \@@_new_test_aux:Nn { Nx } +\cs_new_protected:Npn \@@_new_test:NNNn #1 + { + \exp_last_unbraced:Nf \@@_new_test_aux:nnNNnnnn + { \cs_split_function:N #1 } + #1 { test } + } +\cs_generate_variant:Nn \@@_new_test:NNNn { Ncc } +\cs_new_protected:Npn \__kernel_quark_new_conditional:Nn #1 + { + \@@_new_conditional:Nxxn #1 + { \@@_quark_conditional_name:N #1 } + { \@@_module_name:N #1 } + } +\cs_new_protected:Npn \@@_new_conditional:Nnnn #1#2#3#4 + { + \if_meaning:w \q_nil #2 \q_nil + \__kernel_msg_error:nnx { kernel } { invalid-quark-function } + { \token_to_str:N #1 } + \else: + \if_meaning:w \q_nil #3 \q_nil + \__kernel_msg_error:nnx { kernel } { invalid-quark-function } + { \token_to_str:N #1 } + \else: + \exp_last_unbraced:Nf \@@_new_test_aux:nnNNnnnn + { \cs_split_function:N #1 } + #1 { conditional } + {#2} {#3} {#4} + \fi: + \fi: + } +\cs_generate_variant:Nn \@@_new_conditional:Nnnn { Nxx } +\cs_new_protected:Npn \@@_new_test_aux:nnNNnnnn #1 #2 #3 #4 #5 + { + \cs_if_exist_use:cTF { @@_new_#5_#2:Nnnn } { #4 } + { + \__kernel_msg_error:nnxx { kernel } { invalid-quark-function } + { \token_to_str:N #4 } {#2} + \use_none:nnn + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{ +% \@@_new_test_n:Nnnn, \@@_new_test_nn:Nnnn, +% \@@_new_test_N:Nnnn, \@@_new_test_Nn:Nnnn, +% \@@_new_test_NN:Nnnn, \@@_new_test_NN:Nnnn, +% } +% These macros implement the six possibilities mentioned above, passing +% the right arguments to \cs{@@_new_test_aux_do:nNNnnnnNNn}, +% which defines some auxiliaries, and then to +% \cs{@@_new_test_define_tl:nNnNNn} (|:n(n)| variants) or to +% \cs{@@_new_test_define_ifx:nNnNNn} (|:N(n)|) which define the +% main conditionals. +% \begin{macrocode} +\cs_new_protected:Npn \@@_new_test_n:Nnnn #1 #2 #3 #4 + { + \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { none } { } { } { } + \@@_new_test_define_tl:nNnNNn #1 { } + } +\cs_new_protected:Npn \@@_new_test_nn:Nnnn #1 #2 #3 #4 + { + \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2} + \@@_new_test_define_tl:nNnNNn #1 { \use_none:n } + } +\cs_new_protected:Npn \@@_new_test_nN:Nnnn #1 #2 #3 #4 + { + \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2} + \@@_new_test_define_break_tl:nNNNNn #1 { } + } +\cs_new_protected:Npn \@@_new_test_N:Nnnn #1 #2 #3 #4 + { + \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { none } { } { } { } + \@@_new_test_define_ifx:nNnNNn #1 { } + } +\cs_new_protected:Npn \@@_new_test_Nn:Nnnn #1 #2 #3 #4 + { + \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2} + \@@_new_test_define_ifx:nNnNNn #1 + { \else: \exp_after:wN \use_none:n } + } +\cs_new_protected:Npn \@@_new_test_NN:Nnnn #1 #2 #3 #4 + { + \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2} + \@@_new_test_define_break_ifx:nNNNNn #1 { } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ +% \@@_new_test_aux_do:nNNnnnnNNn, +% \@@_test_define_aux:NNNNnnNNn +% } +% \cs{@@_new_test_aux_do:nNNnnnnNNn} makes the control sequence names +% which will be used by \cs{@@_test_define_aux:NNNNnnNNn}, and then later +% by \cs{@@_new_test_define_tl:nNnNNn} or +% \cs{@@_new_test_define_ifx:nNnNNn}. The control sequences defined +% here are analogous to \cs{@@_if_recursion_tail:w} and to +% \cs[no-index]{use_(none|i)_delimit_by_q_recursion_stop:(|n)w}. +% +% The name is composed by the name-space and the name of the quarks. +% Suppose \cs{__kernel_quark_new_test:N} was used with: +% \begin{verbatim} +% \__kernel_quark_new_test:N \__test_quark_tail:n +% \end{verbatim} +% then the first auxiliary will be \cs[no-index]{__test_quark_recursion_tail:w}, +% and the second one will be +% \cs[no-index]{__test_use_none_delimit_by_q_recursion_stop:w}. +% +% Note that the actual quarks are \emph{not} defined here. They should +% be defined separately using \cs{quark_new:N}. +% \begin{macrocode} +\cs_new_protected:Npn \@@_new_test_aux_do:nNNnnnnNNn #1 #2 #3 #4 #5 + { + \exp_args:Ncc \@@_test_define_aux:NNNNnnNNn + { #1 _quark_recursion_tail:w } + { #1 _use_ #4 _delimit_by_q_recursion_stop: #5 w } + #2 #3 + } +\cs_new_protected:Npn \@@_test_define_aux:NNNNnnNNn #1 #2 #3 #4 #5 #6 #7 + { + \cs_gset:Npn #1 ##1 #3 ##2 ? ##3 ?! { ##1 ##2 } + \cs_gset:Npn #2 ##1 #6 #4 {#5} + #7 {##1} #1 #2 #3 + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ +% \@@_new_test_define_tl:nNnNNn, +% \@@_new_test_define_ifx:nNnNNn +% } +% \begin{macro}{ +% \@@_new_test_define_break_tl:nNNNNn, +% \@@_new_test_define_break_ifx:nNNNNn +% } +% Finally, these two macros define the main conditional function using +% what's been set up before. +% \begin{macrocode} +\cs_new_protected:Npn \@@_new_test_define_tl:nNnNNn #1 #2 #3 #4 #5 #6 + { + \cs_new:Npn #5 #1 + { + \tl_if_empty:oTF + { #2 {} ##1 {} ?! #4 ??! } + {#3} {#6} + } + } +\cs_new_protected:Npn \@@_new_test_define_ifx:nNnNNn #1 #2 #3 #4 #5 #6 + { + \cs_new:Npn #5 #1 + { + \if_meaning:w #4 ##1 + \exp_after:wN #3 + #6 + \fi: + } + } +\cs_new_protected:Npn \@@_new_test_define_break_tl:nNNNNn #1 #2 #3 + { \@@_new_test_define_tl:nNnNNn {##1##2} #2 {##2} } +\cs_new_protected:Npn \@@_new_test_define_break_ifx:nNNNNn #1 #2 #3 + { \@@_new_test_define_ifx:nNnNNn {##1##2} #2 {##2} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{ +% \@@_new_conditional_n:Nnnn, +% \@@_new_conditional_N:Nnnn, +% } +% These macros implement the two possibilities for branching quark +% conditionals, passing +% the right arguments to \cs{@@_new_conditional_aux_do:NNnnn}, +% which defines some auxiliaries and defines the +% main conditionals. +% \begin{macrocode} +\cs_new_protected:Npn \@@_new_conditional_n:Nnnn + { \@@_new_conditional_aux_do:NNnnn \use_i:nn } +\cs_new_protected:Npn \@@_new_conditional_N:Nnnn + { \@@_new_conditional_aux_do:NNnnn \use_ii:nn } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ +% \@@_new_conditional_aux_do:NNnnn, +% \@@_new_conditional_define:NNNNn, +% } +% Similar to the previous macros, but branching conditionals only +% require one auxiliary, so we take a shortcut. In +% \cs{@@_new_conditional_define:NNNNn}, |#4| is \cs{use_i:nn} to +% define the \texttt{n}-type function (which needs an auxiliary) and +% is \cs{use_ii:nn} to define the \texttt{N}-type function. +% \begin{macrocode} +\cs_new_protected:Npn \@@_new_conditional_aux_do:NNnnn #1 #2 #3 #4 + { + \exp_args:Ncc \@@_new_conditional_define:NNNNn + { __ #4 _if_quark_ #3 :w } { q__ #4 _ #3 } #2 #1 + } +\cs_new_protected:Npn \@@_new_conditional_define:NNNNn #1 #2 #3 #4 #5 + { + #4 { \cs_gset:Npn #1 ##1 #2 ##2 ? ##3 ?! { ##1 ##2 } } { } + \exp_args:Nno \use:n { \prg_new_conditional:Npnn #3 ##1 {#5} } + { + #4 { \@@_if_empty_if:o { #1 {} ##1 {} ?! #2 ??! } } + { \if_meaning:w #2 ##1 } + \prg_return_true: \else: \prg_return_false: \fi: + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_module_name:N} +% \begin{macro}[EXP]{ +% \@@_module_name:w, +% \@@_module_name_loop:w, +% \@@_module_name_end:w +% } +% \cs{@@_module_name:N} takes a control sequence and returns its +% \meta{module} name, determined as the first non-empty +% non-single-character word, separated by |_| or~|:|. These rules +% give the correct result for public functions +% \cs[no-index]{\meta{module}_\ldots{}}, private functions +% \cs[no-index]{__\meta{module}_\ldots{}}, and variables such as +% \cs[no-index]{l_\meta{module}_\ldots{}}. If no valid module is +% found the result is an empty string. The approach is to first cut +% off everything after the (first) |:| if any is present, then +% repeatedly grab |_|-delimited words until finding one of length at +% least~$2$ (we use low-level tests as \pkg{l3tl} is not fully +% available when \cs{__kernel_quark_new_test:N} is first used. +% If no \meta{module} is found (such as in \cs{::n}) we +% get the trailing marker \cs{use_none:n} |{}|, which expands to +% nothing. +% \begin{macrocode} +\cs_set:Npn \@@_tmp:w #1#2 + { + \cs_new:Npn \@@_module_name:N ##1 + { + \exp_last_unbraced:Nf \@@_module_name:w + { \cs_to_str:N ##1 } #1 \s_@@ + } + \cs_new:Npn \@@_module_name:w ##1 #1 ##2 \s_@@ + { \@@_module_name_loop:w ##1 #2 \use_none:n { } #2 \s_@@ } + \cs_new:Npn \@@_module_name_loop:w ##1 #2 + { + \use_i_ii:nnn \if_meaning:w \prg_do_nothing: + ##1 \prg_do_nothing: \prg_do_nothing: + \exp_after:wN \@@_module_name_loop:w + \else: + \@@_module_name_end:w ##1 + \fi: + } + \cs_new:Npn \@@_module_name_end:w + ##1 \fi: ##2 \s_@@ { \fi: ##1 } + } +\exp_after:wN \@@_tmp:w \tl_to_str:n { : _ } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_quark_conditional_name:N, \@@_quark_conditional_name:w} +% \cs{@@_quark_conditional_name:N} determines the quark name that the quark +% conditional function~|##1| queries, as the part of the function name +% between |_quark_if_| and the trailing~|:|. Again we define it +% through \cs{@@_tmp:w}, which receives |:| as |#1| and |_quark_if_| +% as |#2|. The auxiliary \cs{@@_quark_conditional_name:w} returns the part +% between the first |_quark_if_| and the next~|:|, and we apply this +% auxiliary to the function name followed by |:| (in case the function +% name is lacking a signature), and |_quark_if_:| so that +% \cs{@@_quark_conditional_name:N} returns an empty string if |_quark_if_| is +% not present. +% \begin{macrocode} +\cs_set:Npn \@@_tmp:w #1 #2 \s_@@ + { + \cs_new:Npn \@@_quark_conditional_name:N ##1 + { + \exp_last_unbraced:Nf \@@_quark_conditional_name:w + { \cs_to_str:N ##1 } #1 #2 #1 \s_@@ + } + \cs_new:Npn \@@_quark_conditional_name:w + ##1 #2 ##2 #1 ##3 \s_@@ {##2} + } +\exp_after:wN \@@_tmp:w \tl_to_str:n { : _quark_if_ } \s_@@ +% \end{macrocode} +% \end{macro} +% % \subsection{Scan marks} % % \begin{macrocode} @@ -583,8 +946,9 @@ % \begin{variable}{\g_@@_marks_tl} % \UnitTested % The list of all scan marks currently declared. +% No \pkg{l3tl} yet, so define this by hand. % \begin{macrocode} -\tl_new:N \g_@@_marks_tl +\cs_gset:Npn \g_@@_marks_tl { } % \end{macrocode} % \end{variable} % @@ -612,12 +976,25 @@ % \UnitTested % We only declare one scan mark here, more can be defined % by specific modules. +% Can't use \cs{scan_new:N} yet because \pkg{l3tl} isn't loaded, +% so define \cs{s_stop} by hand and add it to \cs{g_@@_marks_tl}. +% We also add \cs{s__quark} (declared earlier) to the pool here. +% Since it lives in a different namespace, a little \pkg{l3docstrip} +% cheating is necessary. % \begin{macrocode} -\scan_new:N \s_stop +\cs_new_eq:NN \s_stop \scan_stop: +\cs_gset_nopar:Npx \g_@@_marks_tl + { + \exp_not:o \g_@@_marks_tl + \s_stop +%<@@=quark> + \s_@@ +%<@@=scan> + } % \end{macrocode} % \end{variable} % -% \begin{macro}{\use_none_delimit_by_s_stop:w} +% \begin{macro}[EXP]{\use_none_delimit_by_s_stop:w} % \UnitTested % Similar to \cs{use_none_delimit_by_q_stop:w}. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index 3b4fc4fbc88..7c2d8e7504a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1105,6 +1105,42 @@ % \end{macrocode} % \end{variable} % +% \subsubsection{Internal auxiliaries} +% +% \begin{variable}{\q_@@_recursion_stop} +% Internal recursion quarks. +% \begin{macrocode} +\quark_new:N \q_@@_recursion_stop +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[EXP]{ +% \@@_use_none_delimit_by_q_recursion_stop:w, +% \@@_use_i_delimit_by_q_recursion_stop:nw +% } +% Functions to gobble up to a quark. +% \begin{macrocode} +\cs_new:Npn \@@_use_none_delimit_by_q_recursion_stop:w + #1 \q_@@_recursion_stop { } +\cs_new:Npn \@@_use_i_delimit_by_q_recursion_stop:nw + #1 #2 \q_@@_recursion_stop {#1} +% \end{macrocode} +% \end{macro} +% +% \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 { F } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_break_point:TF} % \begin{macro}{\@@_break_true:w} % When testing whether a character of the query token list matches @@ -3242,7 +3278,7 @@ \tl_set:Nx \l_@@_internal_a_tl { \exp_after:wN \@@_compile_cs_aux:Nn \l_@@_internal_regex - \q_nil \q_nil \q_recursion_stop + \q_@@_nil \q_@@_nil \q_@@_recursion_stop } \exp_args:Nx \@@_compile_one:n { @@ -3260,12 +3296,13 @@ { \scan_stop: \@@_compile_cs_aux:NNnnnN #2 - \q_nil \q_nil \q_nil \q_nil \q_nil \q_nil \q_recursion_stop + \q_@@_nil \q_@@_nil \q_@@_nil + \q_@@_nil \q_@@_nil \q_@@_nil \q_@@_recursion_stop \@@_compile_cs_aux:Nn } { - \quark_if_nil:NF #1 { \flag_raise_if_clear:n { @@_cs } } - \use_none_delimit_by_q_recursion_stop:w + \@@_quark_if_nil:NF #1 { \flag_raise_if_clear:n { @@_cs } } + \@@_use_none_delimit_by_q_recursion_stop:w } } \cs_new:Npn \@@_compile_cs_aux:NNnnnN #1#2#3#4#5#6 @@ -3284,12 +3321,12 @@ \@@_compile_cs_aux:NNnnnN } { - \quark_if_nil:NF #1 + \@@_quark_if_nil:NF #1 { \flag_raise_if_clear:n { @@_cs } - \use_i_delimit_by_q_recursion_stop:nw + \@@_use_i_delimit_by_q_recursion_stop:nw } - \use_none_delimit_by_q_recursion_stop:w + \@@_use_none_delimit_by_q_recursion_stop:w } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index 071f202e81c..56c4bc1fda7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -985,6 +985,14 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\s_@@_mark,\s_@@_stop} +% Private scan marks. +% \begin{macrocode} +\scan_new:N \s_@@_mark +\scan_new:N \s_@@_stop +% \end{macrocode} +% \end{variable} +% % \begin{macro}{\@@_item:n} % The delimiter is always defined, but when used incorrectly simply % removes its argument and hits an undefined control sequence to @@ -1645,10 +1653,10 @@ \tl_set:Nx #2 { \exp_after:wN \@@_get_left:wnw - #1 \@@_item:n { \q_no_value } \q_stop + #1 \@@_item:n { \q_no_value } \s_@@_stop } } -\cs_new:Npn \@@_get_left:wnw #1 \@@_item:n #2#3 \q_stop +\cs_new:Npn \@@_get_left:wnw #1 \@@_item:n #2#3 \s_@@_stop { \exp_not:n {#2} } \cs_generate_variant:Nn \seq_get_left:NN { c } % \end{macrocode} @@ -1670,9 +1678,9 @@ \cs_new_protected:Npn \seq_gpop_left:NN { \@@_pop:NNNN \@@_pop_left:NNN \tl_gset:Nn } \cs_new_protected:Npn \@@_pop_left:NNN #1#2#3 - { \exp_after:wN \@@_pop_left:wnwNNN #2 \q_stop #1#2#3 } + { \exp_after:wN \@@_pop_left:wnwNNN #2 \s_@@_stop #1#2#3 } \cs_new_protected:Npn \@@_pop_left:wnwNNN - #1 \@@_item:n #2#3 \q_stop #4#5#6 + #1 \@@_item:n #2#3 \s_@@_stop #4#5#6 { #4 #5 { #1 #3 } \tl_set:Nn #6 {#2} @@ -1823,8 +1831,8 @@ % of being empty, terminating the loop and returning nothing at all. % \begin{macrocode} \cs_new:Npn \seq_item:Nn #1 - { \exp_after:wN \@@_item:wNn #1 \q_stop #1 } -\cs_new:Npn \@@_item:wNn \s_@@ #1 \q_stop #2#3 + { \exp_after:wN \@@_item:wNn #1 \s_@@_stop #1 } +\cs_new:Npn \@@_item:wNn \s_@@ #1 \s_@@_stop #2#3 { \exp_args:Nf \@@_item:nwn { \exp_args:Nf \@@_item:nN { \int_eval:n {#3} } #2 } @@ -2070,9 +2078,9 @@ } { \exp_after:wN \@@_use_setup:w #1 \@@_item:n - \q_mark { \@@_use:nwwwwnwn {#3} } - \q_mark { \@@_use:nwwn {#4} } - \q_stop { } + \s_@@_mark { \@@_use:nwwwwnwn {#3} } + \s_@@_mark { \@@_use:nwwn {#4} } + \s_@@_stop { } } } { @@ -2085,12 +2093,12 @@ \cs_new:Npn \@@_use_setup:w \s_@@ { \@@_use:nwwwwnwn { } } \cs_new:Npn \@@_use:nwwwwnwn #1 \@@_item:n #2 \@@_item:n #3 \@@_item:n #4#5 - \q_mark #6#7 \q_stop #8 + \s_@@_mark #6#7 \s_@@_stop #8 { #6 \@@_item:n {#3} \@@_item:n {#4} #5 - \q_mark {#6} #7 \q_stop { #8 #1 #2 } + \s_@@_mark {#6} #7 \s_@@_stop { #8 #1 #2 } } -\cs_new:Npn \@@_use:nwwn #1 \@@_item:n #2 #3 \q_stop #4 +\cs_new:Npn \@@_use:nwwn #1 \@@_item:n #2 #3 \s_@@_stop #4 { \exp_not:n { #4 #1 #2 } } \cs_new:Npn \seq_use:Nn #1#2 { \seq_use:Nnnn #1 {#2} {#2} {#2} } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index 152b90a3c0f..8cfd78d6f14 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1087,6 +1087,23 @@ % \end{macro} % \end{macro} % +% \subsection{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_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} +% % \subsection{Creating and initialising \texttt{dim} variables} % % \begin{macro}{\dim_new:N, \dim_new:c} @@ -1337,7 +1354,7 @@ \cs_new:Npn \@@_compare:w #1 \@@_compare_error: { \exp_after:wN \if_false: \exp:w \exp_end_continue_f:w - \@@_compare:wNN #1 ? { = \@@_compare_end:w \else: } \q_stop + \@@_compare:wNN #1 ? { = \@@_compare_end:w \else: } \s_@@_stop } \exp_args:Nno \use:nn { \cs_new:Npn \@@_compare:wNN #1 } { \tl_to_str:n {pt} #2#3 } @@ -1347,7 +1364,7 @@ \fi: #1 pt \exp_stop_f: \prg_return_false: - \exp_after:wN \use_none_delimit_by_q_stop:w + \exp_after:wN \@@_use_none_delimit_by_s_stop:w \fi: \reverse_if:N \if_dim:w #1 pt #2 \exp_after:wN \@@_compare:wNN @@ -1361,7 +1378,7 @@ #1 \reverse_if:N #2 < #3 = { #1 #2 > #3 } \cs_new:cpn { @@_compare_ > :w } #1 \reverse_if:N #2 > #3 = { #1 #2 < #3 } -\cs_new:Npn \@@_compare_end:w #1 \prg_return_false: #2 \q_stop +\cs_new:Npn \@@_compare_end:w #1 \prg_return_false: #2 \s_@@_stop { #1 \prg_return_false: \else: \prg_return_true: \fi: } \cs_new_protected:Npn \@@_compare_error: { @@ -1403,14 +1420,14 @@ \exp_args:Nf \@@_case:nnTF { \dim_eval:n {#1} } {#2} { } { } } \cs_new:Npn \@@_case:nnTF #1#2#3#4 - { \@@_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop } + { \@@_case:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop } \cs_new:Npn \@@_case:nw #1#2#3 { \dim_compare:nNnTF {#1} = {#2} { \@@_case_end:nw {#3} } { \@@_case:nw {#1} } } -\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop +\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop { \exp_end: #1 #4 } % \end{macrocode} % \end{macro} @@ -1766,6 +1783,13 @@ %<@@=skip> % \end{macrocode} % +% \begin{variable}{\s_@@_stop} +% Internal scan marks. +% \begin{macrocode} +\scan_new:N \s_@@_stop +% \end{macrocode} +% \end{variable} +% % \begin{macro}{\skip_new:N, \skip_new:c} % Allocation of a new internal registers. % \begin{macrocode} @@ -1914,9 +1938,9 @@ { \exp_after:wN \@@_if_finite:wwNw \skip_use:N \tex_glueexpr:D ##1 ; \prg_return_false: - #1 ; \prg_return_true: \q_stop + #1 ; \prg_return_true: \s_@@_stop } - \cs_new:Npn \@@_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \q_stop {##3} + \cs_new:Npn \@@_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \s_@@_stop {##3} } \exp_args:No \@@_tmp:w { \tl_to_str:n { fil } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index 2dbb5b69311..6b41acfe3ee 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -199,6 +199,14 @@ % \end{variable} % \end{variable} % +% \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} +% % \subsection{Finding available \tn{toks} registers} % % \begin{macro}{\@@_shrink_range:} @@ -555,7 +563,7 @@ \prg_do_nothing: \@@_return_mark:w \@@_return_mark:w - \q_mark + \s_@@_mark \@@_return_none_error: } % \end{macrocode} @@ -567,7 +575,7 @@ % Each comparison should call \cs{sort_return_same:} or % \cs{sort_return_swapped:} exactly once. If neither is called, % \cs{@@_return_none_error:} is called, since the \texttt{return_mark} -% removes tokens until \cs{q_mark}. If one is called, the +% removes tokens until \cs{s_@@_mark}. If one is called, the % \texttt{return_mark} auxiliary removes everything except % \cs{@@_return_same:w} (or its \texttt{swapped} analogue) followed by % \cs{@@_return_none_error:}. Finally if two or more are called, @@ -575,26 +583,26 @@ % so that it produces an error. % \begin{macrocode} \cs_new_protected:Npn \sort_return_same: - #1 \@@_return_mark:w #2 \q_mark + #1 \@@_return_mark:w #2 \s_@@_mark { #1 #2 \@@_return_two_error: \@@_return_mark:w - \q_mark + \s_@@_mark \@@_return_same:w } \cs_new_protected:Npn \sort_return_swapped: - #1 \@@_return_mark:w #2 \q_mark + #1 \@@_return_mark:w #2 \s_@@_mark { #1 #2 \@@_return_two_error: \@@_return_mark:w - \q_mark + \s_@@_mark \@@_return_swapped:w } -\cs_new_protected:Npn \@@_return_mark:w #1 \q_mark { } +\cs_new_protected:Npn \@@_return_mark:w #1 \s_@@_mark { } \cs_new_protected:Npn \@@_return_none_error: { \__kernel_msg_error:nnxx { kernel } { return-none } @@ -707,7 +715,7 @@ % \tl_if_blank:nF {#1} % { % \__sort:nnNnn { } { } #2 -% #1 \q_recursion_tail \q_recursion_stop +% #1 \q__sort_recursion_tail \q__sort_recursion_stop % } % } % \cs_new:Npn \__sort:nnNnn #1#2#3#4#5 @@ -742,7 +750,7 @@ % ~~~~~~\meta{extra arguments}\\ % ~~|}|\\ % \cs{@@_loop:wNn}~\ldots{}~\meta{prepared tokens}\\ -% ~~\meta{end-loop}~|{}|~\cs{q_stop} +% ~~\meta{end-loop}~|{}|~\cs{s_@@_stop} % \end{quote} % In this example, which matches the structure of % \cs{@@_quick_split_i:NnnnnNn} and a few other functions below, the @@ -782,13 +790,13 @@ % % The third speed up is to avoid |\use:ff| using a continuation-passing % style: \cs{@@_quick_split:NnNn} expects a list followed by -% \cs{q_mark} \Arg{code}, and expands to \meta{code} \meta{sorted list}. +% \cs{s_@@_mark} \Arg{code}, and expands to \meta{code} \meta{sorted list}. % Sorting the two parts of the list around the pivot is done with % \begin{quote} % \ttfamily -% \cs{@@_quick_split:NnNn} |#2| \ldots{} \cs{q_mark}\\ +% \cs{@@_quick_split:NnNn} |#2| \ldots{} \cs{s_@@_mark}\\ % ~~|{|\\ -% ~~~~\cs{@@_quick_split:NnNn} |#1| \ldots{} \cs{q_mark} \Arg{code}\\ +% ~~~~\cs{@@_quick_split:NnNn} |#1| \ldots{} \cs{s_@@_mark} \Arg{code}\\ % ~~~~\Arg{pivot}\\ % ~~|}| % \end{quote} @@ -823,7 +831,7 @@ % argument of the third \cs{use:n}, hence must remain in memory, and so % on. The memory consumption grows quadratically with the number of % nested \cs{use:n}. In practice, this means that we must read -% everything until a trailing \cs{q_stop} once in a while, otherwise +% everything until a trailing \cs{s_@@_stop} once in a while, otherwise % sorting lists of more than a few thousand items would exhaust a % typical \TeX{}'s memory. % @@ -846,8 +854,8 @@ % \texttt{prepare_end} auxiliary finds the prepared token list % as~|#4|. The scene is then set up for \cs{@@_quick_split:NnNn}, % which sorts the prepared list and perform the post action placed -% after \cs{q_mark}, namely removing the trailing \cs{s_stop} and -% \cs{q_stop} and leaving \cs{exp_stop_f:} to stop +% after \cs{s_@@_mark}, namely removing the trailing \cs{s_@@_stop} and +% \cs{s_@@_stop} and leaving \cs{exp_stop_f:} to stop % \texttt{f}-expansion. % \begin{macrocode} \cs_new:Npn \tl_sort:nN #1#2 @@ -859,7 +867,7 @@ \@@_quick_prepare:Nnnn #2 { } { } #1 { \prg_break_point: \@@_quick_prepare_end:NNNnw } - \q_stop + \s_@@_stop } } } @@ -868,13 +876,13 @@ \prg_break: #4 \prg_break_point: \@@_quick_prepare:Nnnn #1 { #2 #3 } { #1 {#4} } } -\cs_new:Npn \@@_quick_prepare_end:NNNnw #1#2#3#4#5 \q_stop +\cs_new:Npn \@@_quick_prepare_end:NNNnw #1#2#3#4#5 \s_@@_stop { \@@_quick_split:NnNn #4 \@@_quick_end:nnTFNn { } - \q_mark { \@@_quick_cleanup:w \exp_stop_f: } - \s_stop \q_stop + \s_@@_mark { \@@_quick_cleanup:w \exp_stop_f: } + \s_@@_mark \s_@@_stop } -\cs_new:Npn \@@_quick_cleanup:w #1 \s_stop \q_stop {#1} +\cs_new:Npn \@@_quick_cleanup:w #1 \s_@@_mark \s_@@_stop {#1} % \end{macrocode} % \end{macro} % \end{macro} @@ -961,9 +969,9 @@ % auxiliaries here) and another copy~|#6| of the fake item. All those % are discarded except the function~|#5|. This function receives % lists~|#1| and~|#2| of items less than or greater than the -% pivot~|#3|, then a continuation code~|#5| just after \cs{q_mark}. +% pivot~|#3|, then a continuation code~|#5| just after \cs{s_@@_mark}. % To avoid a memory problem described earlier, all of the ending -% functions read~|#6| until \cs{q_stop} and place~|#6| back into the +% functions read~|#6| until \cs{s_@@_stop} and place~|#6| back into the % input stream. When the lists |#1| and~|#2| are empty, the % \texttt{single} auxiliary simply places the continuation~|#5| before % the pivot~|{#3}|. When |#2|~is empty, |#1|~is sorted and placed @@ -976,30 +984,30 @@ % continuations are done in such a way to place the pivot in between. % \begin{macrocode} \cs_new:Npn \@@_quick_end:nnTFNn #1#2#3#4#5#6 {#5} -\cs_new:Npn \@@_quick_single_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop - { #5 {#3} #6 \q_stop } -\cs_new:Npn \@@_quick_only_i_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop +\cs_new:Npn \@@_quick_single_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop + { #5 {#3} #6 \s_@@_stop } +\cs_new:Npn \@@_quick_only_i_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop { \@@_quick_split:NnNn #1 - \@@_quick_end:nnTFNn { } \q_mark {#5} + \@@_quick_end:nnTFNn { } \s_@@_mark {#5} {#3} - #6 \q_stop + #6 \s_@@_stop } -\cs_new:Npn \@@_quick_only_ii_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop +\cs_new:Npn \@@_quick_only_ii_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop { \@@_quick_split:NnNn #2 - \@@_quick_end:nnTFNn { } \q_mark { #5 {#3} } - #6 \q_stop + \@@_quick_end:nnTFNn { } \s_@@_mark { #5 {#3} } + #6 \s_@@_stop } -\cs_new:Npn \@@_quick_split_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop +\cs_new:Npn \@@_quick_split_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop { - \@@_quick_split:NnNn #2 \@@_quick_end:nnTFNn { } \q_mark + \@@_quick_split:NnNn #2 \@@_quick_end:nnTFNn { } \s_@@_mark { \@@_quick_split:NnNn #1 - \@@_quick_end:nnTFNn { } \q_mark {#5} + \@@_quick_end:nnTFNn { } \s_@@_mark {#5} {#3} } - #6 \q_stop + #6 \s_@@_stop } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx index 9092f8fdbc4..4620342091a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -286,6 +286,20 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\s_@@} +% Internal scan marks. +% \begin{macrocode} +\scan_new:N \s_@@ +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\q_@@_nil} +% Internal quarks. +% \begin{macrocode} +\quark_new:N \q_@@_nil +% \end{macrocode} +% \end{variable} +% % \begin{variable}{\g_@@_alias_prop} % To avoid needing one file per encoding/escaping alias, we keep track % of those in a property list. @@ -557,13 +571,13 @@ { \exp_after:wN \@@_convert_gmap_internal_loop:Nww \exp_after:wN #1 - \g_@@_result_tl \s__tl \q_stop \prg_break: \s__tl + \g_@@_result_tl \s_@@ \s_@@_stop \prg_break: \s_@@ \prg_break_point: } } -\cs_new:Npn \@@_convert_gmap_internal_loop:Nww #1 #2 \s__tl #3 \s__tl +\cs_new:Npn \@@_convert_gmap_internal_loop:Nww #1 #2 \s_@@ #3 \s_@@ { - \use_none_delimit_by_q_stop:w #3 \q_stop + \@@_use_none_delimit_by_s_stop:w #3 \s_@@_stop #1 {#3} \@@_convert_gmap_internal_loop:Nww #1 } @@ -626,7 +640,7 @@ % to a list of Unicode characters in an internal representation, % with items of the form % \begin{quote} -% \meta{bytes} \cs{s__tl} \meta{Unicode code point} \cs{s__tl} +% \meta{bytes} \cs{s_@@} \meta{Unicode code point} \cs{s_@@} % \end{quote} % where we have collected the \meta{bytes} which combined to form % this particular Unicode character, and the \meta{Unicode code @@ -679,12 +693,12 @@ #1 \tl_gset:Nx \g_@@_result_tl { \__kernel_str_to_other_fast:n {#4} } \exp_after:wN \@@_convert:wwwnn - \tl_to_str:n {#5} /// \q_stop + \tl_to_str:n {#5} /// \s_@@_stop { decode } { unescape } \prg_do_nothing: \@@_convert_decode_: \exp_after:wN \@@_convert:wwwnn - \tl_to_str:n {#6} /// \q_stop + \tl_to_str:n {#6} /// \s_@@_stop { encode } { escape } \use_ii_i:nn \@@_convert_encode_: @@ -721,7 +735,7 @@ % was given, and only the encoding, |#1|, should be performed. % \begin{macrocode} \cs_new_protected:Npn \@@_convert:wwwnn - #1 / #2 // #3 \q_stop #4#5 + #1 / #2 // #3 \s_@@_stop #4#5 { \@@_convert:nnn {enc} {#4} {#1} \@@_convert:nnn {esc} {#5} {#2} @@ -967,7 +981,7 @@ \cs_new_protected:Npn \@@_convert_decode_: { \@@_convert_gmap:N \@@_decode_native_char:N } \cs_new:Npn \@@_decode_native_char:N #1 - { #1 \s__tl \int_value:w `#1 \s__tl } + { #1 \s_@@ \int_value:w `#1 \s_@@ } % \end{macrocode} % \end{macro} % \end{macro} @@ -1039,7 +1053,7 @@ } } \cs_new:Npn \@@_decode_clist_char:n #1 - { #1 \s__tl \int_eval:n {#1} \s__tl } + { #1 \s_@@ \int_eval:n {#1} \s_@@ } % \end{macrocode} % \end{macro} % \end{macro} @@ -1115,11 +1129,11 @@ \int_zero:N \l_@@_internal_int \exp_last_unbraced:Nx \@@_decode_eight_bit_load:nn { \tl_use:c { c_@@_encoding_#1_tl } } - { \q_stop \prg_break: } { } + { \s_@@_stop \prg_break: } { } \prg_break_point: \exp_last_unbraced:Nx \@@_decode_eight_bit_load_missing:n { \tl_use:c { c_@@_encoding_#1_missing_tl } } - { \q_stop \prg_break: } + { \s_@@_stop \prg_break: } \prg_break_point: \flag_clear:n { str_error } \@@_convert_gmap:N \@@_decode_eight_bit_char:N @@ -1128,7 +1142,7 @@ } \cs_new_protected:Npn \@@_decode_eight_bit_load:nn #1#2 { - \use_none_delimit_by_q_stop:w #1 \q_stop + \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop \tex_dimen:D "#1 = \l_@@_internal_int sp \scan_stop: \tex_skip:D \l_@@_internal_int = "#1 sp \scan_stop: \tex_toks:D \l_@@_internal_int \exp_after:wN { \int_value:w "#2 } @@ -1137,7 +1151,7 @@ } \cs_new_protected:Npn \@@_decode_eight_bit_load_missing:n #1 { - \use_none_delimit_by_q_stop:w #1 \q_stop + \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop \tex_dimen:D "#1 = \l_@@_internal_int sp \scan_stop: \tex_skip:D \l_@@_internal_int = "#1 sp \scan_stop: \tex_toks:D \l_@@_internal_int \exp_after:wN @@ -1147,13 +1161,13 @@ } \cs_new:Npn \@@_decode_eight_bit_char:N #1 { - #1 \s__tl + #1 \s_@@ \if_int_compare:w \tex_dimen:D `#1 < \l_@@_internal_int \if_int_compare:w \tex_skip:D \tex_dimen:D `#1 = `#1 \exp_stop_f: \tex_the:D \tex_toks:D \tex_dimen:D \fi: \fi: - \int_value:w `#1 \s__tl + \int_value:w `#1 \s_@@ } % \end{macrocode} % \end{macro} @@ -1173,7 +1187,7 @@ \int_zero:N \l_@@_internal_int \exp_last_unbraced:Nx \@@_encode_eight_bit_load:nn { \tl_use:c { c_@@_encoding_#1_tl } } - { \q_stop \prg_break: } { } + { \s_@@_stop \prg_break: } { } \prg_break_point: \flag_clear:n { str_error } \@@_convert_gmap_internal:N \@@_encode_eight_bit_char:n @@ -1182,7 +1196,7 @@ } \cs_new_protected:Npn \@@_encode_eight_bit_load:nn #1#2 { - \use_none_delimit_by_q_stop:w #1 \q_stop + \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop \tex_dimen:D "#2 = \l_@@_internal_int sp \scan_stop: \tex_skip:D \l_@@_internal_int = "#2 sp \scan_stop: \exp_args:NNf \tex_toks:D \l_@@_internal_int @@ -1762,17 +1776,17 @@ { 32 } { 192 } { 16 } { 224 } { 8 } { 240 } - \q_stop + \s_@@_stop } -\cs_new:Npn \@@_encode_utf_viii_loop:wwnnw #1; #2; #3#4 #5 \q_stop +\cs_new:Npn \@@_encode_utf_viii_loop:wwnnw #1; #2; #3#4 #5 \s_@@_stop { \if_int_compare:w #1 < #3 \exp_stop_f: \@@_output_byte:n { #1 + #4 } - \exp_after:wN \use_none_delimit_by_q_stop:w + \exp_after:wN \@@_use_none_delimit_by_s_stop:w \fi: \exp_after:wN \@@_encode_utf_viii_loop:wwnnw \int_value:w \int_div_truncate:nn {#1} {64} ; #1 ; - #5 \q_stop + #5 \s_@@_stop \@@_output_byte:n { #2 - 64 * ( #1 - 2 ) } } % \end{macrocode} @@ -1949,7 +1963,7 @@ { #1 \if_int_compare:w `#1 < "C0 \exp_stop_f: - \s__tl + \s_@@ \if_int_compare:w `#1 < "80 \exp_stop_f: \int_value:w `#1 \else: @@ -1961,12 +1975,12 @@ \exp_after:wN \@@_decode_utf_viii_continuation:wwN \int_value:w \int_eval:n { `#1 - "C0 } \exp_after:wN \fi: - \s__tl - \use_none_delimit_by_q_stop:w {"80} {"800} {"10000} {"110000} \q_stop + \s_@@ + \@@_use_none_delimit_by_s_stop:w {"80} {"800} {"10000} {"110000} \s_@@_stop \@@_decode_utf_viii_start:N } \cs_new:Npn \@@_decode_utf_viii_continuation:wwN - #1 \s__tl #2 \@@_decode_utf_viii_start:N #3 + #1 \s_@@ #2 \@@_decode_utf_viii_start:N #3 { \use_none:n #3 \if_int_compare:w `#3 < @@ -1976,20 +1990,20 @@ \exp_after:wN \@@_decode_utf_viii_aux:wNnnwN \int_value:w \int_eval:n { #1 * "40 + `#3 - "80 } \exp_after:wN \else: - \s__tl + \s_@@ \flag_raise:n { str_missing } \flag_raise:n { str_error } \int_use:N \c_@@_replacement_char_int \fi: - \s__tl + \s_@@ #2 \@@_decode_utf_viii_start:N #3 } \cs_new:Npn \@@_decode_utf_viii_aux:wNnnwN - #1 \s__tl #2#3#4 #5 \@@_decode_utf_viii_start:N #6 + #1 \s_@@ #2#3#4 #5 \@@_decode_utf_viii_start:N #6 { \if_int_compare:w #1 < #4 \exp_stop_f: - \s__tl + \s_@@ \if_int_compare:w #1 < #3 \exp_stop_f: \flag_raise:n { str_overlong } \flag_raise:n { str_error } @@ -1998,13 +2012,13 @@ #1 \fi: \else: - \if_meaning:w \q_stop #5 + \if_meaning:w \s_@@_stop #5 \@@_decode_utf_viii_overflow:w #1 \fi: \exp_after:wN \@@_decode_utf_viii_continuation:wwN \int_value:w \int_eval:n { #1 - #4 } \exp_after:wN \fi: - \s__tl + \s_@@ #2 {#4} #5 \@@_decode_utf_viii_start:N } @@ -2017,10 +2031,10 @@ } \cs_new:Npn \@@_decode_utf_viii_end: { - \s__tl + \s_@@ \flag_raise:n { str_missing } \flag_raise:n { str_error } - \int_use:N \c_@@_replacement_char_int \s__tl + \int_use:N \c_@@_replacement_char_int \s_@@ \prg_break: } % \end{macrocode} @@ -2192,7 +2206,7 @@ % big-endianness. The three endianness cases are based on a common % auxiliary whose first argument is $1$ for big-endian and $2$ for % little-endian, and whose second argument, delimited by the scan mark -% \cs{s_stop}, is expanded once (the string may be long; passing +% \cs{s_@@_stop}, is expanded once (the string may be long; passing % \cs{g_@@_result_tl} as an argument before expansion is cheaper). % % The \cs{@@_decode_utf_xvi:Nw} function defines \cs{@@_tmp:w} to @@ -2202,13 +2216,13 @@ % \cs{@@_decode_utf_xvi_pair:NN} described below. % \begin{macrocode} \cs_new_protected:cpn { @@_convert_decode_utf16be: } - { \@@_decode_utf_xvi:Nw 1 \g_@@_result_tl \s_stop } + { \@@_decode_utf_xvi:Nw 1 \g_@@_result_tl \s_@@_stop } \cs_new_protected:cpn { @@_convert_decode_utf16le: } - { \@@_decode_utf_xvi:Nw 2 \g_@@_result_tl \s_stop } + { \@@_decode_utf_xvi:Nw 2 \g_@@_result_tl \s_@@_stop } \cs_new_protected:cpn { @@_convert_decode_utf16: } { \exp_after:wN \@@_decode_utf_xvi_bom:NN - \g_@@_result_tl \s_stop \s_stop \s_stop + \g_@@_result_tl \s_@@_stop \s_@@_stop \s_@@_stop } \cs_new_protected:Npn \@@_decode_utf_xvi_bom:NN #1#2 { @@ -2220,7 +2234,7 @@ { \@@_decode_utf_xvi:Nw 1 #1#2 } } } - \cs_new_protected:Npn \@@_decode_utf_xvi:Nw #1#2 \s_stop + \cs_new_protected:Npn \@@_decode_utf_xvi:Nw #1#2 \s_@@_stop { \flag_clear:n { str_error } \flag_clear:n { str_missing } @@ -2230,7 +2244,7 @@ \tl_gset:Nx \g_@@_result_tl { \exp_after:wN \@@_decode_utf_xvi_pair:NN - #2 \q_nil \q_nil + #2 \q_@@_nil \q_@@_nil \prg_break_point: } \@@_if_flag_error:nnx { str_error } { utf16-decode } { } @@ -2271,8 +2285,8 @@ % range $[\hexnum{DC}, \hexnum{DF}]$ (trail surrogate). The test is % similar to the test used for continuation bytes in the % \textsc{utf-8} decoding functions. In the case where |#4#5| is -% indeed a trail surrogate, leave |#1#2#4#5| \cs{s__tl} -% \meta{code~point} \cs{s__tl}, and remove the pair |#4#5| before +% indeed a trail surrogate, leave |#1#2#4#5| \cs{s_@@} +% \meta{code~point} \cs{s_@@}, and remove the pair |#4#5| before % looping with \cs{@@_decode_utf_xvi_pair:NN}. Otherwise, of course, % complain about the missing surrogate. % @@ -2281,13 +2295,13 @@ % \hexnum{DC00} - \hexnum{10000}$. % % Every time we read a pair of bytes, we test for the end-marker -% \cs{q_nil}. When reaching the end, we additionally check that the +% \cs{q_@@_nil}. When reaching the end, we additionally check that the % string had an even length. Also, if the end is reached when % expecting a trail surrogate, we treat that as a missing surrogate. % \begin{macrocode} \cs_new:Npn \@@_decode_utf_xvi_pair:NN #1#2 { - \if_meaning:w \q_nil #2 + \if_meaning:w \q_@@_nil #2 \@@_decode_utf_xvi_pair_end:Nw #1 \fi: \if_case:w @@ -2295,14 +2309,14 @@ \or: \exp_after:wN \@@_decode_utf_xvi_quad:NNwNN \or: \exp_after:wN \@@_decode_utf_xvi_extra:NNw \fi: - #1#2 \s__tl - \int_eval:n { "100 * \@@_tmp:w #1#2 + \@@_tmp:w #2#1 } \s__tl + #1#2 \s_@@ + \int_eval:n { "100 * \@@_tmp:w #1#2 + \@@_tmp:w #2#1 } \s_@@ \@@_decode_utf_xvi_pair:NN } \cs_new:Npn \@@_decode_utf_xvi_quad:NNwNN #1#2 #3 \@@_decode_utf_xvi_pair:NN #4#5 { - \if_meaning:w \q_nil #5 + \if_meaning:w \q_@@_nil #5 \@@_decode_utf_xvi_error:nNN { missing } #1#2 \@@_decode_utf_xvi_pair_end:Nw #4 \fi: @@ -2313,13 +2327,13 @@ \@@_tmp:w #4#5 < "E0 \fi: \exp_stop_f: - #1 #2 #4 #5 \s__tl + #1 #2 #4 #5 \s_@@ \int_eval:n { ( "100 * \@@_tmp:w #1#2 + \@@_tmp:w #2#1 - "D7F7 ) * "400 + "100 * \@@_tmp:w #4#5 + \@@_tmp:w #5#4 } - \s__tl + \s_@@ \exp_after:wN \use_i:nnn \else: \@@_decode_utf_xvi_error:nNN { missing } #1#2 @@ -2329,20 +2343,20 @@ \cs_new:Npn \@@_decode_utf_xvi_pair_end:Nw #1 \fi: { \fi: - \if_meaning:w \q_nil #1 + \if_meaning:w \q_@@_nil #1 \else: \@@_decode_utf_xvi_error:nNN { end } #1 \prg_do_nothing: \fi: \prg_break: } - \cs_new:Npn \@@_decode_utf_xvi_extra:NNw #1#2 \s__tl #3 \s__tl + \cs_new:Npn \@@_decode_utf_xvi_extra:NNw #1#2 \s_@@ #3 \s_@@ { \@@_decode_utf_xvi_error:nNN { extra } #1#2 } \cs_new:Npn \@@_decode_utf_xvi_error:nNN #1#2#3 { \flag_raise:n { str_error } \flag_raise:n { str_#1 } - #2 #3 \s__tl - \int_use:N \c_@@_replacement_char_int \s__tl + #2 #3 \s_@@ + \int_use:N \c_@@_replacement_char_int \s_@@ } % \end{macrocode} % \end{macro} @@ -2470,7 +2484,7 @@ % % The structure is similar to \textsc{utf-16} decoding functions. If % the endianness is not given, test the first $4$ bytes of the string -% (possibly \cs{s_stop} if the string is too short) for the presence +% (possibly \cs{s_@@_stop} if the string is too short) for the presence % of a byte-order mark. If there is a byte-order mark, use that % endianness, and remove the $4$ bytes, otherwise default to % big-endian, and leave the $4$ bytes in place. The @@ -2482,22 +2496,22 @@ % inside an \texttt{x}-expanding assignment to \cs{g_@@_result_tl}. % % The \texttt{_loop} auxiliary first checks for the end-of-string -% marker \cs{s_stop}, calling the \texttt{_end} auxiliary if -% appropriate. Otherwise, leave the \meta{4~bytes} \cs{s__tl} behind, +% marker \cs{s_@@_stop}, calling the \texttt{_end} auxiliary if +% appropriate. Otherwise, leave the \meta{4~bytes} \cs{s_@@} behind, % then check that the code point is not overflowing: the leading byte % must be $0$, and the following byte at most $16$. % % In the ending code, we check that there remains no byte: there -% should be nothing left until the first \cs{s_stop}. Break the map. +% should be nothing left until the first \cs{s_@@_stop}. Break the map. % \begin{macrocode} \cs_new_protected:cpn { @@_convert_decode_utf32be: } - { \@@_decode_utf_xxxii:Nw 1 \g_@@_result_tl \s_stop } + { \@@_decode_utf_xxxii:Nw 1 \g_@@_result_tl \s_@@_stop } \cs_new_protected:cpn { @@_convert_decode_utf32le: } - { \@@_decode_utf_xxxii:Nw 2 \g_@@_result_tl \s_stop } + { \@@_decode_utf_xxxii:Nw 2 \g_@@_result_tl \s_@@_stop } \cs_new_protected:cpn { @@_convert_decode_utf32: } { \exp_after:wN \@@_decode_utf_xxxii_bom:NNNN \g_@@_result_tl - \s_stop \s_stop \s_stop \s_stop \s_stop + \s_@@_stop \s_@@_stop \s_@@_stop \s_@@_stop \s_@@_stop } \cs_new_protected:Npn \@@_decode_utf_xxxii_bom:NNNN #1#2#3#4 { @@ -2509,7 +2523,7 @@ { \@@_decode_utf_xxxii:Nw 1 #1#2#3#4 } } } - \cs_new_protected:Npn \@@_decode_utf_xxxii:Nw #1#2 \s_stop + \cs_new_protected:Npn \@@_decode_utf_xxxii:Nw #1#2 \s_@@_stop { \flag_clear:n { str_overflow } \flag_clear:n { str_end } @@ -2518,17 +2532,17 @@ \tl_gset:Nx \g_@@_result_tl { \exp_after:wN \@@_decode_utf_xxxii_loop:NNNN - #2 \s_stop \s_stop \s_stop \s_stop + #2 \s_@@_stop \s_@@_stop \s_@@_stop \s_@@_stop \prg_break_point: } \@@_if_flag_error:nnx { str_error } { utf32-decode } { } } \cs_new:Npn \@@_decode_utf_xxxii_loop:NNNN #1#2#3#4 { - \if_meaning:w \s_stop #4 + \if_meaning:w \s_@@_stop #4 \exp_after:wN \@@_decode_utf_xxxii_end:w \fi: - #1#2#3#4 \s__tl + #1#2#3#4 \s_@@ \if_int_compare:w \@@_tmp:w #1#4 > 0 \exp_stop_f: \flag_raise:n { str_overflow } \flag_raise:n { str_error } @@ -2543,17 +2557,17 @@ { \@@_tmp:w #2#3*"10000 + \@@_tmp:w #3#2*"100 + \@@_tmp:w #4#1 } \fi: \fi: - \s__tl + \s_@@ \@@_decode_utf_xxxii_loop:NNNN } - \cs_new:Npn \@@_decode_utf_xxxii_end:w #1 \s_stop + \cs_new:Npn \@@_decode_utf_xxxii_end:w #1 \s_@@_stop { \tl_if_empty:nF {#1} { \flag_raise:n { str_end } \flag_raise:n { str_error } - #1 \s__tl - \int_use:N \c_@@_replacement_char_int \s__tl + #1 \s_@@ + \int_use:N \c_@@_replacement_char_int \s_@@ } \prg_break: } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index 66909707c0b..d4cbc2bb49f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -862,6 +862,46 @@ %<@@=str> % \end{macrocode} % +% \subsection{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_none_delimit_by_s_stop:w, +% \@@_use_i_delimit_by_s_stop:nw +% } +% Functions to gobble up to a scan mark. +% \begin{macrocode} +\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { } +\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1} +% \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_break:NN +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:Nn +% \end{macrocode} +% \end{macro} +% % \subsection{Creating and setting string variables} % % \begin{macro} @@ -978,7 +1018,7 @@ % issues if we are fed a token list variable. Then the code is a much % simplified version of the token list code because neither the % delimiter nor the replacement can contain macro parameters or -% braces. The delimiter \cs{q_mark} cannot appear in the string to +% braces. The delimiter \cs{s_@@_mark} cannot appear in the string to % edit so it is used in all cases. Some |x|-expansion is unnecessary. % There is no need to avoid losing braces nor to protect against % expansion. The ending code is much simplified and does not need to @@ -1018,9 +1058,9 @@ { \@@_replace_next:w #4 - \use_none_delimit_by_q_stop:w + \@@_use_none_delimit_by_s_stop:w #5 - \q_stop + \s_@@_stop } } \cs_new_eq:NN \@@_replace_next:w ? @@ -1214,7 +1254,7 @@ \@@_case:nnTF {#1} {#2} } \cs_new:Npn \@@_case:nnTF #1#2#3#4 - { \@@_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop } + { \@@_case:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop } \cs_generate_variant:Nn \str_case:nn { V , o , nV , nv } \prg_generate_conditional_variant:Nnn \str_case:nn { V , o , nV , nv } { T , F , TF } @@ -1245,14 +1285,14 @@ \@@_case_e:nnTF {#1} {#2} } \cs_new:Npn \@@_case_e:nnTF #1#2#3#4 - { \@@_case_e:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop } + { \@@_case_e:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop } \cs_new:Npn \@@_case_e:nw #1#2#3 { \str_if_eq:eeTF {#1} {#2} { \@@_case_end:nw {#3} } { \@@_case_e:nw {#1} } } -\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop +\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop { \exp_end: #1 #4 } % \end{macrocode} % \end{macro} @@ -1280,12 +1320,12 @@ % These are received by \cs{@@_map_function:Nn}, which passes % the space to |#1| and calls \cs{@@_map_function:w} to deal with the % next space. The space before the braced space allows to optimize -% the \cs{q_recursion_tail} test. Of course we need to include a +% the \cs{q_@@_recursion_tail} test. Of course we need to include a % trailing space (the question mark is needed to avoid losing the % space when \TeX{} tokenizes the line). % At the cost of about three more auxiliaries this code could get a $9$ % times speed up by testing only every $9$-th character for whether it -% is \cs{q_recursion_tail} (also by converting $9$ spaces at a time in +% is \cs{q_@@_recursion_tail} (also by converting $9$ spaces at a time in % the \cs{str_map_function:nN} case). % % For the \texttt{map_variable} functions we use a string assignment @@ -1297,7 +1337,7 @@ \exp_after:wN \@@_map_function:w \exp_after:wN \@@_map_function:Nn \exp_after:wN #2 \__kernel_tl_to_str:w {#1} - \q_recursion_tail ? ~ + \q_@@_recursion_tail ? ~ \prg_break_point:Nn \str_map_break: { } } \cs_new:Npn \str_map_function:NN @@ -1306,7 +1346,7 @@ { #1 { ~ { ~ } \@@_map_function:w } } \cs_new:Npn \@@_map_function:Nn #1#2 { - \if_meaning:w \q_recursion_tail #2 + \if_meaning:w \q_@@_recursion_tail #2 \exp_after:wN \str_map_break: \fi: #1 #2 \@@_map_function:Nn #1 @@ -1323,7 +1363,7 @@ \exp_not:c { @@_map_ \int_use:N \g__kernel_prg_map_int :w } \__kernel_str_to_other_fast:n {#1} } - \q_recursion_tail + \q_@@_recursion_tail \prg_break_point:Nn \str_map_break: { \int_gdecr:N \g__kernel_prg_map_int } } @@ -1332,7 +1372,7 @@ \cs_generate_variant:Nn \str_map_inline:Nn { c } \cs_new:Npn \@@_map_inline:NN #1#2 { - \quark_if_recursion_tail_break:NN #2 \str_map_break: + \@@_if_recursion_tail_break:NN #2 \str_map_break: \exp_args:No #1 { \token_to_str:N #2 } \@@_map_inline:NN #1 } @@ -1343,14 +1383,14 @@ \exp_not:n { \@@_map_variable:NnN #2 {#3} } \__kernel_str_to_other_fast:n {#1} } - \q_recursion_tail + \q_@@_recursion_tail \prg_break_point:Nn \str_map_break: { } } \cs_new_protected:Npn \str_map_variable:NNn { \exp_args:No \str_map_variable:nNn } \cs_new_protected:Npn \@@_map_variable:NnN #1#2#3 { - \quark_if_recursion_tail_break:NN #3 \str_map_break: + \@@_if_recursion_tail_break:NN #3 \str_map_break: \str_set:Nn #1 {#3} \use:n {#2} \@@_map_variable:NnN #1 {#2} @@ -1378,17 +1418,17 @@ % \begin{macro}[EXP]{\@@_to_other_loop:w, \@@_to_other_end:w} % First apply \cs{tl_to_str:n}, then replace all spaces by % \enquote{other} spaces, $8$ at a time, storing the converted part of -% the string between the \cs{q_mark} and \cs{q_stop} markers. The end +% the string between the \cs{s_@@_mark} and \cs{s_@@_stop} markers. The end % is detected when \cs{@@_to_other_loop:w} finds one of the trailing % |A|, distinguished from any contents of the initial token list by % their category. Then \cs{@@_to_other_end:w} is called, and finds -% the result between \cs{q_mark} and the first |A| (well, there is +% the result between \cs{s_@@_mark} and the first |A| (well, there is % also the need to remove a space). % \begin{macrocode} \cs_new:Npn \__kernel_str_to_other:n #1 { \exp_after:wN \@@_to_other_loop:w - \tl_to_str:n {#1} ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \q_mark \q_stop + \tl_to_str:n {#1} ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \s_@@_mark \s_@@_stop } \group_begin: \tex_lccode:D `\* = `\ % @@ -1397,15 +1437,15 @@ { \group_end: \cs_new:Npn \@@_to_other_loop:w - #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 ~ #7 ~ #8 ~ #9 \q_stop + #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 ~ #7 ~ #8 ~ #9 \s_@@_stop { \if_meaning:w A #8 \@@_to_other_end:w \fi: \@@_to_other_loop:w - #9 #1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * \q_stop + #9 #1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * \s_@@_stop } - \cs_new:Npn \@@_to_other_end:w \fi: #1 \q_mark #2 * A #3 \q_stop + \cs_new:Npn \@@_to_other_end:w \fi: #1 \s_@@_mark #2 * A #3 \s_@@_stop { \fi: #2 } } % \end{macrocode} @@ -1421,7 +1461,7 @@ \cs_new:Npn \__kernel_str_to_other_fast:n #1 { \exp_after:wN \@@_to_other_fast_loop:w \tl_to_str:n {#1} ~ - A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \q_stop + A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \s_@@_stop } \group_begin: \tex_lccode:D `\* = `\ % @@ -1438,7 +1478,7 @@ #1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * #9 \@@_to_other_fast_loop:w * } - \cs_new:Npn \@@_to_other_fast_end:w #1 * A #2 \q_stop {#1} + \cs_new:Npn \@@_to_other_fast_end:w #1 * A #2 \s_@@_stop {#1} } % \end{macrocode} % \end{macro} @@ -1481,25 +1521,25 @@ \exp_after:wN \@@_item:w \int_value:w \int_eval:n {#2} \exp_after:wN ; \int_value:w \@@_count:n {#1} ; - #1 \q_stop + #1 \s_@@_stop } \cs_new:Npn \@@_item:w #1; #2; { \int_compare:nNnTF {#1} < 0 { \int_compare:nNnTF {#1} < {-#2} - { \use_none_delimit_by_q_stop:w } + { \@@_use_none_delimit_by_s_stop:w } { - \exp_after:wN \use_i_delimit_by_q_stop:nw + \exp_after:wN \@@_use_i_delimit_by_s_stop:nw \exp:w \exp_after:wN \@@_skip_exp_end:w \int_value:w \int_eval:n { #1 + #2 } ; } } { \int_compare:nNnTF {#1} > {#2} - { \use_none_delimit_by_q_stop:w } + { \@@_use_none_delimit_by_s_stop:w } { - \exp_after:wN \use_i_delimit_by_q_stop:nw + \exp_after:wN \@@_use_i_delimit_by_s_stop:nw \exp:w \@@_skip_exp_end:w #1 ; { } } } @@ -1581,7 +1621,7 @@ \int_value:w \@@_count:n {#1} \exp_after:wN ; \int_value:w \int_eval:n { (#2) - 1 } \exp_after:wN ; \int_value:w \int_eval:n {#3} ; - #1 \q_stop + #1 \s_@@_stop } \cs_new:Npn \@@_range:w #1; #2; #3; { @@ -1635,7 +1675,7 @@ % \@@_collect_end:wn, \@@_collect_end:nnnnnnnnw % } % Collects |max(#1,0)| characters, and removes everything else until -% \cs{q_stop}. This is somewhat similar to \cs{@@_skip_exp_end:w}, but +% \cs{s_@@_stop}. This is somewhat similar to \cs{@@_skip_exp_end:w}, but % accepts integer expression arguments. This time we can only grab % $7$ characters at a time. At the end, we use an \cs{if_case:w} % trick again, so that the $8$ first arguments of @@ -1668,7 +1708,7 @@ #1 \else: 0 \fi: \exp_stop_f: \or: \or: \or: \or: \or: \or: \fi: } -\cs_new:Npn \@@_collect_end:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \q_stop +\cs_new:Npn \@@_collect_end:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \s_@@_stop { #1#2#3#4#5#6#7#8 } % \end{macrocode} % \end{macro} @@ -1695,13 +1735,13 @@ \exp_after:wN \@@_count_spaces_loop:w \tl_to_str:n {#1} ~ X 7 ~ X 6 ~ X 5 ~ X 4 ~ X 3 ~ X 2 ~ X 1 ~ X 0 ~ X -1 ~ - \q_stop + \s_@@_stop } } \cs_new:Npn \@@_count_spaces_loop:w #1~#2~#3~#4~#5~#6~#7~#8~#9~ { \if_meaning:w X #9 - \use_i_delimit_by_q_stop:nw + \@@_use_i_delimit_by_s_stop:nw \fi: 9 + \@@_count_spaces_loop:w } @@ -1755,13 +1795,13 @@ { X 8 } { X 7 } { X 6 } { X 5 } { X 4 } { X 3 } { X 2 } { X 1 } { X 0 } - \q_stop + \s_@@_stop } } \cs_new:Npn \@@_count_loop:NNNNNNNNN #1#2#3#4#5#6#7#8#9 { \if_meaning:w X #9 - \exp_after:wN \use_none_delimit_by_q_stop:w + \exp_after:wN \@@_use_none_delimit_by_s_stop:w \fi: 9 + \@@_count_loop:NNNNNNNNN } @@ -1781,14 +1821,14 @@ % hands it to \cs{str_head:n}. To circumvent the fact that \TeX{} % skips spaces when grabbing undelimited macro parameters, % \cs{@@_head:w} takes an argument delimited by a space. If |#1| -% starts with a non-space character, \cs{use_i_delimit_by_q_stop:nw} +% starts with a non-space character, \cs{@@_use_i_delimit_by_s_stop:nw} % leaves that in the input stream. On the other hand, if |#1| starts % with a space, the \cs{@@_head:w} takes an empty argument, and the % single (initially braced) space in the definition of \cs{@@_head:w} % makes its way to the output. Finally, for an empty argument, the % (braced) empty brace group in the definition of \cs{str_head:n} % gives an empty result after passing through -% \cs{use_i_delimit_by_q_stop:nw}. +% \cs{@@_use_i_delimit_by_s_stop:nw}. % \begin{macrocode} \cs_new:Npn \str_head:N { \exp_args:No \str_head:n } \cs_generate_variant:Nn \str_head:N { c } @@ -1796,14 +1836,14 @@ { \exp_after:wN \@@_head:w \tl_to_str:n {#1} - { { } } ~ \q_stop + { { } } ~ \s_@@_stop } \cs_new:Npn \@@_head:w #1 ~ % - { \use_i_delimit_by_q_stop:nw #1 { ~ } } + { \@@_use_i_delimit_by_s_stop:nw #1 { ~ } } \cs_new:Npn \str_head_ignore_spaces:n #1 { - \exp_after:wN \use_i_delimit_by_q_stop:nw - \tl_to_str:n {#1} { } \q_stop + \exp_after:wN \@@_use_i_delimit_by_s_stop:nw + \tl_to_str:n {#1} { } \s_@@_stop } % \end{macrocode} % \end{macro} @@ -1823,7 +1863,7 @@ % end-marker |X| be unexpandable and not a control sequence). The % \texttt{_ignore_spaces} is rather simpler: after converting the % input to a string, \cs{@@_tail_auxii:w} removes one undelimited -% argument and leaves everything else until an end-marker \cs{q_mark}. +% argument and leaves everything else until an end-marker \cs{s_@@_mark}. % One can check that an empty (or blank) string yields an empty % tail. % \begin{macrocode} @@ -1833,15 +1873,15 @@ { \exp_after:wN \@@_tail_auxi:w \reverse_if:N \if_charcode:w - \scan_stop: \tl_to_str:n {#1} X X \q_stop + \scan_stop: \tl_to_str:n {#1} X X \s_@@_stop } -\cs_new:Npn \@@_tail_auxi:w #1 X #2 \q_stop { \fi: #1 } +\cs_new:Npn \@@_tail_auxi:w #1 X #2 \s_@@_stop { \fi: #1 } \cs_new:Npn \str_tail_ignore_spaces:n #1 { \exp_after:wN \@@_tail_auxii:w - \tl_to_str:n {#1} \q_mark \q_mark \q_stop + \tl_to_str:n {#1} \s_@@_mark \s_@@_mark \s_@@_stop } -\cs_new:Npn \@@_tail_auxii:w #1 #2 \q_mark #3 \q_stop { #2 } +\cs_new:Npn \@@_tail_auxii:w #1 #2 \s_@@_mark #3 \s_@@_stop { #2 } % \end{macrocode} % \end{macro} % \end{macro} @@ -1880,7 +1920,7 @@ } \cs_new:Npn \@@_change_case_aux:nn #1#2 { - \@@_change_case_loop:nw {#2} #1 \q_recursion_tail \q_recursion_stop + \@@_change_case_loop:nw {#2} #1 \q_@@_recursion_tail \q_@@_recursion_stop \@@_change_case_result:n { } } \cs_new:Npn \@@_change_case_output:nw #1#2 \@@_change_case_result:n #3 @@ -1888,12 +1928,12 @@ \cs_generate_variant:Nn \@@_change_case_output:nw { f } \cs_new:Npn \@@_change_case_end:wn #1 \@@_change_case_result:n #2 { \tl_to_str:n {#2} } -\cs_new:Npn \@@_change_case_loop:nw #1#2 \q_recursion_stop +\cs_new:Npn \@@_change_case_loop:nw #1#2 \q_@@_recursion_stop { \tl_if_head_is_space:nTF {#2} { \@@_change_case_space:n } { \@@_change_case_char:nN } - {#1} #2 \q_recursion_stop + {#1} #2 \q_@@_recursion_stop } \exp_last_unbraced:NNNNo \cs_new:Npn \@@_change_case_space:n #1 \c_space_tl @@ -1903,7 +1943,7 @@ } \cs_new:Npn \@@_change_case_char:nN #1#2 { - \quark_if_recursion_tail_stop_do:Nn #2 + \@@_if_recursion_tail_stop_do:Nn #2 { \@@_change_case_end:wn } \@@_change_case_output:fw { \use:c { char_str_ #1 case:N } #2 } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index 4b36af5e148..feef7117355 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx index 950635ec939..ad71e493198 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -207,7 +207,7 @@ { \group_align_safe_begin: \@@_change_case_loop:nnw {#2} {#3} #1 - \q_recursion_tail \q_recursion_stop + \q_@@_recursion_tail \q_@@_recursion_stop \@@_change_case_result:n { } } % \end{macrocode} @@ -227,7 +227,7 @@ % \end{macrocode} % The main loop is the standard \texttt{tl action} type. % \begin{macrocode} -\cs_new:Npn \@@_change_case_loop:nnw #1#2#3 \q_recursion_stop +\cs_new:Npn \@@_change_case_loop:nnw #1#2#3 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#3} { \@@_change_case_N_type:nnN } @@ -236,9 +236,9 @@ { \use:c { @@_change_case_group_ #1 :nnn } } { \@@_change_case_space:nnw } } - {#1} {#2} #3 \q_recursion_stop + {#1} {#2} #3 \q_@@_recursion_stop } -\cs_new:Npn \@@_change_case_break:w #1 \q_recursion_tail \q_recursion_stop +\cs_new:Npn \@@_change_case_break:w #1 \q_@@_recursion_tail \q_@@_recursion_stop { \@@_change_case_store:n {#1} \@@_change_case_end:w @@ -309,7 +309,7 @@ % \begin{macrocode} \cs_new:Npn \@@_change_case_N_type:nnN #1#2#3 { - \quark_if_recursion_tail_stop_do:Nn #3 + \@@_if_recursion_tail_stop_do:Nn #3 { \@@_change_case_end:w } \@@_change_case_N_type_aux:nnN {#1} {#2} #3 } @@ -321,16 +321,16 @@ \cs_new:Npn \@@_change_case_N_type:nnnN #1#2#3#4 { \@@_change_case_math_search:nnNNN {#2} {#3} #4 #1 - \q_recursion_tail \q_recursion_tail - \q_recursion_stop + \q_@@_recursion_tail \q_@@_recursion_tail + \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_math_search:nnNNN #1#2#3#4#5 { - \quark_if_recursion_tail_stop_do:Nn #4 + \@@_if_recursion_tail_stop_do:Nn #4 { \@@_change_case_cs_check:nnN {#1} {#2} #3 } \token_if_eq_meaning:NNTF #3 #4 { - \use_i_delimit_by_q_recursion_stop:nw + \@@_use_i_delimit_by_q_recursion_stop:nw { \@@_change_case_store:n {#3} \@@_change_case_math_loop:nnNw {#1} {#2} #5 @@ -338,7 +338,7 @@ } { \@@_change_case_math_search:nnNNN {#1} {#2} #3 } } -\cs_new:Npn \@@_change_case_math_loop:nnNw #1#2#3#4 \q_recursion_stop +\cs_new:Npn \@@_change_case_math_loop:nnNw #1#2#3#4 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#4} { \@@_change_case_math_N_type:nnNN } @@ -347,11 +347,11 @@ { \@@_change_case_math_group:nnNn } { \@@_change_case_math_space:nnNw } } - {#1} {#2} #3 #4 \q_recursion_stop + {#1} {#2} #3 #4 \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_math_N_type:nnNN #1#2#3#4 { - \quark_if_recursion_tail_stop_do:Nn #4 + \@@_if_recursion_tail_stop_do:Nn #4 { \@@_change_case_end:w } \@@_change_case_store:n {#4} \token_if_eq_meaning:NNTF #4 #3 @@ -402,15 +402,15 @@ \cs_new:Npn \@@_change_case_exclude:nnnN #1#2#3#4 { \@@_change_case_exclude:nnNN {#2} {#3} #4 #1 - \q_recursion_tail \q_recursion_stop + \q_@@_recursion_tail \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_exclude:nnNN #1#2#3#4 { - \quark_if_recursion_tail_stop_do:Nn #4 + \@@_if_recursion_tail_stop_do:Nn #4 { \use:c { @@_change_case_letterlike_ #1 :nnN } {#1} {#2} #3 } \cs_if_eq:NNTF #3 #4 { - \use_i_delimit_by_q_recursion_stop:nw + \@@_use_i_delimit_by_q_recursion_stop:nw { \@@_change_case_exclude:nnNn {#1} {#2} #3 } } { \@@_change_case_exclude:nnNN {#1} {#2} #3 } @@ -495,7 +495,7 @@ { \@@_change_case_lower_sigma:nnNw {#2} {#3} #4 } { \@@_change_case_char:nnnN {#1} {#2} {#3} #4 } } - \cs_new:Npn \@@_change_case_lower_sigma:nnNw #1#2#3#4 \q_recursion_stop + \cs_new:Npn \@@_change_case_lower_sigma:nnNw #1#2#3#4 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#4} { \@@_change_case_lower_sigma:NnnN #3 } @@ -504,7 +504,7 @@ { \char_generate:nn { "03C2 } { \@@_char_catcode:N #3 } } \@@_change_case_loop:nnw } - {#1} {#2} #4 \q_recursion_stop + {#1} {#2} #4 \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_lower_sigma:NnnN #1#2#3#4 { @@ -742,12 +742,12 @@ \@@_change_case_upper_el_loop:nnw {#2} {#3} } \cs_new:Npn \@@_change_case_upper_el_loop:nnw - #1#2#3 \q_recursion_stop + #1#2#3 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#3} { \@@_change_case_upper_el:nnN } { \@@_change_case_loop:nnw } - {#1} {#2} #3 \q_recursion_stop + {#1} {#2} #3 \q_@@_recursion_stop } % \end{macrocode} % In addition to the Greek accents, we list three cases here where an @@ -916,12 +916,12 @@ \@@_change_case_lower_lt:nnw {#2} {#3} } } - \cs_new:Npn \@@_change_case_lower_lt:nnw #1#2#3 \q_recursion_stop + \cs_new:Npn \@@_change_case_lower_lt:nnw #1#2#3 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#3} { \@@_change_case_lower_lt:nnN } { \@@_change_case_loop:nnw } - {#1} {#2} #3 \q_recursion_stop + {#1} {#2} #3 \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_lower_lt:nnN #1#2#3 { @@ -983,12 +983,12 @@ \@@_change_case_upper_lt:nnw {#2} {#3} } } - \cs_new:Npn \@@_change_case_upper_lt:nnw #1#2#3 \q_recursion_stop + \cs_new:Npn \@@_change_case_upper_lt:nnw #1#2#3 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#3} { \@@_change_case_upper_lt:nnN } { \use:c { @@_change_case_char_next_ #1 :nn } } - {#1} {#2} #3 \q_recursion_stop + {#1} {#2} #3 \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_upper_lt:nnN #1#2#3 { @@ -1023,12 +1023,12 @@ } { \@@_change_case_char:nnnN {#1} {#2} {#3} #4 } } -\cs_new:Npn \@@_change_case_title_nl:nnw #1#2#3 \q_recursion_stop +\cs_new:Npn \@@_change_case_title_nl:nnw #1#2#3 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#3} { \@@_change_case_title_nl:nnN } { \use:c { @@_change_case_char_next_ #1 :nn } } - {#1} {#2} #3 \q_recursion_stop + {#1} {#2} #3 \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_title_nl:nnN #1#2#3 { @@ -1084,7 +1084,7 @@ % combination is found both the dotless-I and the dot-above char have to % be removed from the input. % \begin{macrocode} - \cs_new:Npn \@@_change_case_lower_tr:nnNw #1#2#3#4 \q_recursion_stop + \cs_new:Npn \@@_change_case_lower_tr:nnNw #1#2#3#4 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#4} { \@@_change_case_lower_tr:NnnN #3 } @@ -1093,7 +1093,7 @@ { \char_generate:nn { "0131 } { \@@_char_catcode:N #3 } } \@@_change_case_loop:nnw } - {#1} {#2} #4 \q_recursion_stop + {#1} {#2} #4 \q_@@_recursion_stop } \cs_new:Npn \@@_change_case_lower_tr:NnnN #1#2#3#4 { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx index 0de48966179..070e41956fb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -53,7 +53,7 @@ % % \begin{implementation} % -% \section{\pkg{l3text} implementation} +% \section{\pkg{l3text-purify} implementation} % % \begin{macrocode} %<*initex|package> @@ -65,6 +65,13 @@ % % \subsection{Purifying text} % +% \begin{macro}[EXP]{\@@_if_recursion_tail_stop:N} +% Functions to query recursion quarks. +% \begin{macrocode} +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N +% \end{macrocode} +% \end{macro} +% % \begin{macro}[rEXP]{\text_purify:n, \@@_purify:n} % \begin{macro}[rEXP]{\@@_purify_loop:w} % \begin{macro}[rEXP]{\@@_purify_group:n} @@ -98,13 +105,13 @@ \group_align_safe_end: } \cs_new:Npn \@@_purify:n #1 - { \@@_purify_loop:w #1 \q_recursion_tail \q_recursion_stop } + { \@@_purify_loop:w #1 \q_@@_recursion_tail \q_@@_recursion_stop } % \end{macrocode} % The main loop is a standard \enquote{tl action}. Unlike the expansion % or case changing, here any groups have to be run inline. Most of the % business end is as before in the \texttt{N}-type token processing. % \begin{macrocode} -\cs_new:Npn \@@_purify_loop:w #1 \q_recursion_stop +\cs_new:Npn \@@_purify_loop:w #1 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#1} { \@@_purify_N_type:N } @@ -113,7 +120,7 @@ { \@@_purify_group:n } { \@@_purify_space:w } } - #1 \q_recursion_stop + #1 \q_@@_recursion_stop } \cs_new:Npn \@@_purify_group:n #1 { \@@_purify_loop:w #1 } \exp_last_unbraced:NNo \cs_new:Npn \@@_purify_space:w \c_space_tl @@ -128,30 +135,30 @@ % \begin{macrocode} \cs_new:Npn \@@_purify_N_type:N #1 { - \quark_if_recursion_tail_stop:N #1 + \@@_if_recursion_tail_stop:N #1 \@@_purify_N_type_aux:N #1 } \cs_new:Npn \@@_purify_N_type_aux:N #1 { \exp_after:wN \@@_purify_math_search:NNN \exp_after:wN #1 \l_text_math_delims_tl - \q_recursion_tail ? - \q_recursion_stop + \q_@@_recursion_tail ? + \q_@@_recursion_stop } \cs_new:Npn \@@_purify_math_search:NNN #1#2#3 { - \quark_if_recursion_tail_stop_do:Nn #2 + \@@_if_recursion_tail_stop_do:Nn #2 { \@@_purify_math_cmd: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 { \@@_purify_math_start:NNw #2 #3 } } { \@@_purify_math_search:NNN #1 } } -\cs_new:Npn \@@_purify_math_start:NNw #1#2#3 \q_recursion_stop +\cs_new:Npn \@@_purify_math_start:NNw #1#2#3 \q_@@_recursion_stop { - \@@_purify_math_loop:NNw #1#2#3 \q_recursion_stop + \@@_purify_math_loop:NNw #1#2#3 \q_@@_recursion_stop \@@_purify_math_result:n { } } \cs_new:Npn \@@_purify_math_store:n #1 @@ -165,7 +172,7 @@ } \cs_new:Npn \@@_purify_math_stop:Nw #1 \@@_purify_math_result:n #2 { \exp_not:n {#1#2} } -\cs_new:Npn \@@_purify_math_loop:NNw #1#2#3 \q_recursion_stop +\cs_new:Npn \@@_purify_math_loop:NNw #1#2#3 \q_@@_recursion_stop { \tl_if_head_is_N_type:nTF {#3} { \@@_purify_math_N_type:NNN } @@ -174,11 +181,11 @@ { \@@_purify_math_group:NNn } { \@@_purify_math_space:NNw } } - #1#2#3 \q_recursion_stop + #1#2#3 \q_@@_recursion_stop } \cs_new:Npn \@@_purify_math_N_type:NNN #1#2#3 { - \quark_if_recursion_tail_stop_do:Nn #3 + \@@_if_recursion_tail_stop_do:Nn #3 { \@@_purify_math_stop:Nw #1 } \token_if_eq_meaning:NNTF #3 #2 { \@@_purify_math_end:w } @@ -206,15 +213,15 @@ \cs_new:Npn \@@_purify_math_cmd:N #1 { \exp_after:wN \@@_purify_math_cmd:NN \exp_after:wN #1 - \l_text_math_arg_tl \q_recursion_tail \q_recursion_stop + \l_text_math_arg_tl \q_@@_recursion_tail \q_@@_recursion_stop } \cs_new:Npn \@@_purify_math_cmd:NN #1#2 { - \quark_if_recursion_tail_stop_do:Nn #2 + \@@_if_recursion_tail_stop_do:Nn #2 { \@@_purify_replace:N #1 } \cs_if_eq:NNTF #2 #1 { - \use_i_delimit_by_q_recursion_stop:nw + \@@_use_i_delimit_by_q_recursion_stop:nw { \@@_purify_math_cmd:n } } { \@@_purify_math_cmd:NN #1 } @@ -264,7 +271,7 @@ } \cs_new:Npn \@@_purify_protect:N #1 { - \quark_if_recursion_tail_stop:N #1 + \@@_if_recursion_tail_stop:N #1 \@@_purify_loop:w } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx index 73f20645612..5113e03cc9c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -277,6 +277,52 @@ %<@@=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]{\@@_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]{\@@_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_new_test:N \@@_if_recursion_tail_stop_do:Nn +% \end{macrocode} +% \end{macro} +% % \subsection{Utilities} % % \begin{macro}[EXP] @@ -379,9 +425,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 { @@ -453,7 +499,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: } @@ -615,7 +661,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} @@ -638,7 +684,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 } @@ -647,7 +693,7 @@ { \@@_expand_group:n } { \@@_expand_space:w } } - #1 \q_recursion_stop + #1 \q_@@_recursion_stop } \cs_new:Npn \@@_expand_group:n #1 { @@ -675,7 +721,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 { @@ -749,16 +795,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 @@ -766,7 +812,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 } @@ -775,11 +821,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 @@ -820,7 +866,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 @@ -836,12 +882,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> @@ -850,7 +896,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 } @@ -869,15 +915,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 @@ -908,10 +954,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} + \@@_quark_if_nil:nTF {#4} { \cs_if_exist:cTF {#2} { \exp_args:Ne \@@_expand_store:n { \exp_not:c {#2} } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index 969e15a485f..6fbe2f1bbb8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 7c5217cb1d9..53f61e97508 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % @@ -1505,6 +1505,35 @@ % \end{macro} % \end{macro} % +% \subsection{Internal quarks and quark-query functions} +% +% \begin{variable}{\q_@@_nil,\q_@@_mark,\q_@@_stop} +% Internal quarks. +% \begin{macrocode} +\quark_new:N \q_@@_nil +\quark_new:N \q_@@_mark +\quark_new:N \q_@@_stop +% \end{macrocode} +% \end{variable} +% +% \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} +% \begin{macro}[pTF]{\@@_if_recursion_tail_stop:n} +% Functions to query recursion quarks. +% \begin{macrocode} +\__kernel_quark_new_test:N \@@_if_recursion_tail_break:nN +\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:n { TF } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Reassigning token list category codes} % % \begin{variable}{\c_@@_rescan_marker_tl} @@ -1670,7 +1699,7 @@ % token list may contain a comment character, in which case the |'| we % expected is not there. We fix this as follows: rather than just % |::| we set \tn{everyeof} to |::|\Arg{code1} |'::|\Arg{code2} -% \cs{q_stop}. The auxiliary \cs{@@_set_rescan_single:NNww} runs the +% \cs{s_@@_stop}. The auxiliary \cs{@@_set_rescan_single:NNww} runs the % \texttt{o}-expanding assignment, expanding either \meta{code1} or % \meta{code2} before its the main argument~|#3|. In the typical case % without comment character, \meta{code1} is expanded, removing the @@ -1717,9 +1746,9 @@ { #1 \use_none:n #2 #1 { \exp:w \@@_set_rescan_single_aux:w } - \q_stop + \s_@@_stop } - \cs_set:Npn \@@_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \q_stop + \cs_set:Npn \@@_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \s_@@_stop { \group_end: ##1 ##2 { ##4 ##3 } @@ -1756,13 +1785,13 @@ % the \meta{tl~var} by \meta{token list}. % \begin{macrocode} \cs_new_protected:Npn \tl_replace_once:Nnn - { \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_set:Nx } + { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_wrap:w \tl_set:Nx } \cs_new_protected:Npn \tl_greplace_once:Nnn - { \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_gset:Nx } + { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_wrap:w \tl_gset:Nx } \cs_new_protected:Npn \tl_replace_all:Nnn - { \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_set:Nx } + { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_next:w \tl_set:Nx } \cs_new_protected:Npn \tl_greplace_all:Nnn - { \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_gset:Nx } + { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_next:w \tl_gset:Nx } \cs_generate_variant:Nn \tl_replace_once:Nnn { c } \cs_generate_variant:Nn \tl_greplace_once:Nnn { c } \cs_generate_variant:Nn \tl_replace_all:Nnn { c } @@ -1816,9 +1845,9 @@ % at most $O(n^{3/2})$. Bear in mind that these upper bounds are % reached only in very contrived scenarios: we include the case % \enquote{\meta{A}} in the list of delimiters to try, so that the -% \meta{delimiter} is simply \cs{q_mark} in the most common +% \meta{delimiter} is simply \cs{q_@@_mark} in the most common % situation where neither the \meta{token list} nor the \meta{pattern} -% contains \cs{q_mark}. +% contains \cs{q_@@_mark}. % % Let us now ahead, optimizing for this most common case. First, two % special cases: an empty \meta{pattern}~|#6| is an error, and if @@ -1826,14 +1855,14 @@ % \meta{pattern}~|#6| then we can use it as the \meta{delimiter} % through \cs{@@_replace_auxii:nNNNnn} |{#1}|. Otherwise, we end up % calling \cs{@@_replace:NnNNNnn} repeatedly with the first two -% arguments \cs{q_mark} |{?}|, |\?| |{??}|, |\??| |{???}|, and so on, +% arguments \cs{q_@@_mark} |{?}|, |\?| |{??}|, |\??| |{???}|, and so on, % until |#6|~does not contain the control sequence~|#1|, which we take % as our~\meta{A}. The argument~|#2| only serves to collect~|?| % characters for~|#1|. Note that the order of the tests means that % the first two are done every time, which is wasteful (for instance, % we repeatedly test for the emptyness of~|#6|). However, this is % rare enough not to matter. Finally, choose~\meta{B} to be -% \cs{q_nil} or~\cs{q_stop} such that it is not equal to~|#6|. +% \cs{q_@@_nil} or~\cs{q_@@_stop} such that it is not equal to~|#6|. % % The \cs{@@_replace_auxi:NnnNNNnn} auxiliary receives \Arg{A} and % |{|\meta{A}$^n$\meta{B}|}| as its arguments, initially with $n=1$. @@ -1855,9 +1884,9 @@ \tl_if_in:nnTF {#6} {#1} { \exp_args:Nc \@@_replace:NnNNNnn {#2} {#2?} } { - \quark_if_nil:nTF {#6} - { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_stop } } - { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_nil } } + \@@_quark_if_nil:nTF {#6} + { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_@@_stop } } + { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_@@_nil } } } } { \@@_replace_auxii:nNNNnn {#1} } @@ -1988,7 +2017,7 @@ % \meta{token list} |?| is empty after one expansion. The auxiliary % \cs{@@_if_empty_if:o} is a fast emptyness test, converting its % argument to a string (after one expansion) and using the test -% \cs{if_meaning:w} \cs{q_nil} |...| \cs{q_nil}. +% \cs{if_meaning:w} \cs{q_@@_nil} |...| \cs{q_@@_nil}. % \begin{macrocode} \prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF } { @@ -2023,22 +2052,22 @@ % % \begin{macro}[pTF]{\tl_if_empty:n, \tl_if_empty:V} % Convert the argument to a string: this is empty if and only if -% the argument is. Then |\if_meaning:w \q_nil ... \q_nil| is +% the argument is. Then |\if_meaning:w \q_@@_nil ... \q_@@_nil| is % \texttt{true} if and only if the string |...| is empty. -% It could be tempting to use |\if_meaning:w \q_nil #1 \q_nil| directly. +% It could be tempting to use |\if_meaning:w \q_@@_nil #1 \q_@@_nil| directly. % This fails on a token -% list starting with \cs{q_nil} of course but more troubling is the +% list starting with \cs{q_@@_nil} of course but more troubling is the % case where argument is a complete conditional such as \cs{if_true:} % a \cs{else:} b \cs{fi:} because then \cs{if_true:} is used by % \cs{if_meaning:w}, the test turns out \texttt{false}, the \cs{else:} % executes the \texttt{false} branch, the \cs{fi:} ends it and the -% \cs{q_nil} at the end +% \cs{q_@@_nil} at the end % starts executing\dots{} % \begin{macrocode} \prg_new_conditional:Npnn \tl_if_empty:n #1 { p , TF , T , F } { - \exp_after:wN \if_meaning:w \exp_after:wN \q_nil - \tl_to_str:n {#1} \q_nil + \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil + \tl_to_str:n {#1} \q_@@_nil \prg_return_true: \else: \prg_return_false: @@ -2064,8 +2093,8 @@ % \begin{macrocode} \cs_new:Npn \@@_if_empty_if:o #1 { - \exp_after:wN \if_meaning:w \exp_after:wN \q_nil - \__kernel_tl_to_str:w \exp_after:wN {#1} \q_nil + \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil + \__kernel_tl_to_str:w \exp_after:wN {#1} \q_@@_nil } \prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F } { @@ -2221,13 +2250,13 @@ { \if_catcode:w ^ \exp_after:wN \@@_if_single:nnw \__kernel_tl_to_str:w - \exp_after:wN { \use_none:nn #1 ?? } ^ ? \q_stop + \exp_after:wN { \use_none:nn #1 ?? } ^ ? \s_@@_stop \prg_return_true: \else: \prg_return_false: \fi: } -\cs_new:Npn \@@_if_single:nnw #1#2#3 \q_stop {#2} +\cs_new:Npn \@@_if_single:nnw #1#2#3 \s_@@_stop {#2} % \end{macrocode} % \end{macro} % \end{macro} @@ -2291,7 +2320,7 @@ \@@_case:NnTF #1 {#2} } \cs_new:Npn \@@_case:NnTF #1#2#3#4 - { \@@_case:Nw #1 #2 #1 { } \q_mark {#3} \q_mark {#4} \q_stop } + { \@@_case:Nw #1 #2 #1 { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop } \cs_new:Npn \@@_case:Nw #1#2#3 { \tl_if_eq:NNTF #1 #2 @@ -2306,14 +2335,14 @@ % one of the cases searched for, then |#1| is the code to insert, % |#2| is the \emph{next} case to check on and |#3| is all of % the rest of the cases code. That means that |#4| is the \texttt{true} -% branch code, and |#5| tidies up the spare \cs{q_mark} and the +% branch code, and |#5| tidies up the spare \cs{s_@@_mark} and the % \texttt{false} branch. On the other hand, if none of the cases matched % then we arrive here using the \enquote{termination} case of comparing % the search with itself. That means that |#1| is empty, |#2| is -% the first \cs{q_mark} and so |#4| is the \texttt{false} code (the +% the first \cs{s_@@_mark} and so |#4| is the \texttt{false} code (the % \texttt{true} code is mopped up by |#3|). % \begin{macrocode} -\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop +\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop { \exp_end: #1 #4 } % \end{macrocode} % \end{macro} @@ -2333,14 +2362,14 @@ \cs_new:Npn \tl_map_function:nN #1#2 { \@@_map_function:Nn #2 #1 - \q_recursion_tail + \q_@@_recursion_tail \prg_break_point:Nn \tl_map_break: { } } \cs_new:Npn \tl_map_function:NN { \exp_args:No \tl_map_function:nN } \cs_new:Npn \@@_map_function:Nn #1#2 { - \quark_if_recursion_tail_break:nN {#2} \tl_map_break: + \@@_if_recursion_tail_break:nN {#2} \tl_map_break: #1 {#2} \@@_map_function:Nn #1 } \cs_generate_variant:Nn \tl_map_function:NN { c } @@ -2363,7 +2392,7 @@ { @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1 {#2} \exp_args:Nc \@@_map_function:Nn { @@_map_ \int_use:N \g__kernel_prg_map_int :w } - #1 \q_recursion_tail + #1 \q_@@_recursion_tail \prg_break_point:Nn \tl_map_break: { \int_gdecr:N \g__kernel_prg_map_int } } @@ -2382,7 +2411,7 @@ \cs_new:Npn \tl_map_tokens:nn #1#2 { \@@_map_tokens:nn {#2} #1 - \q_recursion_tail + \q_@@_recursion_tail \prg_break_point:Nn \tl_map_break: { } } \cs_new:Npn \tl_map_tokens:Nn @@ -2390,7 +2419,7 @@ \cs_generate_variant:Nn \tl_map_tokens:Nn { c } \cs_new:Npn \@@_map_tokens:nn #1#2 { - \quark_if_recursion_tail_break:nN {#2} \tl_map_break: + \@@_if_recursion_tail_break:nN {#2} \tl_map_break: \use:n {#1} {#2} \@@_map_tokens:nn {#1} } @@ -2410,14 +2439,14 @@ \cs_new_protected:Npn \tl_map_variable:nNn #1#2#3 { \@@_map_variable:Nnn #2 {#3} #1 - \q_recursion_tail + \q_@@_recursion_tail \prg_break_point:Nn \tl_map_break: { } } \cs_new_protected:Npn \tl_map_variable:NNn { \exp_args:No \tl_map_variable:nNn } \cs_new_protected:Npn \@@_map_variable:Nnn #1#2#3 { - \quark_if_recursion_tail_break:nN {#3} \tl_map_break: + \@@_if_recursion_tail_break:nN {#3} \tl_map_break: \tl_set:Nn #1 {#3} \use:n {#2} \@@_map_variable:Nnn #1 {#2} @@ -2538,23 +2567,23 @@ % \begin{macro}{\@@_reverse_items:nwNwn} % \begin{macro}{\@@_reverse_items:wn} % Reversal of a token list is done by taking one item at a time -% and putting it after \cs{q_stop}. +% and putting it after \cs{s_@@_stop}. % \begin{macrocode} \cs_new:Npn \tl_reverse_items:n #1 { \@@_reverse_items:nwNwn #1 ? - \q_mark \@@_reverse_items:nwNwn - \q_mark \@@_reverse_items:wn - \q_stop { } + \s_@@_mark \@@_reverse_items:nwNwn + \s_@@_mark \@@_reverse_items:wn + \s_@@_stop { } } -\cs_new:Npn \@@_reverse_items:nwNwn #1 #2 \q_mark #3 #4 \q_stop #5 +\cs_new:Npn \@@_reverse_items:nwNwn #1 #2 \s_@@_mark #3 #4 \s_@@_stop #5 { #3 #2 - \q_mark \@@_reverse_items:nwNwn - \q_mark \@@_reverse_items:wn - \q_stop { {#1} #5 } + \s_@@_mark \@@_reverse_items:nwNwn + \s_@@_mark \@@_reverse_items:wn + \s_@@_stop { {#1} #5 } } -\cs_new:Npn \@@_reverse_items:wn #1 \q_stop #2 +\cs_new:Npn \@@_reverse_items:wn #1 \s_@@_stop #2 { \exp_not:o { \use_none:nn #2 } } % \end{macrocode} % \end{macro} @@ -2570,17 +2599,17 @@ % } % Trimming spaces from around the input is deferred to an internal % function whose first argument is the token list to trim, augmented -% by an initial \cs{q_mark}, and whose second argument is a +% by an initial \cs{s_@@_mark}, and whose second argument is a % \meta{continuation}, which receives as a braced argument -% \cs{use_none:n} \cs{q_mark} \meta{trimmed token list}. In the case +% \cs{use_none:n} \cs{s_@@_mark} \meta{trimmed token list}. In the case % at hand, we take \cs{exp_not:o} as our continuation, so that space % trimming behaves correctly within an \texttt{x}-type expansion. % \begin{macrocode} \cs_new:Npn \tl_trim_spaces:n #1 - { \@@_trim_spaces:nn { \q_mark #1 } \exp_not:o } + { \@@_trim_spaces:nn { \s_@@_mark #1 } \exp_not:o } \cs_generate_variant:Nn \tl_trim_spaces:n { o } \cs_new:Npn \tl_trim_spaces_apply:nN #1#2 - { \@@_trim_spaces:nn { \q_mark #1 } { \exp_args:No #2 } } + { \@@_trim_spaces:nn { \s_@@_mark #1 } { \exp_args:No #2 } } \cs_generate_variant:Nn \tl_trim_spaces_apply:nN { o } \cs_new_protected:Npn \tl_trim_spaces:N #1 { \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } } @@ -2603,14 +2632,14 @@ % definitions, we nest those in \cs{@@_tmp:w}, which then receives % a single space as its argument: |#1| is \verb*+ +. % Removing leading spaces is done with \cs{@@_trim_spaces_auxi:w}, -% which loops until \cs{q_mark}\verb*+ + matches the end of the token +% which loops until \cs{s_@@_mark}\verb*+ + matches the end of the token % list: then |##1| is the token list and |##3| is % \cs{@@_trim_spaces_auxii:w}. This hands the relevant tokens to the % loop \cs{@@_trim_spaces_auxiii:w}, responsible for trimming -% trailing spaces. The end is reached when \verb*+ + \cs{q_nil} +% trailing spaces. The end is reached when \verb*+ + \cs{s_@@_nil} % matches the one present in the definition of \cs{tl_trim_spacs:n}. % Then \cs{@@_trim_spaces_auxiv:w} puts the token list into a group, -% with \cs{use_none:n} placed there to gobble a lingering \cs{q_mark}, +% with \cs{use_none:n} placed there to gobble a lingering \cs{s_@@_mark}, % and feeds this to the \meta{continuation}. % \begin{macrocode} \cs_set:Npn \@@_tmp:w #1 @@ -2619,35 +2648,35 @@ { \@@_trim_spaces_auxi:w ##1 - \q_nil - \q_mark #1 { } - \q_mark \@@_trim_spaces_auxii:w + \s_@@_nil + \s_@@_mark #1 { } + \s_@@_mark \@@_trim_spaces_auxii:w \@@_trim_spaces_auxiii:w - #1 \q_nil + #1 \s_@@_nil \@@_trim_spaces_auxiv:w - \q_stop + \s_@@_stop } - \cs_new:Npn \@@_trim_spaces_auxi:w ##1 \q_mark #1 ##2 \q_mark ##3 + \cs_new:Npn \@@_trim_spaces_auxi:w ##1 \s_@@_mark #1 ##2 \s_@@_mark ##3 { ##3 \@@_trim_spaces_auxi:w - \q_mark + \s_@@_mark ##2 - \q_mark #1 {##1} + \s_@@_mark #1 {##1} } \cs_new:Npn \@@_trim_spaces_auxii:w - \@@_trim_spaces_auxi:w \q_mark \q_mark ##1 + \@@_trim_spaces_auxi:w \s_@@_mark \s_@@_mark ##1 { \@@_trim_spaces_auxiii:w ##1 } - \cs_new:Npn \@@_trim_spaces_auxiii:w ##1 #1 \q_nil ##2 + \cs_new:Npn \@@_trim_spaces_auxiii:w ##1 #1 \s_@@_nil ##2 { ##2 - ##1 \q_nil + ##1 \s_@@_nil \@@_trim_spaces_auxiii:w } - \cs_new:Npn \@@_trim_spaces_auxiv:w ##1 \q_nil ##2 \q_stop ##3 + \cs_new:Npn \@@_trim_spaces_auxiv:w ##1 \s_@@_nil ##2 \s_@@_stop ##3 { ##3 { \use_none:n ##1 } } } \@@_tmp:w { ~ } @@ -2669,10 +2698,9 @@ % in the token list. % Only \cs{q_@@_act_mark} and \cs{q_@@_act_stop} may not appear % in the token lists manipulated by \cs{@@_act:NNNnn} functions. -% No quark module yet, so do things by hand. % \begin{macrocode} -\cs_new_nopar:Npn \q_@@_act_mark { \q_@@_act_mark } -\cs_new_nopar:Npn \q_@@_act_stop { \q_@@_act_stop } +\quark_new:N \q_@@_act_mark +\quark_new:N \q_@@_act_stop % \end{macrocode} % \end{variable} % @@ -2819,7 +2847,7 @@ % % \begin{macro}{\tl_head:N, \tl_head:n, \tl_head:V, \tl_head:v, \tl_head:f} % \begin{macro}{\@@_head_auxi:nw, \@@_head_auxii:n} -% \begin{macro}{\tl_head:w} +% \begin{macro}{\tl_head:w,\@@_tl_head:w} % \begin{macro}{\tl_tail:N, \tl_tail:n, \tl_tail:V, \tl_tail:v, \tl_tail:f} % Finding the head of a token list expandably always strips braces, which % is fine as this is consistent with for example mapping to a list. The @@ -2836,17 +2864,17 @@ \cs_new:Npn \tl_head:n #1 { \__kernel_exp_not:w - \if_false: { \fi: \@@_head_auxi:nw #1 { } \q_stop } + \if_false: { \fi: \@@_head_auxi:nw #1 { } \s_@@_stop } } -\cs_new:Npn \@@_head_auxi:nw #1#2 \q_stop +\cs_new:Npn \@@_head_auxi:nw #1#2 \s_@@_stop { \exp_after:wN \@@_head_auxii:n \exp_after:wN { \if_false: } \fi: {#1} } \cs_new:Npn \@@_head_auxii:n #1 { - \exp_after:wN \if_meaning:w \exp_after:wN \q_nil - \__kernel_tl_to_str:w \exp_after:wN { \use_none:n #1 } \q_nil + \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil + \__kernel_tl_to_str:w \exp_after:wN { \use_none:n #1 } \q_@@_nil \exp_after:wN \use_i:nn \else: \exp_after:wN \use_ii:nn @@ -2856,6 +2884,7 @@ } \cs_generate_variant:Nn \tl_head:n { V , v , f } \cs_new:Npn \tl_head:w #1#2 \q_stop {#1} +\cs_new:Npn \@@_tl_head:w #1#2 \s_@@_stop {#1} \cs_new:Npn \tl_head:N { \exp_args:No \tl_head:n } % \end{macrocode} % To correctly leave the tail of a token list, it's important \emph{not} to @@ -2923,7 +2952,7 @@ \tl_if_head_is_N_type:nTF { #1 ? } { \exp_after:wN \exp_not:N - \tl_head:w #1 { ? \use_none:nn } \q_stop + \@@_tl_head:w #1 { ? \use_none:nn } \s_@@_stop } { \str_head:n {#1} } \prg_return_true: @@ -2950,7 +2979,7 @@ \tl_if_head_is_N_type:nTF { #1 ? } { \exp_after:wN \exp_not:N - \tl_head:w #1 { ? \use_none:nn } \q_stop + \@@_tl_head:w #1 { ? \use_none:nn } \s_@@_stop } { \tl_if_head_is_group:nTF {#1} @@ -2986,7 +3015,7 @@ \cs_new:Npn \@@_if_head_eq_meaning_normal:nN #1 #2 { \exp_after:wN \if_meaning:w - \tl_head:w #1 { ?? \use_none:nnn } \q_stop #2 + \@@_tl_head:w #1 { ?? \use_none:nnn } \s_@@_stop #2 \prg_return_true: \else: \prg_return_false: @@ -3109,7 +3138,7 @@ % \begin{macro}{\@@_item_aux:nn, \@@_item:nn} % The idea here is to find the offset of the item from the left, then use % a loop to grab the correct item. If the resulting offset is too large, -% then \cs{quark_if_recursion_tail_stop:n} terminates the loop, and returns +% then \cs{@@_if_recursion_tail_break:nN} terminates the loop, and returns % nothing at all. % \begin{macrocode} \cs_new:Npn \tl_item:nn #1#2 @@ -3117,7 +3146,7 @@ \exp_args:Nf \@@_item:nn { \exp_args:Nf \@@_item_aux:nn { \int_eval:n {#2} } {#1} } #1 - \q_recursion_tail + \q_@@_recursion_tail \prg_break_point: } \cs_new:Npn \@@_item_aux:nn #1#2 @@ -3128,7 +3157,7 @@ } \cs_new:Npn \@@_item:nn #1#2 { - \quark_if_recursion_tail_break:nN {#2} \prg_break: + \@@_if_recursion_tail_break:nN {#2} \prg_break: \int_compare:nNnTF {#1} = 1 { \prg_break:n { \exp_not:n {#2} } } { \exp_args:Nf \@@_item:nn { \int_eval:n { #1 - 1 } } } @@ -3331,7 +3360,7 @@ { \iow_wrap:nnnN { >~ \tl_to_str:n {#1} . } { } { } \@@_show:n } \cs_new_protected:Npn \@@_show:n #1 { - \tl_set:Nf \l_@@_internal_a_tl { \@@_show:w #1 \q_stop } + \tl_set:Nf \l_@@_internal_a_tl { \@@_show:w #1 \s_@@_stop } \__kernel_iow_with:Nnn \tex_newlinechar:D { 10 } { \__kernel_iow_with:Nnn \tex_errorcontextlines:D { -1 } @@ -3341,7 +3370,7 @@ } } } -\cs_new:Npn \@@_show:w #1 > #2 . \q_stop {#2} +\cs_new:Npn \@@_show:w #1 > #2 . \s_@@_stop {#2} % \end{macrocode} % \end{macro} % \end{macro} @@ -3355,6 +3384,18 @@ % \end{macrocode} % \end{macro} % +% \subsection{Internal scan marks} +% +% \begin{variable}{\s_@@_nil,\s_@@_mark,\s_@@_stop} +% Internal scan marks. These are defined here at the end because the +% code for \cs{scan_new:N} depends on some \pkg{l3tl} functions. +% \begin{macrocode} +\scan_new:N \s_@@_nil +\scan_new:N \s_@@_mark +\scan_new:N \s_@@_stop +% \end{macrocode} +% \end{variable} +% % \subsection{Scratch token lists} % % \begin{variable}{\g_tmpa_tl, \g_tmpb_tl} 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: { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx index 346f310a938..bc0466eecae 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-05-05} +% \date{Released 2020-05-11} % % \maketitle % |