diff options
author | Karl Berry <karl@freefriends.org> | 2020-05-11 20:47:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-05-11 20:47:47 +0000 |
commit | bffbeb435746ef4bfc3abbbce80006f657360f3a (patch) | |
tree | 25bd4caaead6a06571d1376a8d442fe79e071d62 /Master/texmf-dist/source/latex/l3kernel/l3expan.dtx | |
parent | a3fca75048862f5c0f86ec89c88da49a55beafb7 (diff) |
l3kernel (11may20)
git-svn-id: svn://tug.org/texlive/trunk@55101 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3expan.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3expan.dtx | 116 |
1 files changed, 72 insertions, 44 deletions
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 } } |