From dda31e626ef6f0f11d9fc942ef8feb6025acd8af Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 31 Aug 2022 20:19:45 +0000 Subject: l3kernel (31aug22) git-svn-id: svn://tug.org/texlive/trunk@64251 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/l3kernel/expl3-code.tex | 881 ++++++++++++++++++--- .../tex/latex/l3kernel/expl3-generic.tex | 2 +- Master/texmf-dist/tex/latex/l3kernel/expl3.ltx | 2 +- Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 2 +- 4 files changed, 753 insertions(+), 134 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex index e23ee371e13..b5ee93defe0 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex @@ -52,6 +52,7 @@ %% l3unicode.dtx (with options: `package') %% l3text.dtx (with options: `package') %% l3text-case.dtx (with options: `package') +%% l3text-map.dtx (with options: `package') %% l3text-purify.dtx (with options: `package') %% l3candidates.dtx (with options: `package') %% l3legacy.dtx (with options: `package') @@ -70,7 +71,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2022-08-23}% +\def\ExplFileDate{2022-08-30}% \begingroup \def\next{\endgroup}% \expandafter\ifx\csname PackageError\endcsname\relax @@ -8892,27 +8893,92 @@ Type H for immediate help}\def~{\errmessage{% } \cs_generate_variant:Nn \__char_to_utfviii_bytes_output:nnn { f } \cs_new:Npn \__char_to_utfviii_bytes_end: { } -\cs_new:Npn \char_to_nfd:N #1 +\bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } { - \cs_if_exist:cTF { c__char_nfd_ \token_to_str:N #1 _ tl } + \cs_new:Npn \char_to_nfd:N #1 { - \exp_after:wN \exp_after:wN \exp_after:wN \__char_to_nfd:Nw - \exp_after:wN \exp_after:wN \exp_after:wN #1 - \cs:w c__char_nfd_ \token_to_str:N #1 _ tl \cs_end: - \s__char_stop + \cs_if_exist:cTF { c__char_nfd_ \token_to_str:N #1 _ tl } + { + \exp_after:wN \exp_after:wN \exp_after:wN \__char_to_nfd:Nw + \exp_after:wN \exp_after:wN \exp_after:wN #1 + \cs:w c__char_nfd_ \token_to_str:N #1 _tl \cs_end: + \s__char_stop + } + { \exp_not:n {#1} } + } + \cs_new_eq:NN \__char_to_nfd:n \char_to_nfd:N + \cs_generate_variant:Nn \__char_to_nfd:n { e } + \cs_new:Npn \__char_to_nfd:Nw #1#2#3 \s__char_stop + { + \__char_to_nfd:e + { \char_generate:nn { `#2 } { \__char_change_case_catcode:N #1 } } + \tl_if_blank:nF {#3} + { + \__char_to_nfd:e + { \char_generate:nn { `#3 } { \char_value_catcode:n { `#3 } } } + } + } + \cs_new:Npn \char_to_nfd:n #1 + { + \__char_to_nfd:e { \char_generate:nn {#1} { \char_value_catcode:n {#1} } } } - { \exp_not:n {#1} } } -\cs_set_eq:NN \__char_to_nfd:n \char_to_nfd:N -\cs_new:Npn \__char_to_nfd:Nw #1#2#3 \s__char_stop { - \exp_args:Ne \__char_to_nfd:n - { \char_generate:nn { `#2 } { \__char_change_case_catcode:N #1 } } - \tl_if_blank:nF {#3} + \cs_new:Npn \char_to_nfd:N #1 { \exp_not:n {#1} } + \cs_new:Npn \char_to_nfd:n #1 + { + \int_compare:nNnTF {#1} > { "80 } + { \exp_args:Ne \__char_to_nfd:n { \__char_nfd_generate:n {#1} } } + { \__char_nfd_generate:n {#1} } + } + \cs_new:Npn \__char_to_nfd:n #1 + { + \cs_if_exist:cTF { c__char_nfd_ \tl_to_str:n {#1} _ tl } + { + \exp_after:wN \exp_after:wN \exp_after:wN \__char_to_nfd:w + \cs:w c__char_nfd_ \tl_to_str:n {#1} _tl \cs_end: + \s__char_stop + } + { \exp_not:n {#1} } + } + \cs_new:Npn \__char_to_nfd:w #1#2 \s__char_stop { - \exp_args:Ne \__char_to_nfd:n - { \char_generate:nn { `#3 } { \char_value_catcode:n { `#3 } } } + \__char_to_nfd:n {#1} + \tl_if_blank:nF {#2} + { \__char_to_nfd:n {#2} } } + \cs_new:Npn \__char_nfd_generate:n #1 + { + \use:e + { + \exp_not:N \__char_nfd_generate:nnnn + \char_to_utfviii_bytes:n {#1} + } + } + \cs_new:Npn \__char_nfd_generate:nnnn #1#2#3#4 + { + \tl_if_blank:nTF {#2} + { \char_generate:nn {#1} { \char_value_catcode:n {#1} } } + { + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:N \char_generate:nn {#1} { 13 } + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:N \char_generate:nn {#2} { 13 } + \tl_if_blank:nF {#3} + { + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:N \char_generate:nn {#3} { 13 } + \tl_if_blank:nF {#4} + { + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_not:N \char_generate:nn {#4} { 13 } + } + } + } + + } } \cs_new:Npn \char_lowercase:N #1 { \__char_change_case:nNN { lower } \char_value_lccode:n #1 } @@ -30233,20 +30299,19 @@ Type H for immediate help}\def~{\errmessage{% \__pdf_backend_compress_objects:n { \c_false_bool } } } -\cs_new_protected:Npn \pdf_object_new:nn #1#2 - { \__pdf_backend_object_new:nn {#1} {#2} } -\prg_new_conditional:Npnn \pdf_object_if_exist:n #1 { p , T , F , TF } +\cs_new_protected:Npn \pdf_object_new:n #1 { - \int_if_exist:cTF { c__pdf_backend_object_ \tl_to_str:n {#1} _int } - { \prg_return_true: } - { \prg_return_false:} + \__pdf_backend_object_new:n {#1} + \cs_new_eq:cc + { c__pdf_backend_object_ \tl_to_str:n {#1} _int } + { c__pdf_object_ \tl_to_str:n {#1} _int } } -\cs_new_protected:Npn \pdf_object_write:nn #1#2 +\cs_new_protected:Npn \pdf_object_write:nnn #1#2#3 { - \__pdf_backend_object_write:nn {#1} {#2} + \__pdf_backend_object_write:nnn {#1} {#2} {#3} \bool_gset_true:N \g__pdf_init_bool } -\cs_generate_variant:Nn \pdf_object_write:nn { nx } +\cs_generate_variant:Nn \pdf_object_write:nnn { nnx } \cs_new:Npn \pdf_object_ref:n #1 { \__pdf_backend_object_ref:n {#1} } \cs_new_protected:Npn \pdf_object_unnamed_write:nn #1#2 { @@ -30255,6 +30320,12 @@ Type H for immediate help}\def~{\errmessage{% } \cs_generate_variant:Nn \pdf_object_unnamed_write:nn { nx } \cs_new:Npn \pdf_object_ref_last: { \__pdf_backend_object_last: } +\prg_new_conditional:Npnn \pdf_object_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c__pdf_object_ \tl_to_str:n {#1} _int } + \prg_return_true: + \prg_return_false: + } \cs_new:Npn \pdf_pageobject_ref:n #1 { \__pdf_backend_pageobject_ref:n {#1} } \prg_new_conditional:Npnn \pdf_version_compare:Nn #1#2 { p , T , F , TF } @@ -30317,6 +30388,19 @@ Type H for immediate help}\def~{\errmessage{% \hbox_to_zero:n { \__pdf_backend_destination:nnnn {#1} {#2} {#3} {#4} } } +\prop_new:N \g__pdf_object_prop +\cs_new_protected:Npn \pdf_object_new:nn #1#2 + { + \prop_gput:Nnn \g__pdf_object_prop {#1} {#2} + \__pdf_backend_object_new:n {#1} + } +\cs_new_protected:Npn \pdf_object_write:nn #1#2 + { + \exp_args:Nnx \__pdf_backend_object_write:nnn + {#1} { \prop_item:Nn \g__pdf_object_prop {#1} } {#2} + \bool_gset_true:N \g__pdf_init_bool + } +\cs_generate_variant:Nn \pdf_object_write:nn { nx } %% File: l3coffins.dtx \box_new:N \l__coffin_internal_box \dim_new:N \l__coffin_internal_dim @@ -31644,143 +31728,219 @@ Type H for immediate help}\def~{\errmessage{% \prop_gput:Nnn \g_msg_module_type_prop { luatex } { } %% File: l3unicode.dtx \ior_new:N \g__char_data_ior -\bool_lazy_or:nnTF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: } - { - \group_begin: - \cs_set:Npn \__char_generate_char:n #1 - { \tex_detokenize:D \tex_expandafter:D { \tex_Uchar:D " #1 } } - \cs_set:Npx \__char_generate:n #1 +\group_begin: + \bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { + \cs_set:Npn \__char_generate_other:n #1 + { \tex_detokenize:D \tex_expandafter:D { \tex_Uchar:D #1 } } + \cs_set:Npn \__char_generate:n #1 { - \exp_not:N \tex_unexpanded:D \exp_not:N \exp_after:wN - { - \exp_not:N \tex_Ucharcat:D - #1 ~ - \tex_catcode:D #1 ~ - } + \tex_unexpanded:D \exp_after:wN + { \tex_Ucharcat:D #1 ~ \tex_catcode:D #1 ~ } + } + } + { + \cs_set:Npn \__char_generate_other:n #1 + { + \tex_detokenize:D \tex_expandafter:D + { \tex_expanded:D { \__char_generate:n {#1} } } } - \ior_open:Nn \g__char_data_ior { UnicodeData.txt } - \cs_set_protected:Npn \__char_data_auxi:w - #1 ; #2 ; #3 ; #4 ; #5 ; #6 ; #7 ; #8 ; #9 ; + \cs_set:Npn \__char_generate:n #1 { - \tl_if_blank:nF {#6} + \use:e { - \tl_if_head_eq_charcode:nNF {#6} < % > - { \__char_data_auxii:w #1 ; #6 ~ \q_stop } + \exp_not:N \__char_generate:nnnn + \char_to_utfviii_bytes:n {#1} } - \__char_data_auxiii:w #1 ; } - \cs_set_protected:Npn \__char_data_auxii:w #1 ; #2 ~ #3 \q_stop + \cs_set:Npn \__char_generate:nnnn #1#2#3#4 { - \tl_const:cx - { c__char_nfd_ \__char_generate_char:n {#1} _tl } + \tex_unexpanded:D \exp_after:wN \exp_after:wN \exp_after:wN + { \char_generate:nn {#1} { 13 } } + \tl_if_blank:nF {#2} { - \__char_generate:n { "#2 } + \tex_unexpanded:D \exp_after:wN \exp_after:wN \exp_after:wN + { \char_generate:nn {#2} { 13 } } \tl_if_blank:nF {#3} - { \__char_generate:n { "#3 } } + { + \tex_unexpanded:D \exp_after:wN \exp_after:wN \exp_after:wN + { \char_generate:nn {#3} { 13 } } + \tl_if_blank:nF {#4} + { + \tex_unexpanded:D + \exp_after:wN \exp_after:wN \exp_after:wN + { \char_generate:nn {#4} { 13 } } + } + } } } - \cs_set_protected:Npn \__char_data_auxiii:w - #1 ; #2 ; #3 ; #4 ; #5 ; #6 ; #7 ~ \q_stop + } + \cs_set_protected:Npn \__char_data_auxi:w + #1 ; #2 ; #3 ; #4 ; #5 ; #6 ; #7 ; #8 ; #9 ; + { + \tl_if_blank:nF {#6} { - \cs_set_nopar:Npn \l__char_tmpa_tl {#7} - \reverse_if:N \if_meaning:w \l__char_tmpa_tl \c_empty_tl - \cs_set_nopar:Npn \l__char_tmpb_tl {#5} - \reverse_if:N \if_meaning:w \l__char_tmpa_tl \l__char_tmpb_tl - \tl_const:cx - { c__char_titlecase_ \__char_generate_char:n {#1} _tl } - { \__char_generate:n { "#7 } } - \fi: - \fi: + \tl_if_head_eq_charcode:nNF {#6} < % > + { \__char_data_auxii:w #1 ; #6 ~ \q_stop } } - \group_begin: - \char_set_catcode_space:n { `\ }% - \ior_map_variable:NNn \g__char_data_ior \l__char_tmpa_tl - {% - \if_meaning:w \l__char_tmpa_tl \c_space_tl - \exp_after:wN \ior_map_break: - \fi: - \exp_after:wN \__char_data_auxi:w \l__char_tmpa_tl \q_stop - }% - \group_end: - \ior_close:N \g__char_data_ior - \ior_open:Nn \g__char_data_ior { CaseFolding.txt } + \__char_data_auxiii:w #1 ; + } + \cs_set_protected:Npn \__char_data_auxii:w #1 ; #2 ~ #3 \q_stop + { + \tl_const:cx + { c__char_nfd_ \__char_generate_other:n { "#1 } _tl } + { + { \__char_generate:n { "#2 } } + { + \tl_if_blank:nF {#3} + { \__char_generate:n { "#3 } } + } + } + } + \cs_set_protected:Npn \__char_data_auxiii:w + #1 ; #2 ; #3 ; #4 ; #5 ; #6 ; #7 ~ \q_stop + { + \cs_set_nopar:Npn \l__char_tmpa_tl {#7} + \reverse_if:N \if_meaning:w \l__char_tmpa_tl \c_empty_tl + \cs_set_nopar:Npn \l__char_tmpb_tl {#5} + \reverse_if:N \if_meaning:w \l__char_tmpa_tl \l__char_tmpb_tl + \tl_const:cx + { c__char_titlecase_ \__char_generate_other:n { "#1 } _tl } + { \__char_generate:n { "#7 } } + \fi: + \fi: + } + \ior_open:Nn \g__char_data_ior { UnicodeData.txt } + \group_begin: + \char_set_catcode_space:n { `\ }% + \ior_map_variable:NNn \g__char_data_ior \l__char_tmpa_tl + {% + \if_meaning:w \l__char_tmpa_tl \c_space_tl + \exp_after:wN \ior_map_break: + \fi: + \exp_after:wN \__char_data_auxi:w \l__char_tmpa_tl \q_stop + }% + \group_end: + \ior_open:Nn \g__char_data_ior { CaseFolding.txt } + \cs_set_protected:Npn \__char_data_auxi:w #1 ;~ #2 ;~ #3 ; #4 \q_stop + { + \if:w \tl_head:n { #2 ? } C + \reverse_if:N \if_int_compare:w + \char_value_lccode:n {"#1} = "#3 ~ + \tl_const:cx + { c__char_foldcase_ \__char_generate_other:n { "#1 } _tl } + { \__char_generate:n { "#3 } } + \fi: + \else: + \if:w \tl_head:n { #2 ? } F + \__char_data_auxii:w #1 ~ #3 ~ \q_stop + \fi: + \fi: + } + \bool_lazy_or:nnF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { \cs_set_protected:Npn \__char_data_auxi:w #1 ;~ #2 ;~ #3 ; #4 \q_stop { - \if:w \tl_head:n { #2 ? } C - \reverse_if:N \if_int_compare:w - \char_value_lccode:n {"#1} = "#3 ~ - \tl_const:cx - { c__char_foldcase_ \__char_generate_char:n {#1} _tl } - { \__char_generate:n { "#3 } } - \fi: - \else: - \if:w \tl_head:n { #2 ? } F - \__char_data_auxii:w #1 ~ #3 ~ \q_stop - \fi: + \if:w \tl_head:n { #2 ? } F + \__char_data_auxii:w #1 ~ #3 ~ \q_stop \fi: } - \cs_set_protected:Npn \__char_data_auxii:w #1 ~ #2 ~ #3 ~ #4 \q_stop + } + \cs_set_protected:Npn \__char_data_auxii:w #1 ~ #2 ~ #3 ~ #4 \q_stop + { + \tl_const:cx { c__char_foldcase_ \__char_generate_other:n { "#1 } _tl } + { + \__char_generate:n { "#2 } + \__char_generate:n { "#3 } + \tl_if_blank:nF {#4} + { \__char_generate:n { \int_value:w "#4 } } + } + } + \ior_str_map_inline:Nn \g__char_data_ior + { + \reverse_if:N \if:w \c_hash_str \tl_head:w #1 \c_hash_str \q_stop + \__char_data_auxi:w #1 \q_stop + \fi: + } + \ior_close:N \g__char_data_ior + \ior_open:Nn \g__char_data_ior { SpecialCasing.txt } + \cs_set_protected:Npn \__char_data_auxi:w + #1 ;~ #2 ;~ #3 ;~ #4 ; #5 \q_stop + { + \use:n { \__char_data_auxii:w #1 ~ lower ~ #2 ~ } ~ \q_stop + \use:n { \__char_data_auxii:w #1 ~ upper ~ #4 ~ } ~ \q_stop + \str_if_eq:nnF {#3} {#4} + { \use:n { \__char_data_auxii:w #1 ~ title ~ #3 ~ } ~ \q_stop } + } + \cs_set_protected:Npn \__char_data_auxii:w + #1 ~ #2 ~ #3 ~ #4 ~ #5 \q_stop + { + \tl_if_empty:nF {#4} { - \tl_const:cx { c__char_foldcase_ \__char_generate_char:n {#1} _tl } + \tl_const:cx { c__char_ #2 case_ \__char_generate_other:n { "#1 } _tl } { - \__char_generate:n { "#2 } \__char_generate:n { "#3 } - \tl_if_blank:nF {#4} - { \__char_generate:n { \int_value:w "#4 } } + \__char_generate:n { "#4 } + \tl_if_blank:nF {#5} + { \__char_generate:n { "#5 } } } } - \ior_str_map_inline:Nn \g__char_data_ior - { - \reverse_if:N \if:w \c_hash_str \tl_head:w #1 \c_hash_str \q_stop - \__char_data_auxi:w #1 \q_stop - \fi: - } - \ior_close:N \g__char_data_ior - \ior_open:Nn \g__char_data_ior { SpecialCasing.txt } - \cs_set_protected:Npn \__char_data_auxi:w - #1 ;~ #2 ;~ #3 ;~ #4 ; #5 \q_stop + } + \ior_str_map_inline:Nn \g__char_data_ior + { + \str_if_eq:eeTF { \tl_head:w #1 \c_hash_str \q_stop } { \c_hash_str } { - \use:n { \__char_data_auxii:w #1 ~ lower ~ #2 ~ } ~ \q_stop - \use:n { \__char_data_auxii:w #1 ~ upper ~ #4 ~ } ~ \q_stop - \str_if_eq:nnF {#3} {#4} - { \use:n { \__char_data_auxii:w #1 ~ title ~ #3 ~ } ~ \q_stop } + \str_if_eq:eeT + {#1} + { \c_hash_str \c_space_tl Conditional~Mappings } + { \ior_map_break: } } - \cs_set_protected:Npn \__char_data_auxii:w - #1 ~ #2 ~ #3 ~ #4 ~ #5 \q_stop + { \__char_data_auxi:w #1 \q_stop } + } + \ior_close:N \g__char_data_ior +\group_end: + +\ior_new:N \g__text_data_ior +\group_begin: + \ior_open:Nn \g__text_data_ior { GraphemeBreakProperty.txt } + \cs_set_nopar:Npn \l__text_tmpa_str { } + \cs_set_nopar:Npn \l__text_tmpb_str { } + \cs_set_protected:Npn \__text_data_auxi:w #1 ;~ #2 ~ #3 \q_stop + { + \str_if_eq:VnF \l__text_tmpb_str {#2} { - \tl_if_empty:nF {#4} + \str_if_empty:NF \l__text_tmpb_str { - \tl_const:cx { c__char_ #2 case_ \__char_generate_char:n {#1} _tl } - { - \__char_generate:n { "#3 } - \__char_generate:n { "#4 } - \tl_if_blank:nF {#5} - { \__char_generate:n { "#5 } } - } + \clist_const:cx { c__text_grapheme_ \l__text_tmpb_str _clist } + { \exp_after:wN \use_none:n \l__text_tmpa_str } + \cs_set_nopar:Npn \l__text_tmpa_str { } } + \cs_set_nopar:Npn \l__text_tmpb_str {#2} } - \ior_str_map_inline:Nn \g__char_data_ior + \__text_data_auxii:w #1 .. #1 .. #1 \q_stop + } + \cs_set_protected:Npn \__text_data_auxii:w #1 .. #2 .. #3 \q_stop + { + \cs_set_nopar:Npx \l__text_tmpa_str { - \str_if_eq:eeTF - { \tl_head:w #1 \c_hash_str \q_stop } - { \c_hash_str } - { - \str_if_eq:eeT - {#1} - { \c_hash_str \c_space_tl Conditional~Mappings } - { \ior_map_break: } - } - { \__char_data_auxi:w #1 \q_stop } + \l__text_tmpa_str , + \tl_trim_spaces:n {#1} .. \tl_trim_spaces:n {#2} } - \ior_close:N \g__char_data_ior - \group_end: - } - { - \group_begin: - \ior_open:Nn \g__char_data_ior { UnicodeData.txt } - \ior_close:N \g__char_data_ior - \group_end: - } + } + \ior_str_map_inline:Nn \g__text_data_ior + { + \str_if_eq:eeF { \tl_head:w #1 \c_hash_str \q_stop } { \c_hash_str } + { + \tl_if_blank:nF {#1} + { \__text_data_auxi:w #1 \q_stop } + } + } + \ior_close:N \g__text_data_ior +\group_end: %% File: l3text.dtx \cs_generate_variant:Nn \tl_if_head_eq_meaning_p:nN { o } \scan_new:N \s__text_stop @@ -31791,6 +31951,7 @@ Type H for immediate help}\def~{\errmessage{% \cs_new:Npn \__text_use_i_delimit_by_q_recursion_stop:nw #1 #2 \q__text_recursion_stop {#1} \__kernel_quark_new_test:N \__text_if_q_recursion_tail_stop_do:Nn +\__kernel_quark_new_test:N \__text_if_q_recursion_tail_stop_do:nn \scan_new:N \s__text_recursion_tail \scan_new:N \s__text_recursion_stop \cs_new:Npn \__text_use_i_delimit_by_s_recursion_stop:nw @@ -31935,6 +32096,89 @@ Type H for immediate help}\def~{\errmessage{% } { \prg_return_false: } } +\bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { + \cs_new:Npn \__text_codepoint_process:nN #1#2 { #1 {#2} } + } + { + \cs_new:Npn \__text_codepoint_process:nN #1#2 + { + \int_compare:nNnTF { `#2 } > { "80 } + { + \int_compare:nNnTF { `#2 } < { "E0 } + { \__text_codepoint_process:nNN } + { + \int_compare:nNnTF { `#2 } < { "F0 } + { \__text_codepoint_process:nNNN } + { \__text_codepoint_process:nNNNN } + } + } + { \use:n } + {#1} #2 + } + \cs_new:Npn \__text_codepoint_process:nNN #1#2#3 + { #1 {#2#3} } + \cs_new:Npn \__text_codepoint_process:nNNN #1#2#3#4 + { #1 {#2#3#4} } + \cs_new:Npn \__text_codepoint_process:nNNNN #1#2#3#4#5 + { #1 {#2#3#4#5} } + } +\bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { + \prg_new_conditional:Npnn + \__text_codepoint_compare:nNn #1#2#3 { TF , p } + { + \int_compare:nNnTF { `#1 } #2 {#3} + \prg_return_true: \prg_return_false: + } + } + { + \prg_new_conditional:Npnn + \__text_codepoint_compare:nNn #1#2#3 { TF , p } + { + \int_compare:nNnTF { \__text_codepoint_compare:N #1 } + #2 {#3} + \prg_return_true: \prg_return_false: + } + \cs_new:Npn \__text_codepoint_compare:N #1 + { + \if_int_compare:w `#1 > "80 \exp_stop_f: + \if_int_compare:w `#1 < "E0 \exp_stop_f: + \exp_after:wN \exp_after:wN \exp_after:wN + \__text_codepoint_compare:NN + \else: + \if_int_compare:w `#1 < "F0 \exp_stop_f: + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \__text_codepoint_compare:NNN + \else: + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \exp_after:wN \exp_after:wN + \exp_after:wN \__text_codepoint_compare:NNNN + \fi: + \fi: + \else: + \exp_after:wN \__text_codepoint_compare_aux:N + \fi: + #1 + } + \cs_new:Npn \__text_codepoint_compare_aux:N #1 { `#1 } + \cs_new:Npn \__text_codepoint_compare:NN #1#2 + { (`#1 - "C0) * "40 + `#2 - "80 } + \cs_new:Npn \__text_codepoint_compare:NNN #1#2#3 + { (`#1 - "E0) * "1000 + (`#2 - "80) * "40 + `#3 - "80 } + \cs_new:Npn \__text_codepoint_compare:NNNN #1#2#3#4 + { + (`#1 - "F0) * "40000 + + (`#2 - "80) * "1000 + + (`#3 - "80) * "40 + + `#4 - "80 + } + } \tl_new:N \l_text_accents_tl \tl_set:Nn \l_text_accents_tl { \` \' \^ \~ \= \u \. \" \r \H \v \d \c \k \b \t } @@ -33352,6 +33596,32 @@ Type H for immediate help}\def~{\errmessage{% \cs_new_eq:cc { __text_change_case_title_hy-x-yiwn:nnnN } { __text_change_case_upper_hy-x-yiwn:nnnN } } +\cs_new:cpn { __text_change_case_lower_la-x-medieval:nnnN } #1#2#3#4 + { + \int_compare:nNnTF { `#4 } = { `V } + { + \__text_change_case_store:e + { + \char_generate:nn { `u } { \__text_char_catcode:N #4 } + } + \use:c { __text_change_case_char_next_ #2 :nn } + {#2} {#3} + } + { \__text_change_case_char:nnnN {#1} {#2} {#3} #4 } + } +\cs_new:cpn { __text_change_case_upper_la-x-medieval:nnnN } #1#2#3#4 + { + \int_compare:nNnTF { `#4 } = { `u } + { + \__text_change_case_store:e + { + \char_generate:nn { `V } { \__text_char_catcode:N #4 } + } + \use:c { __text_change_case_char_next_ #2 :nn } + {#2} {#3} + } + { \__text_change_case_char:nnnN {#1} {#2} {#3} #4 } + } \bool_lazy_or:nnT { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: } @@ -34622,6 +34892,355 @@ Type H for immediate help}\def~{\errmessage{% } } } +%% File: l3text-map.dtx +\cs_new:Npn \text_map_function:nN #1#2 + { \exp_args:Ne \__text_map_function:nN { \text_expand:n {#1} } #2 } +\cs_new:Npn \__text_map_function:nN #1#2 + { + \__text_map_loop:Nnw #2 { } #1 + \q__text_recursion_tail \q__text_recursion_stop + \prg_break_point:Nn \text_map_break: { } + } +\cs_new:Npn \__text_map_loop:Nnw #1#2#3 \q__text_recursion_stop + { + \tl_if_head_is_N_type:nTF {#3} + { \__text_map_N_type:NnN } + { + \tl_if_head_is_group:nTF {#3} + { \__text_map_group:Nnn } + { \__text_map_space:Nnw } + } + #1 {#2} #3 \q__text_recursion_stop + } +\cs_new:Npn \__text_map_group:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + { + \__text_map_loop:Nnw #1 { } #2 + \q__text_recursion_tail \q__text_recursion_stop + \prg_break_point:Nn \text_map_break: { } + } + \__text_map_loop:Nnw #1 { } + } +\use:x + { \cs_new:Npn \exp_not:N \__text_map_space:Nnw ##1##2 \c_space_tl } + { + \__text_map_output:Nn #1 {#2} + #1 { ~ } + \__text_map_loop:Nnw #1 { } + } +\cs_new:Npn \__text_map_N_type:NnN #1#2#3 + { + \__text_if_q_recursion_tail_stop_do:Nn #3 + { + \__text_map_output:Nn #1 {#2} + \text_map_break: + } + \token_if_cs:NTF #3 + { + \__text_map_output:Nn #1 {#2} + #1 {#3} + \__text_map_loop:Nnw #1 { } + } + { + \__text_codepoint_process:nN + { \__text_map_codepoint:Nnn #1 {#2} } #3 + } + } +\cs_new:Npn \__text_map_codepoint:Nnn #1#2#3 + { + \__text_codepoint_compare:nNnTF {#3} = { "0D } + { + \__text_map_output:Nn #1 {#2} + \__text_map_CR:Nnw #1 {#3} + } + { + \__text_codepoint_compare:nNnTF {#3} = { "200D } + { \__text_map_loop:Nnw #1 {#2#3} } + { \__text_map_class:Nnnn #1 {#2} {#3} { Control } } + } + } +\cs_new:Npn \__text_map_CR:Nnw #1#2#3 \q__text_recursion_stop + { + \tl_if_head_is_N_type:nTF {#3} + { \__text_map_CR:NnN #1 {#2} } + { + #1 {#2} + \__text_map_loop:Nnw #1 { } + } + #3 \q__text_recursion_stop + } +\cs_new:Npn \__text_map_CR:NnN #1#2#3 + { + \__text_if_q_recursion_tail_stop_do:Nn #3 + { + #1 {#2} + \text_map_break: + } + \bool_lazy_and:nnTF + { ! \token_if_cs_p:N #3 } + { \int_compare_p:nNn { `#3 } = { "0A } } + { + \__text_map_output:Nn #1 {#2#3} + \__text_map_loop:Nnw #1 { } + } + { \__text_map_loop:Nnw #1 { } #3 } + } +\cs_new:Npn \__text_map_class:Nnnn #1#2#3#4 + { + \exp_args:Nv \__text_map_class:nNnnn { c__text_grapheme_ #4 _clist } + #1 {#2} {#3} {#4} + } +\cs_new:Npn \__text_map_class:nNnnn #1#2#3#4#5 + { + \__text_map_class_loop:Nnnnw #2 {#3} {#4} {#5} + #1 , \q__text_recursion_tail .. , \q__text_recursion_stop + } +\cs_new:Npn \__text_map_class_loop:Nnnnw #1#2#3#4 #5 .. #6 , + { + \__text_if_q_recursion_tail_stop_do:nn {#5} + { \use:c { __text_map_not_ #4 :Nnn } #1 {#2} {#3} } + \__text_codepoint_compare:nNnTF {#3} < { "#5 } + { + \__text_map_class_end:nw + { \use:c { __text_map_not_ #4 :Nnn } #1 {#2} {#3} } + } + { + \__text_codepoint_compare:nNnTF {#3} > { "#6 } + { \__text_map_class_loop:Nnnnw #1 {#2} {#3} {#4} } + { + \__text_map_class_end:nw + { \use:c { __text_map_ #4 :Nnn } #1 {#2} {#3} } + } + } + } +\cs_new:Npn \__text_map_class_end:nw #1#2 \q__text_recursion_stop {#1} +\cs_new:Npn \__text_map_Control:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + \__text_map_output:Nn #1 {#3} + \__text_map_loop:Nnw #1 { } + } +\cs_new:Npn \__text_map_Extend:Nnn #1#2#3 + { \__text_map_loop:Nnw #1 {#2#3} } +\cs_new_eq:NN \__text_map_SpacingMark:Nnn \__text_map_Extend:Nnn +\cs_new:Npn \__text_map_Prepend:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + \__text_map_lookahead:NnNw #1 {#3} \__text_map_Prepend_aux:Nnn + } +\cs_new:Npn \__text_map_Prepend_aux:Nnn #1#2#3 + { + \bool_lazy_or:nnTF + { \__text_codepoint_compare_p:nNn {#3} = { "0A } } + { \__text_codepoint_compare_p:nNn {#3} = { "0D } } + { + #1 {#2} + \__text_map_loop:Nnw #1 {#3} + } + { + \exp_args:NV \__text_map_Prepend:nNnn + \c__text_grapheme_Control_clist + #1 {#2} {#3} + } + } +\cs_new:Npn \__text_map_Prepend:nNnn #1#2#3#4 + { + \__text_map_Prepend_loop:Nnnw #2 {#3} {#4} + #1 , \q__text_recursion_tail .. , \q__text_recursion_stop + } +\cs_new:Npn \__text_map_Prepend_loop:Nnnw #1#2#3 #4 .. #5 , + { + \__text_if_q_recursion_tail_stop_do:nn {#4} + { \__text_map_loop:Nnw #1 {#2#3} } + \__text_codepoint_compare:nNnTF {#3} < { "#4 } + { + \__text_map_class_end:nw + { \__text_map_loop:Nnw #1 {#2#3} } + } + { + \__text_codepoint_compare:nNnTF {#3} > { "#5 } + { \__text_map_Prepend_loop:Nnnw #1 {#2} {#3} } + { + \__text_map_class_end:nw + { \__text_map_loop:Nnw #1 {#2} #3 } + } + } + } +\cs_new:Npn \__text_map_not_Control:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { Extend } } +\cs_new:Npn \__text_map_not_Extend:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { SpacingMark } } +\cs_new:Npn \__text_map_not_SpacingMark:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { Prepend } } +\cs_new:Npn \__text_map_not_Prepend:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { L } } +\cs_new:Npn \__text_map_not_L:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { LV } } +\cs_new:Npn \__text_map_not_LV:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { V } } +\cs_new:Npn \__text_map_not_V:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { LVT } } +\cs_new:Npn \__text_map_not_LVT:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { T } } +\cs_new:Npn \__text_map_not_T:Nnn #1#2#3 + { \__text_map_class:Nnnn #1 {#2} {#3} { Regional_Indicator } } +\cs_new:Npn \__text_map_not_Regional_Indicator:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + \__text_map_loop:Nnw #1 {#3} + } +\cs_new:Npn \__text_map_L:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + \__text_map_hangul:Nnnw + #1 {#3} { L ; V ; LV ; LVT } + } +\cs_new:Npn \__text_map_LV:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + \__text_map_hangul:Nnnw + #1 {#3} { V ; T } + } +\cs_new_eq:NN \__text_map_V:Nnn \__text_map_LV:Nnn +\cs_new:Npn \__text_map_LVT:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + \__text_map_hangul:Nnnw + #1 {#3} { T } + } +\cs_new_eq:NN \__text_map_T:Nnn \__text_map_LVT:Nnn +\cs_new:Npn \__text_map_hangul:Nnnw #1#2#3#4 \q__text_recursion_stop + { + \tl_if_head_is_N_type:nTF {#4} + { \__text_map_hangul:NnnN #1 {#2} {#3} } + { + #1 {#2} + \__text_map_loop:Nnw #1 { } + } + #4 \q__text_recursion_stop + } +\cs_new:Npn \__text_map_hangul:NnnN #1#2#3#4 + { + \__text_if_q_recursion_tail_stop_do:Nn #4 + { + #1 {#2} + \text_map_break: + } + \token_if_cs:NTF #4 + { + #1 {#2} + \__text_map_loop:Nnw #1 { } + } + { + \__text_codepoint_process:nN + { \__text_map_hangul:Nnnn #1 {#2} {#3} } #4 + } + } +\cs_new:Npn \__text_map_hangul:Nnnn #1#2#3#4 + { + \__text_map_hangul_aux:Nnnw #1 {#2} {#4} + #3 ; \q_recursion_tail ; \q_recursion_stop + } +\cs_new:Npn \__text_map_hangul_aux:Nnnw #1#2#3#4 ; + { + \quark_if_recursion_tail_stop_do:nn {#4} + { \__text_map_loop:Nnw #1 {#2} #3 } + \exp_args:Nv \__text_map_hangul:nNnnnw { c__text_grapheme_ #4 _clist } + #1 {#2} {#3} {#4} + } +\cs_new:Npn \__text_map_hangul:nNnnnw #1#2#3#4#5#6 \q_recursion_stop + { + \__text_map_hangul_loop:Nnnnnw #2 {#3} {#4} {#5} {#6} + #1 , \q__text_recursion_tail .. , \q__text_recursion_stop + } +\cs_new:Npn \__text_map_hangul_loop:Nnnnnw #1#2#3#4#5 #6 .. #7 , + { + \__text_if_q_recursion_tail_stop_do:nn {#6} + { \__text_map_hangul_next:Nnnn #1 {#2} {#3} {#5} } + \__text_codepoint_compare:nNnTF {#3} < { "#6 } + { + \__text_map_hangul_end:nw + { \__text_map_hangul_next:Nnnn #1 {#2} {#3} {#5} } + } + { + \__text_codepoint_compare:nNnTF {#3} > { "#7 } + { \__text_map_hangul_loop:Nnnnnw #1 {#2} {#3} {#4} {#5} } + { + \__text_map_hangul_end:nw + { \use:c { __text_map_hangul_ #4 :Nnn } #1 {#2} {#3} } + } + } + } +\cs_new:Npn \__text_map_hangul_next:Nnnn #1#2#3#4 + { \__text_map_hangul_aux:Nnnw #1 {#2} {#3} #4 \q_recursion_stop } +\cs_new:Npn \__text_map_hangul_end:nw #1#2 \q__text_recursion_stop {#1} +\cs_new:Npn \__text_map_hangul_L:Nnn #1#2#3 + { + \__text_map_hangul:Nnnw + #1 {#2#3} { L V { LV } { LVT } } + } +\cs_new:Npn \__text_map_hangul_LV:Nnn #1#2#3 + { + \__text_map_hangul:Nnnw + #1 {#2#3} { VT } + } +\cs_new_eq:NN \__text_map_hangul_V:Nnn \__text_map_hangul_LV:Nnn +\cs_new:Npn \__text_map_hangul_LVT:Nnn #1#2#3 + { + \__text_map_hangul:Nnnw + #1 {#2#3} { T } + } +\cs_new_eq:NN \__text_map_hangul_T:Nnn \__text_map_hangul_LVT:Nnn +\cs_new:Npn \__text_map_Regional_Indicator:Nnn #1#2#3 + { + \__text_map_output:Nn #1 {#2} + \__text_map_lookahead:NnNw #1 {#3} \__text_map_Regional_Indicator_aux:Nnn + } +\cs_new:Npn \__text_map_Regional_Indicator_aux:Nnn #1#2#3 + { + \bool_lazy_or:nnTF + { \__text_codepoint_compare_p:nNn {#3} < { "1F1E6 } } + { \__text_codepoint_compare_p:nNn {#3} > { "1F1FF } } + { + \__text_map_loop:Nnw #1 {#2} #3 + } + { \__text_map_loop:Nnw #1 {#2#3} } + } +\cs_new:Npn \__text_map_lookahead:NnNw #1#2#3#4 \q__text_recursion_stop + { + \tl_if_head_is_N_type:nTF {#4} + { \__text_map_lookahead:NnNN #1 {#2} #3 } + { \__text_map_loop:Nnw #1 {#2} } + #4 \q__text_recursion_stop + } +\cs_new:Npn \__text_map_lookahead:NnNN #1#2#3#4 + { + \__text_if_q_recursion_tail_stop_do:Nn #4 { #1 {#2} } + \token_if_cs:NTF #4 + { + #1 {#2} + \__text_map_loop:Nnw #1 { } + } + { \__text_codepoint_process:nN { #3 #1 {#2} } } + #4 + } +\cs_new:Npn \__text_map_output:Nn #1#2 + { \tl_if_blank:nF {#2} { #1 {#2} } } +\cs_new:Npn \text_map_break: + { \prg_map_break:Nn \text_map_break: { } } +\cs_new:Npn \text_map_break:n + { \prg_map_break:Nn \text_map_break: } +\cs_new_protected:Npn \text_map_inline:nn #1#2 + { + \int_gincr:N \g__kernel_prg_map_int + \cs_gset_protected:cpn + { __text_map_ \int_use:N \g__kernel_prg_map_int :w } ##1 {#2} + \exp_args:Nnc \text_map_function:nN {#1} + { __text_map_ \int_use:N \g__kernel_prg_map_int :w } + \prg_break_point:Nn \text_map_break: + { \int_gdecr:N \g__kernel_prg_map_int } + } %% File: l3text-purify.dtx \__kernel_quark_new_test:N \__text_if_recursion_tail_stop:N \cs_new:Npn \text_purify:n #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex index 2bb475c14fc..7e1fdd7a0e3 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2022-08-23}% +\def\ExplFileDate{2022-08-30}% \let\ExplLoaderFileDate\ExplFileDate \begingroup \catcode`\_=11 diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx b/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx index 9e63d6fa6f1..c01f3175b53 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.ltx @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2022-08-23}% +\def\ExplFileDate{2022-08-30}% \let\ExplLoaderFileDate\ExplFileDate \begingroup \catcode`\_=11 diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 24372534835..d5a77038172 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2022-08-23}% +\def\ExplFileDate{2022-08-30}% \let\ExplLoaderFileDate\ExplFileDate \ProvidesPackage{expl3} [% -- cgit v1.2.3