summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3text-purify.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3text-purify.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3text-purify.dtx70
1 files changed, 10 insertions, 60 deletions
diff --git a/macros/latex/contrib/l3kernel/l3text-purify.dtx b/macros/latex/contrib/l3kernel/l3text-purify.dtx
index 5ad506e3cb..01b69e2e95 100644
--- a/macros/latex/contrib/l3kernel/l3text-purify.dtx
+++ b/macros/latex/contrib/l3kernel/l3text-purify.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2023-02-02}
+% \date{Released 2023-02-07}
%
% \maketitle
%
@@ -464,40 +464,15 @@
% gets converted to two letters. (At some stage an alternative version
% can presumably be added to \pkg{babel} or similar.)
% \begin{macrocode}
-\bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
+\cs_set_protected:Npn \@@_loop:Nn #1#2
{
- \cs_set_protected:Npn \@@_loop:Nn #1#2
+ \quark_if_recursion_tail_stop:N #1
+ \text_declare_purify_equivalent:Nx #1
{
- \quark_if_recursion_tail_stop:N #1
- \text_declare_purify_equivalent:Nx #1
- {
- \char_generate:nn { "#2 }
- { \char_value_catcode:n { "#2 } }
- }
- \@@_loop:Nn
- }
- }
- {
- \cs_set_protected:Npn \@@_loop:Nn #1#2
- {
- \quark_if_recursion_tail_stop:N #1
- \text_declare_purify_equivalent:Nx #1
- {
- \exp_args:Ne \@@_tmp:n
- { \__kernel_codepoint_to_bytes:n { "#2 } }
- }
- \@@_loop:Nn
- }
- \cs_set:Npn \@@_tmp:n #1 { \@@_tmp:nnnn #1 }
- \cs_set:Npn \@@_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 }
+ \codepoint_generate:nn {"#2}
+ { \char_value_catcode:n {"#2} }
}
+ \@@_loop:Nn
}
\@@_loop:Nn
\AA { 00C5 }
@@ -547,7 +522,7 @@
\exp_not:v { c_@@_purify_ \token_to_str:N #1 _tl }
}
}
-\tl_map_inline:Nn \l_text_accents_tl
+\tl_map_inline:nn { \` \' \^ \~ \= \u \. \" \r \H \v \d \c \k \b \t }
{ \text_declare_purify_equivalent:Nn #1 { \@@_purify_accent:NN #1 } }
% \end{macrocode}
% First set up the combining accents.
@@ -557,34 +532,9 @@
{
\quark_if_recursion_tail_stop:N #1
\tl_const:cx { c_@@_purify_ \token_to_str:N #1 _tl }
- { \@@_tmp:n {#2} }
+ { \codepoint_generate:nn {"#2} { \char_value_catcode:n { "#2 } } }
\@@_loop:Nn
}
- \bool_lazy_or:nnTF
- { \sys_if_engine_luatex_p: }
- { \sys_if_engine_xetex_p: }
- {
- \cs_set:Npn \@@_tmp:n #1
- {
- \char_generate:nn { "#1 }
- { \char_value_catcode:n { "#1 } }
- }
- }
- {
- \cs_set:Npn \@@_tmp:n #1
- {
- \exp_args:Ne \@@_tmp_aux:n
- { \__kernel_codepoint_to_bytes:n { "#1 } }
- }
- \cs_set:Npn \@@_tmp_aux:n #1 { \@@_tmp:nnnn #1 }
- \cs_set:Npn \@@_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 }
- }
- }
\@@_loop:Nn
\` { 0300 }
\' { 0301 }
@@ -617,7 +567,7 @@
\quark_if_recursion_tail_stop:N #1
\tl_const:cx
{ c_@@_purify_ \token_to_str:N #1 _ \token_to_str:N #2 _tl }
- { \@@_tmp:n {#3} }
+ { \codepoint_generate:nn {"#3} { \char_value_catcode:n { "#3 } } }
\@@_loop:NNn
}
\@@_loop:NNn