diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3str.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3str.dtx | 163 |
1 files changed, 82 insertions, 81 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index c2498436cba..300a779bd1f 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 2023-08-29} +% \date{Released 2023-10-10} % % \maketitle % @@ -108,8 +108,8 @@ % % \begin{function}[added = 2015-09-18, updated = 2018-07-28] % { -% \str_const:Nn, \str_const:NV, \str_const:Nx, -% \str_const:cn, \str_const:cV, \str_const:cx +% \str_const:Nn, \str_const:NV, \str_const:Ne, +% \str_const:cn, \str_const:cV, \str_const:ce % } % \begin{syntax} % \cs{str_const:Nn} \meta{str~var} \Arg{token list} @@ -178,10 +178,10 @@ % % \begin{function}[added = 2015-09-18, updated = 2018-07-28] % { -% \str_set:Nn, \str_set:NV, \str_set:Nx, -% \str_set:cn, \str_set:cV, \str_set:cx, -% \str_gset:Nn, \str_gset:NV, \str_gset:Nx, -% \str_gset:cn, \str_gset:cV, \str_gset:cx +% \str_set:Nn, \str_set:NV, \str_set:Ne, +% \str_set:cn, \str_set:cV, \str_set:ce, +% \str_gset:Nn, \str_gset:NV, \str_gset:Ne, +% \str_gset:cn, \str_gset:cV, \str_gset:ce % } % \begin{syntax} % \cs{str_set:Nn} \meta{str var} \Arg{token list} @@ -192,10 +192,10 @@ % % \begin{function}[added = 2015-09-18, updated = 2018-07-28] % { -% \str_put_left:Nn, \str_put_left:NV, \str_put_left:Nx, -% \str_put_left:cn, \str_put_left:cV, \str_put_left:cx, -% \str_gput_left:Nn, \str_gput_left:NV, \str_gput_left:Nx, -% \str_gput_left:cn, \str_gput_left:cV, \str_gput_left:cx +% \str_put_left:Nn, \str_put_left:NV, \str_put_left:Ne, +% \str_put_left:cn, \str_put_left:cV, \str_put_left:ce, +% \str_gput_left:Nn, \str_gput_left:NV, \str_gput_left:Ne, +% \str_gput_left:cn, \str_gput_left:cV, \str_gput_left:ce % } % \begin{syntax} % \cs{str_put_left:Nn} \meta{str var} \Arg{token list} @@ -207,10 +207,10 @@ % % \begin{function}[added = 2015-09-18, updated = 2018-07-28] % { -% \str_put_right:Nn, \str_put_right:NV, \str_put_right:Nx, -% \str_put_right:cn, \str_put_right:cV, \str_put_right:cx, -% \str_gput_right:Nn, \str_gput_right:NV, \str_gput_right:Nx, -% \str_gput_right:cn, \str_gput_right:cV, \str_gput_right:cx +% \str_put_right:Nn, \str_put_right:NV, \str_put_right:Ne, +% \str_put_right:cn, \str_put_right:cV, \str_put_right:Ne, +% \str_gput_right:Nn, \str_gput_right:NV, \str_gput_right:Ne, +% \str_gput_right:cn, \str_gput_right:cV, \str_gput_right:ce % } % \begin{syntax} % \cs{str_put_right:Nn} \meta{str var} \Arg{token list} @@ -595,18 +595,18 @@ % at positions $s$ for $s\le0$ or $s>l$. % For instance, % \begin{verbatim} -% \iow_term:x { \str_range:nnn { abcdef } { 2 } { 5 } } -% \iow_term:x { \str_range:nnn { abcdef } { -4 } { -1 } } -% \iow_term:x { \str_range:nnn { abcdef } { -2 } { -1 } } -% \iow_term:x { \str_range:nnn { abcdef } { 0 } { -1 } } +% \iow_term:e { \str_range:nnn { abcdef } { 2 } { 5 } } +% \iow_term:e { \str_range:nnn { abcdef } { -4 } { -1 } } +% \iow_term:e { \str_range:nnn { abcdef } { -2 } { -1 } } +% \iow_term:e { \str_range:nnn { abcdef } { 0 } { -1 } } % \end{verbatim} % prints \texttt{bcde}, \texttt{cdef}, \texttt{ef}, and an empty % line to the terminal. The \meta{start index} must always be smaller than % or equal to the \meta{end index}: if this is not the case then no output % is generated. Thus % \begin{verbatim} -% \iow_term:x { \str_range:nnn { abcdef } { 5 } { 2 } } -% \iow_term:x { \str_range:nnn { abcdef } { -1 } { -4 } } +% \iow_term:e { \str_range:nnn { abcdef } { 5 } { 2 } } +% \iow_term:e { \str_range:nnn { abcdef } { -1 } { -4 } } % \end{verbatim} % both yield empty strings. % \end{function} @@ -617,25 +617,25 @@ % The behavior of \cs{str_range_ignore_spaces:nnn} is similar, but spaces % are removed before starting the job. The input % \begin{verbatim} -% \iow_term:x { \str_range:nnn { abcdefg } { 2 } { 5 } } -% \iow_term:x { \str_range:nnn { abcdefg } { 2 } { -3 } } -% \iow_term:x { \str_range:nnn { abcdefg } { -6 } { 5 } } -% \iow_term:x { \str_range:nnn { abcdefg } { -6 } { -3 } } -% -% \iow_term:x { \str_range:nnn { abc~efg } { 2 } { 5 } } -% \iow_term:x { \str_range:nnn { abc~efg } { 2 } { -3 } } -% \iow_term:x { \str_range:nnn { abc~efg } { -6 } { 5 } } -% \iow_term:x { \str_range:nnn { abc~efg } { -6 } { -3 } } -% -% \iow_term:x { \str_range_ignore_spaces:nnn { abcdefg } { 2 } { 5 } } -% \iow_term:x { \str_range_ignore_spaces:nnn { abcdefg } { 2 } { -3 } } -% \iow_term:x { \str_range_ignore_spaces:nnn { abcdefg } { -6 } { 5 } } -% \iow_term:x { \str_range_ignore_spaces:nnn { abcdefg } { -6 } { -3 } } -% -% \iow_term:x { \str_range_ignore_spaces:nnn { abcd~efg } { 2 } { 5 } } -% \iow_term:x { \str_range_ignore_spaces:nnn { abcd~efg } { 2 } { -3 } } -% \iow_term:x { \str_range_ignore_spaces:nnn { abcd~efg } { -6 } { 5 } } -% \iow_term:x { \str_range_ignore_spaces:nnn { abcd~efg } { -6 } { -3 } } +% \iow_term:e { \str_range:nnn { abcdefg } { 2 } { 5 } } +% \iow_term:e { \str_range:nnn { abcdefg } { 2 } { -3 } } +% \iow_term:e { \str_range:nnn { abcdefg } { -6 } { 5 } } +% \iow_term:e { \str_range:nnn { abcdefg } { -6 } { -3 } } +% +% \iow_term:e { \str_range:nnn { abc~efg } { 2 } { 5 } } +% \iow_term:e { \str_range:nnn { abc~efg } { 2 } { -3 } } +% \iow_term:e { \str_range:nnn { abc~efg } { -6 } { 5 } } +% \iow_term:e { \str_range:nnn { abc~efg } { -6 } { -3 } } +% +% \iow_term:e { \str_range_ignore_spaces:nnn { abcdefg } { 2 } { 5 } } +% \iow_term:e { \str_range_ignore_spaces:nnn { abcdefg } { 2 } { -3 } } +% \iow_term:e { \str_range_ignore_spaces:nnn { abcdefg } { -6 } { 5 } } +% \iow_term:e { \str_range_ignore_spaces:nnn { abcdefg } { -6 } { -3 } } +% +% \iow_term:e { \str_range_ignore_spaces:nnn { abcd~efg } { 2 } { 5 } } +% \iow_term:e { \str_range_ignore_spaces:nnn { abcd~efg } { 2 } { -3 } } +% \iow_term:e { \str_range_ignore_spaces:nnn { abcd~efg } { -6 } { 5 } } +% \iow_term:e { \str_range_ignore_spaces:nnn { abcd~efg } { -6 } { -3 } } % \end{verbatim} % will print four instances of |bcde|, four instances of |bc e| and eight % instances of |bcde|. @@ -973,20 +973,20 @@ % % \begin{macro} % { -% \str_set:Nn, \str_set:NV, \str_set:Nx, -% \str_set:cn, \str_set:cV, \str_set:cx, -% \str_gset:Nn, \str_gset:NV, \str_gset:Nx, -% \str_gset:cn, \str_gset:cV, \str_gset:cx, -% \str_const:Nn, \str_const:NV, \str_const:Nx, -% \str_const:cn, \str_const:cV, \str_const:cx, -% \str_put_left:Nn, \str_put_left:NV, \str_put_left:Nx, -% \str_put_left:cn, \str_put_left:cV, \str_put_left:cx, -% \str_gput_left:Nn, \str_gput_left:NV, \str_gput_left:Nx, -% \str_gput_left:cn, \str_gput_left:cV, \str_gput_left:cx, -% \str_put_right:Nn, \str_put_right:NV, \str_put_right:Nx, -% \str_put_right:cn, \str_put_right:cV, \str_put_right:cx, -% \str_gput_right:Nn, \str_gput_right:NV, \str_gput_right:Nx, -% \str_gput_right:cn, \str_gput_right:cV, \str_gput_right:cx +% \str_set:Nn, \str_set:NV, \str_set:Ne, \str_set:Nx, +% \str_set:cn, \str_set:cV, \str_set:ce, \str_set:cx, +% \str_gset:Nn, \str_gset:NV, \str_gset:Ne, \str_gset:Nx, +% \str_gset:cn, \str_gset:cV, \str_gset:ce, \str_gset:cx, +% \str_const:Nn, \str_const:NV, \str_const:Ne, \str_const:Nx, +% \str_const:cn, \str_const:cV, \str_const:ce, \str_const:cx, +% \str_put_left:Nn, \str_put_left:NV, \str_put_left:Ne, \str_put_left:Nx, +% \str_put_left:cn, \str_put_left:cV, \str_put_left:ce, \str_put_left:cx, +% \str_gput_left:Nn, \str_gput_left:NV, \str_gput_left:Ne, \str_gput_left:Nx, +% \str_gput_left:cn, \str_gput_left:cV, \str_gput_left:ce, \str_gput_left:cx, +% \str_put_right:Nn, \str_put_right:NV, \str_put_right:Ne, \str_put_right:Nx, +% \str_put_right:cn, \str_put_right:cV, \str_put_right:ce, \str_put_right:cx, +% \str_gput_right:Nn, \str_gput_right:NV, \str_gput_right:Ne, \str_gput_right:Nx, +% \str_gput_right:cn, \str_gput_right:cV, \str_gput_right:ce, \str_gput_right:cx % } % Simply convert the token list inputs to \meta{strings}. % \begin{macrocode} @@ -995,12 +995,13 @@ { \tl_if_blank:nF {#1} { - \cs_new_protected:cpx { str_ #1 :Nn } ##1##2 + \cs_new_protected:cpe { str_ #1 :Nn } ##1##2 { - \exp_not:c { tl_ #1 :Nx } ##1 + \exp_not:c { tl_ #1 :Ne } ##1 { \exp_not:N \tl_to_str:n {##2} } } - \cs_generate_variant:cn { str_ #1 :Nn } { NV , Nx , cn , cV , cx } + \cs_generate_variant:cn { str_ #1 :Nn } + { NV , Ne , Nx , cn , cV , ce , cx } \@@_tmp:n } } @@ -1041,13 +1042,13 @@ % hide in braces. % \begin{macrocode} \cs_new_protected:Npn \str_replace_once:Nnn - { \@@_replace:NNNnn \prg_do_nothing: \__kernel_tl_set:Nx } + { \@@_replace:NNNnn \prg_do_nothing: \__kernel_tl_set:Ne } \cs_new_protected:Npn \str_greplace_once:Nnn - { \@@_replace:NNNnn \prg_do_nothing: \__kernel_tl_gset:Nx } + { \@@_replace:NNNnn \prg_do_nothing: \__kernel_tl_gset:Ne } \cs_new_protected:Npn \str_replace_all:Nnn - { \@@_replace:NNNnn \@@_replace_next:w \__kernel_tl_set:Nx } + { \@@_replace:NNNnn \@@_replace_next:w \__kernel_tl_set:Ne } \cs_new_protected:Npn \str_greplace_all:Nnn - { \@@_replace:NNNnn \@@_replace_next:w \__kernel_tl_gset:Nx } + { \@@_replace:NNNnn \@@_replace_next:w \__kernel_tl_gset:Ne } \cs_generate_variant:Nn \str_replace_once:Nnn { c } \cs_generate_variant:Nn \str_greplace_once:Nnn { c } \cs_generate_variant:Nn \str_replace_all:Nnn { c } @@ -1056,10 +1057,10 @@ { \tl_if_empty:nTF {#4} { - \msg_error:nnx { kernel } { empty-search-pattern } {#5} + \msg_error:nne { kernel } { empty-search-pattern } {#5} } { - \use:x + \use:e { \exp_not:n { \@@_replace_aux:NNNnnn #1 #2 #3 } { \tl_to_str:N #3 } @@ -1215,7 +1216,7 @@ % \begin{macrocode} \prg_new_protected_conditional:Npnn \str_if_in:Nn #1#2 { T , F , TF } { - \use:x + \use:e { \tl_if_in:nnTF { \tl_to_str:N #1 } { \tl_to_str:n {#2} } } { \prg_return_true: } { \prg_return_false: } } @@ -1223,7 +1224,7 @@ { c } { T , F , TF } \prg_new_protected_conditional:Npnn \str_if_in:nn #1#2 { T , F , TF } { - \use:x + \use:e { \tl_if_in:nnTF { \tl_to_str:n {#1} } { \tl_to_str:n {#2} } } { \prg_return_true: } { \prg_return_false: } } @@ -1369,7 +1370,7 @@ \int_gincr:N \g__kernel_prg_map_int \cs_gset_protected:cpn { @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1 {#2} - \use:x + \use:e { \exp_not:N \@@_map_inline:NN \exp_not:c { @@_map_ \int_use:N \g__kernel_prg_map_int :w } @@ -1390,7 +1391,7 @@ } \cs_new_protected:Npn \str_map_variable:nNn #1#2#3 { - \use:x + \use:e { \exp_not:n { \@@_map_variable:NnN #2 {#3} } \__kernel_str_to_other_fast:n {#1} @@ -1992,7 +1993,7 @@ \cs_new:Npn \@@_change_case_codepoint:nN #1#2 { \@@_change_case_char:fnn { \int_eval:n {`#2} } {#1} {#2} } \else: - \cs_new:Npx \@@_change_case_codepoint:nN #1#2 + \cs_new:Npe \@@_change_case_codepoint:nN #1#2 { \exp_not:N \int_compare:nNnTF {`#2} > { "80 } { @@ -2121,19 +2122,19 @@ % For all of those strings, use \cs{cs_to_str:N} to get characters with % the correct category code without worries % \begin{macrocode} -\str_const:Nx \c_ampersand_str { \cs_to_str:N \& } -\str_const:Nx \c_atsign_str { \cs_to_str:N \@ } -\str_const:Nx \c_backslash_str { \cs_to_str:N \\ } -\str_const:Nx \c_left_brace_str { \cs_to_str:N \{ } -\str_const:Nx \c_right_brace_str { \cs_to_str:N \} } -\str_const:Nx \c_circumflex_str { \cs_to_str:N \^ } -\str_const:Nx \c_colon_str { \cs_to_str:N \: } -\str_const:Nx \c_dollar_str { \cs_to_str:N \$ } -\str_const:Nx \c_hash_str { \cs_to_str:N \# } -\str_const:Nx \c_percent_str { \cs_to_str:N \% } -\str_const:Nx \c_tilde_str { \cs_to_str:N \~ } -\str_const:Nx \c_underscore_str { \cs_to_str:N \_ } -\str_const:Nx \c_zero_str { 0 } +\str_const:Ne \c_ampersand_str { \cs_to_str:N \& } +\str_const:Ne \c_atsign_str { \cs_to_str:N \@ } +\str_const:Ne \c_backslash_str { \cs_to_str:N \\ } +\str_const:Ne \c_left_brace_str { \cs_to_str:N \{ } +\str_const:Ne \c_right_brace_str { \cs_to_str:N \} } +\str_const:Ne \c_circumflex_str { \cs_to_str:N \^ } +\str_const:Ne \c_colon_str { \cs_to_str:N \: } +\str_const:Ne \c_dollar_str { \cs_to_str:N \$ } +\str_const:Ne \c_hash_str { \cs_to_str:N \# } +\str_const:Ne \c_percent_str { \cs_to_str:N \% } +\str_const:Ne \c_tilde_str { \cs_to_str:N \~ } +\str_const:Ne \c_underscore_str { \cs_to_str:N \_ } +\str_const:Ne \c_zero_str { 0 } % \end{macrocode} % \end{variable} % |