summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx139
1 files changed, 62 insertions, 77 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
index a92db3ebedf..116d1e83ef0 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 2019-08-25}
+% \date{Released 2019-09-05}
%
% \maketitle
%
@@ -589,24 +589,6 @@
%
% \section{Additions to \pkg{l3prop}}
%
-% \begin{function}[rEXP]
-% {\prop_map_tokens:Nn, \prop_map_tokens:cn}
-% \begin{syntax}
-% \cs{prop_map_tokens:Nn} \meta{property list} \Arg{code}
-% \end{syntax}
-% Analogue of \cs{prop_map_function:NN} which maps several tokens
-% instead of a single function. The \meta{code} receives each
-% key--value pair in the \meta{property list} as two trailing brace
-% groups. For instance,
-% \begin{verbatim}
-% \prop_map_tokens:Nn \l_my_prop { \str_if_eq:nnT { mykey } }
-% \end{verbatim}
-% expands to the value corresponding to \texttt{mykey}: for each
-% pair in |\l_my_prop| the function \cs{str_if_eq:nnT} receives
-% \texttt{mykey}, the \meta{key} and the \meta{value} as its three
-% arguments. For that specific task, \cs{prop_item:Nn} is faster.
-% \end{function}
-%
% \begin{function}[EXP, added = 2016-12-06]
% {\prop_rand_key_value:N, \prop_rand_key_value:c}
% \begin{syntax}
@@ -1751,33 +1733,6 @@
%<@@=prop>
% \end{macrocode}
%
-% \begin{macro}[rEXP]{\prop_map_tokens:Nn, \prop_map_tokens:cn}
-% \begin{macro}{\@@_map_tokens:nwwn}
-% The mapping is very similar to \cs{prop_map_function:NN}. The
-% \cs{use_i:nn} removes the leading \cs{s_@@}. The odd construction
-% |\use:n {#1}| allows |#1| to contain any token without interfering
-% with \cs{prop_map_break:}. The loop stops when the argument
-% delimited by \cs{@@_pair:wn} is \cs{prg_break:} instead of being
-% empty.
-% \begin{macrocode}
-\cs_new:Npn \prop_map_tokens:Nn #1#2
- {
- \exp_last_unbraced:Nno
- \use_i:nn { \@@_map_tokens:nwwn {#2} } #1
- \prg_break: \@@_pair:wn \s_@@ { } \prg_break_point:
- \prg_break_point:Nn \prop_map_break: { }
- }
-\cs_new:Npn \@@_map_tokens:nwwn #1#2 \@@_pair:wn #3 \s_@@ #4
- {
- #2
- \use:n {#1} {#3} {#4}
- \@@_map_tokens:nwwn {#1}
- }
-\cs_generate_variant:Nn \prop_map_tokens:Nn { c }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \begin{macro}[EXP]
% {\prop_rand_key_value:N, \prop_rand_key_value:c}
% \begin{macro}[EXP]{\@@_rand_item:w}
@@ -2531,11 +2486,12 @@
% }
% \begin{macro}[EXP]{\@@_change_case:nNN}
% \begin{macro}[EXP]{\@@_change_case:nN}
-% \begin{macro}[EXP]{\@@_change_case_multi:n, \@@_change_case_multi:v}
-% \begin{macro}[EXP]{\@@_change_case_multi:NNNw}
-% \begin{macro}[EXP]{\@@_change_case:NN}
+% \begin{macro}[EXP]{\@@_change_case_multi:nN, \@@_change_case_multi:vN}
+% \begin{macro}[EXP]{\@@_change_case_multi:NNNNw}
% \begin{macro}[EXP]{\@@_change_case:NNN}
-% \begin{macro}[EXP]{\@@_change_case:N}
+% \begin{macro}[EXP]{\@@_change_case:NNNN}
+% \begin{macro}[EXP]{\@@_change_case:NN}
+% \begin{macro}[EXP]{\@@_change_case_catcode:N}
% \begin{macro}[EXP]
% {
% \char_str_lower_case:N, \char_str_upper_case:N,
@@ -2566,8 +2522,8 @@
{
\tl_if_exist:cTF { c_@@_mixed_case_ \token_to_str:N #1 _tl }
{
- \@@_change_case_multi:v
- { c_@@_mixed_case_ \token_to_str:N #1 _tl }
+ \@@_change_case_multi:vN
+ { c_@@_mixed_case_ \token_to_str:N #1 _tl } #1
}
{ \char_upper_case:N #1 }
}
@@ -2577,48 +2533,76 @@
{
\tl_if_exist:cTF { c_@@_ #1 _case_ \token_to_str:N #3 _tl }
{
- \@@_change_case_multi:v
- { c_@@_ #1 _case_ \token_to_str:N #3 _tl }
+ \@@_change_case_multi:vN
+ { c_@@_ #1 _case_ \token_to_str:N #3 _tl } #3
}
{ \exp_args:Nf \@@_change_case:nN { #2 { `#3 } } #3 }
}
\cs_new:Npn \@@_change_case:nN #1#2
{
\int_compare:nNnTF {#1} = 0
- { \@@_change_case:N #2 }
- { \char_generate:nn {#1} { \char_value_catcode:n {#1} } }
+ { #2 }
+ { \char_generate:nn {#1} { \@@_change_case_catcode:N #2 } }
}
-\cs_new:Npn \@@_change_case_multi:n #1
- { \@@_change_case_multi:NNNw #1 \q_no_value \q_no_value \q_stop }
-\cs_new:Npn \@@_change_case_multi:NNNw #1#2#3#4 \q_stop
+\cs_new:Npn \@@_change_case_multi:nN #1#2
+ { \@@_change_case_multi:NNNNw #2 #1 \q_no_value \q_no_value \q_stop }
+\cs_generate_variant:Nn \@@_change_case_multi:nN { v }
+\cs_new:Npn \@@_change_case_multi:NNNNw #1#2#3#4#5 \q_stop
{
- \quark_if_no_value:NTF #3
+ \quark_if_no_value:NTF #4
{
- \quark_if_no_value:NTF #2
- { \@@_change_case:N #1 }
- { \@@_change_case:NN #1#2 }
+ \quark_if_no_value:NTF #3
+ { \@@_change_case:NN #1 #2 }
+ { \@@_change_case:NNN #1 #2#3 }
}
- { \@@_change_case:NNN #1#2#3 }
+ { \@@_change_case:NNNN #1 #2#3#4 }
}
-\cs_generate_variant:Nn \@@_change_case_multi:n { v }
-\cs_new:Npn \@@_change_case:NN #1#2
+\cs_new:Npn \@@_change_case:NNN #1#2#3
{
\exp_args:Nnf \use:nn
- { \@@_change_case:N #1 }
- { \@@_change_case:N #2 }
+ { \@@_change_case:NN #1 #2 }
+ { \@@_change_case:NN #1 #3 }
}
-\cs_new:Npn \@@_change_case:NNN #1#2#3
+\cs_new:Npn \@@_change_case:NNNN #1#2#3#4
{
\exp_args:Nnff \use:nnn
- { \@@_change_case:N #1 }
- { \@@_change_case:N #2 }
- { \@@_change_case:N #3 }
+ { \@@_change_case:NN #1 #2 }
+ { \@@_change_case:NN #1 #3 }
+ { \@@_change_case:NN #1 #4 }
}
-\cs_new:Npn \@@_change_case:N #1
- { \char_generate:nn { `#1 } { \char_value_catcode:n { `#1 } } }
-\bool_lazy_or:nnF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: }
+\cs_new:Npn \@@_change_case:NN #1#2
+ { \char_generate:nn { `#2 } { \@@_change_case_catcode:N #1 } }
+\cs_new:Npn \@@_change_case_catcode:N #1
{
- \cs_set_eq:NN \@@_change_case:nN \use_ii:nn
+ \if_catcode:w \exp_not:N #1 \c_math_toggle_token
+ 3
+ \else:
+ \if_catcode:w \exp_not:N #1 \c_alignment_token
+ 4
+ \else:
+ \if_catcode:w \exp_not:N #1 \c_math_superscript_token
+ 7
+ \else:
+ \if_catcode:w \exp_not:N #1 \c_math_subscript_token
+ 8
+ \else:
+ \if_catcode:w \exp_not:N #1 \c_space_token
+ 10
+ \else:
+ \if_catcode:w \exp_not:N #1 \c_catcode_letter_token
+ 11
+ \else:
+ \if_catcode:w \exp_not:N #1 \c_catcode_other_token
+ 12
+ \else:
+ 13
+ \fi:
+ \fi:
+ \fi:
+ \fi:
+ \fi:
+ \fi:
+ \fi:
}
% \end{macrocode}
% Same story for the string version, except category code is easier
@@ -2648,7 +2632,7 @@
{ \tl_to_str:n {#2} }
{ \char_generate:nn {#1} { 12 } }
}
-\bool_lazy_or:nnF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: }
+\cs_if_exist:NF \tex_Uchar:D
{
\cs_set:Npn \@@_str_change_case:nN #1#2
{ \tl_to_str:n {#2} }
@@ -2665,6 +2649,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}[EXP]{\char_codepoint_to_bytes:n}
% \begin{macro}[EXP]{\@@_codepoint_to_bytes_auxi:n}