diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-06 21:05:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-06 21:05:39 +0000 |
commit | 193cab8a30e478915acdb6f30960653d0b54f61a (patch) | |
tree | 756f0ff0955ee3e7bc432be2f111acf1037d3e14 /Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex | |
parent | e72ea92bdfffdb77681710ed4098d42eb1b48126 (diff) |
l3kernel (6may19)
git-svn-id: svn://tug.org/texlive/trunk@51024 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex | 73 |
1 files changed, 68 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex index d4f679dc452..82d11da2357 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex @@ -64,7 +64,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2019-05-03}% +\def\ExplFileDate{2019-05-05}% \begingroup \def\next{\endgroup}% \expandafter\ifx\csname PackageError\endcsname\relax @@ -5731,7 +5731,7 @@ \quark_if_recursion_tail_stop_do:Nn #2 { \__str_change_case_end:wn } \__str_change_case_output:fw - { \use:c { char_ #1 _case:N } #2 } + { \use:c { char_str_ #1 _case:N } #2 } \__str_change_case_loop:nw {#1} } \str_const:Nx \c_ampersand_str { \cs_to_str:N \& } @@ -26448,7 +26448,10 @@ \cs_new:Npn \char_mixed_case:N #1 { \tl_if_exist:cTF { c__char_mixed_case_ \token_to_str:N #1 _tl } - { \tl_use:c { c__char_mixed_case_ \token_to_str:N #1 _tl } } + { + \__char_change_case_multi:v + { c__char_mixed_case_ \token_to_str:N #1 _tl } + } { \char_upper_case:N #1 } } \cs_new:Npn \char_fold_case:N #1 @@ -26456,19 +26459,79 @@ \cs_new:Npn \__char_change_case:nNN #1#2#3 { \tl_if_exist:cTF { c__char_ #1 _case_ \token_to_str:N #3 _tl } - { \tl_use:c { c__char_ #1 _case_ \token_to_str:N #3 _tl } } + { + \__char_change_case_multi:v + { c__char_ #1 _case_ \token_to_str:N #3 _tl } + } { \exp_args:Nf \__char_change_case:nN { #2 { `#3 } } #3 } } \cs_new:Npn \__char_change_case:nN #1#2 { \int_compare:nNnTF {#1} = 0 - {#2} + { \__char_change_case:N #2 } { \char_generate:nn {#1} { \char_value_catcode:n {#1} } } } +\cs_new:Npn \__char_change_case_multi:n #1 + { \__char_change_case_multi:NNNw #1 \q_no_value \q_no_value \q_stop } +\cs_new:Npn \__char_change_case_multi:NNNw #1#2#3#4 \q_stop + { + \quark_if_no_value:NTF #3 + { + \quark_if_no_value:NTF #2 + { \__char_change_case:N #1 } + { \__char_change_case:NN #1#2 } + } + { \__char_change_case:NNN #1#2#3 } + } +\cs_generate_variant:Nn \__char_change_case_multi:n { v } +\cs_new:Npn \__char_change_case:NN #1#2 + { + \exp_args:Nnf \use:nn + { \__char_change_case:N #1 } + { \__char_change_case:N #2 } + } +\cs_new:Npn \__char_change_case:NNN #1#2#3 + { + \exp_args:Nnff \use:nnn + { \__char_change_case:N #1 } + { \__char_change_case:N #2 } + { \__char_change_case:N #3 } + } +\cs_new:Npn \__char_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_set_eq:NN \__char_change_case:nN \use_ii:nn } +\cs_new:Npn \char_str_lower_case:N #1 + { \__char_str_change_case:nNN { lower } \char_value_lccode:n #1 } +\cs_new:Npn \char_str_upper_case:N #1 + { \__char_str_change_case:nNN { upper } \char_value_uccode:n #1 } +\cs_new:Npn \char_str_mixed_case:N #1 + { + \tl_if_exist:cTF { c__char_mixed_case_ \token_to_str:N #1 _tl } + { \tl_to_str:c { c__char_mixed_case_ \token_to_str:N #1 _tl } } + { \char_str_upper_case:N #1 } + } +\cs_new:Npn \char_str_fold_case:N #1 + { \__char_str_change_case:nNN { fold } \char_value_lccode:n #1 } +\cs_new:Npn \__char_str_change_case:nNN #1#2#3 + { + \tl_if_exist:cTF { c__char_ #1 _case_ \token_to_str:N #3 _tl } + { \tl_to_str:c { c__char_ #1 _case_ \token_to_str:N #3 _tl } } + { \exp_args:Nf \__char_str_change_case:nN { #2 { `#3 } } #3 } + } +\cs_new:Npn \__char_str_change_case:nN #1#2 + { + \int_compare:nNnTF {#1} = 0 + { \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_set:Npn \__char_str_change_case:nN #1#2 + { \tl_to_str:n {#2} } + } \cs_new:Npn \char_codepoint_to_bytes:n #1 { \exp_args:Nf \__char_codepoint_to_bytes_auxi:n |