summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-03-06 21:32:34 +0000
committerKarl Berry <karl@freefriends.org>2020-03-06 21:32:34 +0000
commit1dae86987b4152b234ab39938157bb6a078b4852 (patch)
treecc9580a69acdf690cb5f30c0fddfae604d7a96cb /Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
parent994560f76edc0ba77542b37a69a0f7e2de8733a1 (diff)
l3 (6mar20)
git-svn-id: svn://tug.org/texlive/trunk@54131 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.tex599
1 files changed, 590 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
index 2a8cd31429e..10dd174a8f9 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
+++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
@@ -50,6 +50,7 @@
%% l3unicode.dtx (with options: `package')
%% l3text.dtx (with options: `package')
%% l3text-case.dtx (with options: `package')
+%% l3text-purify.dtx (with options: `package')
%% l3candidates.dtx (with options: `package')
%% l3legacy.dtx (with options: `package')
%% l3deprecation.dtx (with options: `package,kernel')
@@ -67,7 +68,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: expl3.dtx
-\def\ExplFileDate{2020-03-03}%
+\def\ExplFileDate{2020-03-06}%
\begingroup
\def\next{\endgroup}%
\expandafter\ifx\csname PackageError\endcsname\relax
@@ -28921,7 +28922,7 @@
\cs_new:Npn \__text_change_case_lower_tr:nnNw #1#2#3#4 \q_recursion_stop
{
\tl_if_head_is_N_type:nTF {#4}
- { \__text_change_case_lower_tr:nnN }
+ { \__text_change_case_lower_tr:NnnN #3 }
{
\__text_change_case_store:e
{ \char_generate:nn { "0131 } { \__text_char_catcode:N #3 } }
@@ -28929,20 +28930,20 @@
}
{#1} {#2} #4 \q_recursion_stop
}
- \cs_new:Npn \__text_change_case_lower_tr:nnN #1#2#3
+ \cs_new:Npn \__text_change_case_lower_tr:NnnN #1#2#3#4
{
\bool_lazy_or:nnTF
- { \token_if_cs_p:N #3 }
- { ! \int_compare_p:nNn { `#3 } = { "0307 } }
+ { \token_if_cs_p:N #4 }
+ { ! \int_compare_p:nNn { `#4 } = { "0307 } }
{
\__text_change_case_store:e
- { \char_generate:nn { "0131 } { \__text_char_catcode:N #3 } }
- \__text_change_case_loop:nnw {#1} {#2} #3
+ { \char_generate:nn { "0131 } { \__text_char_catcode:N #1 } }
+ \__text_change_case_loop:nnw {#2} {#3} #4
}
{
\__text_change_case_store:e
- { \char_generate:nn { "0069 } { \__text_char_catcode:N #3 } }
- \__text_change_case_loop:nnw {#1} {#2}
+ { \char_generate:nn { "0069 } { \__text_char_catcode:N #1 } }
+ \__text_change_case_loop:nnw {#2} {#3}
}
}
}
@@ -29347,6 +29348,586 @@
\group_end:
}
}
+%% File: l3text-purify.dtx
+\cs_new:Npn \text_purify:n #1
+ {
+ \group_align_safe_begin:
+ \exp_args:Ne \__text_purify:n
+ { \text_expand:n {#1} }
+ \group_align_safe_end:
+ }
+\cs_new:Npn \__text_purify:n #1
+ { \__text_purify_loop:w #1 \q_recursion_tail \q_recursion_stop }
+\cs_new:Npn \__text_purify_loop:w #1 \q_recursion_stop
+ {
+ \tl_if_head_is_N_type:nTF {#1}
+ { \__text_purify_N_type:N }
+ {
+ \tl_if_head_is_group:nTF {#1}
+ { \__text_purify_group:n }
+ { \__text_purify_space:w }
+ }
+ #1 \q_recursion_stop
+ }
+\cs_new:Npn \__text_purify_group:n #1 { \__text_purify_loop:w #1 }
+\exp_last_unbraced:NNo \cs_new:Npn \__text_purify_space:w \c_space_tl
+ {
+ \c_space_tl
+ \__text_purify_loop:w
+ }
+\cs_new:Npn \__text_purify_N_type:N #1
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \__text_purify_N_type_aux:N #1
+ }
+\cs_new:Npn \__text_purify_N_type_aux:N #1
+ {
+ \exp_after:wN \__text_purify_math_search:NNN
+ \exp_after:wN #1 \l_text_math_delims_tl
+ \q_recursion_tail ?
+ \q_recursion_stop
+ }
+\cs_new:Npn \__text_purify_math_search:NNN #1#2#3
+ {
+ \quark_if_recursion_tail_stop_do:Nn #2
+ { \__text_purify_math_cmd:N #1 }
+ \token_if_eq_meaning:NNTF #1 #2
+ {
+ \use_i_delimit_by_q_recursion_stop:nw
+ { \__text_purify_math_start:NNw #2 #3 }
+ }
+ { \__text_purify_math_search:NNN #1 }
+ }
+\cs_new:Npn \__text_purify_math_start:NNw #1#2#3 \q_recursion_stop
+ {
+ \__text_purify_math_loop:NNw #1#2#3 \q_recursion_stop
+ \__text_purify_math_result:n { }
+ }
+\cs_new:Npn \__text_purify_math_store:n #1
+ { \__text_purify_math_store:nw {#1} }
+\cs_new:Npn \__text_purify_math_store:nw #1#2 \__text_purify_math_result:n #3
+ { #2 \__text_purify_math_result:n { #3 #1 } }
+\cs_new:Npn \__text_purify_math_end:w #1 \__text_purify_math_result:n #2
+ {
+ \exp_not:n { $ #2 $ }
+ \__text_purify_loop:w #1
+ }
+\cs_new:Npn \__text_purify_math_stop:Nw #1 \__text_purify_math_result:n #2
+ { \exp_not:n {#1#2} }
+\cs_new:Npn \__text_purify_math_loop:NNw #1#2#3 \q_recursion_stop
+ {
+ \tl_if_head_is_N_type:nTF {#3}
+ { \__text_purify_math_N_type:NNN }
+ {
+ \tl_if_head_is_group:nTF {#3}
+ { \__text_purify_math_group:NNn }
+ { \__text_purify_math_space:NNw }
+ }
+ #1#2#3 \q_recursion_stop
+ }
+\cs_new:Npn \__text_purify_math_N_type:NNN #1#2#3
+ {
+ \quark_if_recursion_tail_stop_do:Nn #3
+ { \__text_purify_math_stop:Nw #1 }
+ \token_if_eq_meaning:NNTF #3 #2
+ { \__text_purify_math_end:w }
+ {
+ \__text_purify_math_store:n {#3}
+ \__text_purify_math_loop:NNw #1#2
+ }
+ }
+\cs_new:Npn \__text_purify_math_group:NNn #1#2#3
+ {
+ \__text_purify_math_store:n { {#3} }
+ \__text_purify_math_loop:NNw #1#2
+ }
+\exp_after:wN \cs_new:Npn \exp_after:wN \__text_purify_math_space:NNw
+ \exp_after:wN # \exp_after:wN 1
+ \exp_after:wN # \exp_after:wN 2 \c_space_tl
+ {
+ \__text_purify_math_store:n { ~ }
+ \__text_purify_math_loop:NNw #1#2
+ }
+\cs_new:Npn \__text_purify_math_cmd:N #1
+ {
+ \exp_after:wN \__text_purify_math_cmd:NN \exp_after:wN #1
+ \l_text_math_arg_tl \q_recursion_tail \q_recursion_stop
+ }
+\cs_new:Npn \__text_purify_math_cmd:NN #1#2
+ {
+ \quark_if_recursion_tail_stop_do:Nn #2
+ { \__text_purify_replace:N #1 }
+ \cs_if_eq:NNTF #2 #1
+ {
+ \use_i_delimit_by_q_recursion_stop:nw
+ { \__text_purify_math_cmd:n }
+ }
+ { \__text_purify_math_cmd:NN #1 }
+ }
+\cs_new:Npn \__text_purify_math_cmd:n #1
+ { \__text_purify_math_end:w \__text_purify_math_result:n {#1} }
+\cs_new:Npn \__text_purify_replace:N #1
+ {
+ \bool_lazy_and:nnTF
+ { \cs_if_exist_p:c { l__text_purify_ \token_to_str:N #1 _tl } }
+ {
+ \bool_lazy_or_p:nn
+ { \token_if_cs_p:N #1 }
+ { \token_if_active_p:N #1 }
+ }
+ {
+ \exp_args:Nv \__text_purify_replace:n
+ { l__text_purify_ \token_to_str:N #1 _tl }
+ }
+ {
+ \token_if_cs:NTF #1
+ { \__text_purify_expand:N #1 }
+ {
+ \__text_token_to_explicit:N #1
+ \__text_purify_loop:w
+ }
+ }
+ }
+\cs_new:Npn \__text_purify_replace:n #1 { \__text_purify_loop:w #1 }
+\cs_new:Npn \__text_purify_expand:N #1
+ {
+ \str_if_eq:nnTF {#1} { \protect }
+ { \__text_purify_protect:N }
+ {
+ \__text_if_expandable:NTF #1
+ { \exp_after:wN \__text_purify_loop:w #1 }
+ { \__text_purify_loop:w }
+ }
+ }
+\cs_new:Npn \__text_purify_protect:N #1
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \__text_purify_loop:w
+ }
+\cs_new_protected:Npn \text_declare_purify_equivalent:Nn #1#2
+ {
+ \tl_clear_new:c { l__text_purify_ \token_to_str:N #1 _tl }
+ \tl_set:cn { l__text_purify_ \token_to_str:N #1 _tl } {#2}
+ }
+\cs_generate_variant:Nn \text_declare_purify_equivalent:Nn { Nx }
+\tl_map_inline:nn
+ {
+ \fontencoding
+ \fontfamily
+ \fontseries
+ \fontshape
+ }
+ { \text_declare_purify_equivalent:Nn #1 { \use_none:n } }
+\text_declare_purify_equivalent:Nn \fontsize { \use_none:nn }
+\text_declare_purify_equivalent:Nn \selectfont { }
+\text_declare_purify_equivalent:Nn \usefont { \use_none:nnnn }
+\tl_map_inline:nn
+ {
+ \emph
+ \text
+ \textnormal
+ \textrm
+ \textsf
+ \texttt
+ \textbf
+ \textmd
+ \textit
+ \textsl
+ \textup
+ \textsc
+ \textulc
+ }
+ { \text_declare_purify_equivalent:Nn #1 { \use:n } }
+\tl_map_inline:nn
+ {
+ \normalfont
+ \rmfamily
+ \sffamily
+ \ttfamily
+ \bfseries
+ \mdseries
+ \itshape
+ \scshape
+ \slshape
+ \upshape
+ \em
+ \Huge
+ \LARGE
+ \Large
+ \footnotesize
+ \huge
+ \large
+ \normalsize
+ \scriptsize
+ \small
+ \tiny
+ }
+ { \text_declare_purify_equivalent:Nn #1 { } }
+\text_declare_purify_equivalent:Nn \begin { \use:c }
+\text_declare_purify_equivalent:Nn \end { \use:c }
+\text_declare_purify_equivalent:Nn \\ { }
+\tl_map_inline:nn
+ { \{ \} \# \$ \% \_ }
+ { \text_declare_purify_equivalent:Nx #1 { \cs_to_str:N #1 } }
+\text_declare_purify_equivalent:Nn \label { \use_none:n }
+\group_begin:
+\char_set_catcode_active:N \~
+\use:n
+ {
+ \group_end:
+ \text_declare_purify_equivalent:Nx ~ { \c_space_tl }
+ }
+\text_declare_purify_equivalent:Nn \nobreakspace { ~ }
+\text_declare_purify_equivalent:Nn \ { ~ }
+\text_declare_purify_equivalent:Nn \, { ~ }
+\bool_lazy_or:nnTF
+ { \sys_if_engine_luatex_p: }
+ { \sys_if_engine_xetex_p: }
+ {
+ \cs_set_protected:Npn \__text_loop:Nn #1#2
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \text_declare_purify_equivalent:Nx #1
+ {
+ \char_generate:nn { "#2 }
+ { \char_value_catcode:n { "#2 } }
+ }
+ \__text_loop:Nn
+ }
+ }
+ {
+ \cs_set_protected:Npn \__text_loop:Nn #1#2
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \text_declare_purify_equivalent:Nx #1
+ {
+ \exp_args:Ne \__text_tmp:n
+ { \char_to_utfviii_bytes:n { "#2 } }
+ }
+ \__text_loop:Nn
+ }
+ \cs_set:Npn \__text_tmp:n #1 { \__text_tmp:nnnn #1 }
+ \cs_set:Npn \__text_tmp:nnnn #1#2#3#4
+ {
+ \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 }
+ }
+ }
+\__text_loop:Nn
+ \AA { 00C5 }
+ \AE { 00C6 }
+ \DH { 00D0 }
+ \DJ { 0110 }
+ \IJ { 0132 }
+ \L { 0141 }
+ \NG { 014A }
+ \O { 00D8 }
+ \OE { 0152 }
+ \TH { 00DE }
+ \aa { 00E5 }
+ \ae { 00E6 }
+ \dh { 00F0 }
+ \dj { 0111 }
+ \i { 0131 }
+ \j { 0237 }
+ \ij { 0132 }
+ \l { 0142 }
+ \ng { 014B }
+ \o { 00F8 }
+ \oe { 0153 }
+ \ss { 00DF }
+ \th { 00FE }
+ \q_recursion_tail ?
+ \q_recursion_stop
+\text_declare_purify_equivalent:Nn \SS { SS }
+\cs_new:Npn \__text_purify_accent:NN #1#2
+ {
+ \cs_if_exist:cTF
+ { c__text_purify_ \token_to_str:N #1 _ \token_to_str:N #2 _tl }
+ {
+ \exp_not:v
+ { c__text_purify_ \token_to_str:N #1 _ \token_to_str:N #2 _tl }
+ }
+ {
+ \exp_not:n {#2}
+ \exp_not:v { c__text_purify_ \token_to_str:N #1 _tl }
+ }
+ }
+\tl_map_inline:Nn \l_text_accents_tl
+ { \text_declare_purify_equivalent:Nn #1 { \__text_purify_accent:NN #1 } }
+\group_begin:
+ \cs_set_protected:Npn \__text_loop:Nn #1#2
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \tl_const:cx { c__text_purify_ \token_to_str:N #1 _tl }
+ { \__text_tmp:n {#2} }
+ \__text_loop:Nn
+ }
+ \bool_lazy_or:nnTF
+ { \sys_if_engine_luatex_p: }
+ { \sys_if_engine_xetex_p: }
+ {
+ \cs_set:Npn \__text_tmp:n #1
+ {
+ \char_generate:nn { "#1 }
+ { \char_value_catcode:n { "#1 } }
+ }
+ }
+ {
+ \cs_set:Npn \__text_tmp:n #1
+ {
+ \exp_args:Ne \__text_tmp_aux:n
+ { \char_to_utfviii_bytes:n { "#1 } }
+ }
+ \cs_set:Npn \__text_tmp_aux:n #1 { \__text_tmp:nnnn #1 }
+ \cs_set:Npn \__text_tmp:nnnn #1#2#3#4
+ {
+ \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 }
+ }
+ }
+ \__text_loop:Nn
+ \` { 0300 }
+ \' { 0301 }
+ \^ { 0302 }
+ \~ { 0303 }
+ \= { 0304 }
+ \u { 0306 }
+ \. { 0307 }
+ \" { 0308 }
+ \r { 030A }
+ \H { 030B }
+ \v { 030C }
+ \d { 0323 }
+ \c { 0327 }
+ \k { 0328 }
+ \b { 0331 }
+ \t { 0361 }
+ \q_recursion_tail { }
+ \q_recursion_stop
+ \cs_set_protected:Npn \__text_loop:NNn #1#2#3
+ {
+ \quark_if_recursion_tail_stop:N #1
+ \tl_const:cx
+ { c__text_purify_ \token_to_str:N #1 _ \token_to_str:N #2 _tl }
+ { \__text_tmp:n {#3} }
+ \__text_loop:NNn
+ }
+ \__text_loop:NNn
+ \` A { 00C0 }
+ \' A { 00C1 }
+ \^ A { 00C2 }
+ \~ A { 00C3 }
+ \" A { 00C4 }
+ \r A { 00C5 }
+ \c C { 00C7 }
+ \` E { 00C8 }
+ \' E { 00C9 }
+ \^ E { 00CA }
+ \" E { 00CB }
+ \` I { 00CC }
+ \' I { 00CD }
+ \^ I { 00CE }
+ \" I { 00CF }
+ \~ N { 00D1 }
+ \` O { 00D2 }
+ \' O { 00D3 }
+ \^ O { 00D4 }
+ \~ O { 00D5 }
+ \" O { 00D6 }
+ \` U { 00D9 }
+ \' U { 00DA }
+ \^ U { 00DB }
+ \" U { 00DC }
+ \' Y { 00DD }
+ \` a { 00E0 }
+ \' a { 00E1 }
+ \^ a { 00E2 }
+ \~ a { 00E3 }
+ \" a { 00E4 }
+ \r a { 00E5 }
+ \c c { 00E7 }
+ \` e { 00E8 }
+ \' e { 00E9 }
+ \^ e { 00EA }
+ \" e { 00EB }
+ \` i { 00EC }
+ \` \i { 00EC }
+ \' i { 00ED }
+ \' \i { 00ED }
+ \^ i { 00EE }
+ \^ \i { 00EE }
+ \" i { 00EF }
+ \" \i { 00EF }
+ \~ n { 00F1 }
+ \` o { 00F2 }
+ \' o { 00F3 }
+ \^ o { 00F4 }
+ \~ o { 00F5 }
+ \" o { 00F6 }
+ \` u { 00F9 }
+ \' u { 00FA }
+ \^ u { 00FB }
+ \" u { 00FC }
+ \' y { 00FD }
+ \" y { 00FF }
+ \= A { 0100 }
+ \= a { 0101 }
+ \u A { 0102 }
+ \u a { 0103 }
+ \k A { 0104 }
+ \k a { 0105 }
+ \' C { 0106 }
+ \' c { 0107 }
+ \^ C { 0108 }
+ \^ c { 0109 }
+ \. C { 010A }
+ \. c { 010B }
+ \v C { 010C }
+ \v c { 010D }
+ \v D { 010E }
+ \v d { 010F }
+ \= E { 0112 }
+ \= e { 0113 }
+ \u E { 0114 }
+ \u e { 0115 }
+ \. E { 0116 }
+ \. e { 0117 }
+ \k E { 0118 }
+ \k e { 0119 }
+ \v E { 011A }
+ \v e { 011B }
+ \^ G { 011C }
+ \^ g { 011D }
+ \u G { 011E }
+ \u g { 011F }
+ \. G { 0120 }
+ \. g { 0121 }
+ \c G { 0122 }
+ \c g { 0123 }
+ \^ H { 0124 }
+ \^ h { 0125 }
+ \~ I { 0128 }
+ \~ i { 0129 }
+ \~ \i { 0129 }
+ \= I { 012A }
+ \= i { 012B }
+ \= \i { 012B }
+ \u I { 012C }
+ \u i { 012D }
+ \u \i { 012D }
+ \k I { 012E }
+ \k i { 012F }
+ \k \i { 012F }
+ \. I { 0130 }
+ \^ J { 0134 }
+ \^ j { 0135 }
+ \^ \j { 0135 }
+ \c K { 0136 }
+ \c k { 0137 }
+ \' L { 0139 }
+ \' l { 013A }
+ \c L { 013B }
+ \c l { 013C }
+ \v L { 013D }
+ \v l { 013E }
+ \. L { 013F }
+ \. l { 0140 }
+ \' N { 0143 }
+ \' n { 0144 }
+ \c N { 0145 }
+ \c n { 0146 }
+ \v N { 0147 }
+ \v n { 0148 }
+ \= O { 014C }
+ \= o { 014D }
+ \u O { 014E }
+ \u o { 014F }
+ \H O { 0150 }
+ \H o { 0151 }
+ \' R { 0154 }
+ \' r { 0155 }
+ \c R { 0156 }
+ \c r { 0157 }
+ \v R { 0158 }
+ \v r { 0159 }
+ \' S { 015A }
+ \' s { 015B }
+ \^ S { 015C }
+ \^ s { 015D }
+ \c S { 015E }
+ \c s { 015F }
+ \v S { 0160 }
+ \v s { 0161 }
+ \c T { 0162 }
+ \c t { 0163 }
+ \v T { 0164 }
+ \v t { 0165 }
+ \~ U { 0168 }
+ \~ u { 0169 }
+ \= U { 016A }
+ \= u { 016B }
+ \u U { 016C }
+ \u u { 016D }
+ \r U { 016E }
+ \r u { 016F }
+ \H U { 0170 }
+ \H u { 0171 }
+ \k U { 0172 }
+ \k u { 0173 }
+ \^ W { 0174 }
+ \^ w { 0175 }
+ \^ Y { 0176 }
+ \^ y { 0177 }
+ \" Y { 0178 }
+ \' Z { 0179 }
+ \' z { 017A }
+ \. Z { 017B }
+ \. z { 017C }
+ \v Z { 017D }
+ \v z { 017E }
+ \v A { 01CD }
+ \v a { 01CE }
+ \v I { 01CF }
+ \v \i { 01D0 }
+ \v i { 01D0 }
+ \v O { 01D1 }
+ \v o { 01D2 }
+ \v U { 01D3 }
+ \v u { 01D4 }
+ \v G { 01E6 }
+ \v g { 01E7 }
+ \v K { 01E8 }
+ \v k { 01E9 }
+ \k O { 01EA }
+ \k o { 01EB }
+ \v \j { 01F0 }
+ \v j { 01F0 }
+ \' G { 01F4 }
+ \' g { 01F5 }
+ \` N { 01F8 }
+ \` n { 01F9 }
+ \' \AE { 01FC }
+ \' \ae { 01FD }
+ \' \O { 01FE }
+ \' \o { 01FF }
+ \v H { 021E }
+ \v h { 021F }
+ \. A { 0226 }
+ \. a { 0227 }
+ \c E { 0228 }
+ \c e { 0229 }
+ \. O { 022E }
+ \. o { 022F }
+ \= Y { 0232 }
+ \= y { 0233 }
+ \q_recursion_tail ? { }
+ \q_recursion_stop
+\group_end:
%% File: l3candidates.dtx
\cs_new_protected:Npn \box_clip:N #1
{ \hbox_set:Nn #1 { \__box_backend_clip:N #1 } }