summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3text.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3text.dtx140
1 files changed, 65 insertions, 75 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
index c9121e6750a..8440ecbdbc9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2023-02-07}
+% \date{Released 2023-02-22}
%
% \maketitle
%
@@ -633,7 +633,7 @@
%
% For working with codepoints in an engine-neutral way.
%
-% \begin{macro}[EXP]{\@@_codepoint_process:nN}
+% \begin{macro}[EXP]{\@@_codepoint_process:nN, \@@_codepoint_process_aux:nN}
% \begin{macro}[EXP]{\@@_codepoint_process:nNN}
% \begin{macro}[EXP]{\@@_codepoint_process:nNNN}
% \begin{macro}[EXP]{\@@_codepoint_process:nNNNN}
@@ -647,43 +647,38 @@
\cs_new:Npn \@@_codepoint_process:nN #1#2 { #1 {#2} }
}
{
- \cs_new:Npn \@@_codepoint_process:nN #1#2
+ \cs_new:Npx \@@_codepoint_process:nN #1#2
{
- \int_compare:nNnTF { `#2 } > { "80 }
+ \exp_not:N \int_compare:nNnTF {`#2} > { "80 }
{
- \int_compare:nNnTF { `#2 } < { "E0 }
- { \@@_codepoint_process:nNN }
+ \sys_if_engine_pdftex:TF
+ { \exp_not:N \@@_codepoint_process_aux:nN }
{
- \int_compare:nNnTF { `#2 } < { "F0 }
- { \@@_codepoint_process:nNNN }
- { \@@_codepoint_process:nNNNN }
+ \exp_not:N \int_compare:nNnTF {`#2} > { "FF }
+ { \exp_not:N \use:n }
+ { \exp_not:N \@@_codepoint_process_aux:nN }
}
}
- { \use:n }
+ { \exp_not:N \use:n }
{#1} #2
}
- \cs_new:Npn \@@_codepoint_process:nNN #1#2#3
- { #1 {#2#3} }
- \sys_if_engine_ptex:TF
+ \cs_new:Npn \@@_codepoint_process_aux:nN #1#2
{
- \cs_gset:Npn \@@_codepoint_process:nN #1#2
+ \int_compare:nNnTF { `#2 } < { "E0 }
+ { \@@_codepoint_process:nNN }
{
- \int_compare:nNnTF { `#2 } > { "80 }
- {
- \int_compare:nNnTF { `#2 } < { "E0 }
- { \@@_codepoint_process:nNN }
- { \use:n }
- }
- { \use:n }
+ \int_compare:nNnTF { `#2 } < { "F0 }
+ { \@@_codepoint_process:nNNN }
+ { \@@_codepoint_process:nNNNN }
+ }
{#1} #2
}
- }
- {
- \cs_new:Npn \@@_codepoint_process:nNNN #1#2#3#4
- { #1 {#2#3#4} }
- \cs_new:Npn \@@_codepoint_process:nNNNN #1#2#3#4#5
- { #1 {#2#3#4#5} }
- }
+ \cs_new:Npn \@@_codepoint_process:nNN #1#2#3
+ { #1 {#2#3} }
+ \cs_new:Npn \@@_codepoint_process:nNNN #1#2#3#4
+ { #1 {#2#3#4} }
+ \cs_new:Npn \@@_codepoint_process:nNNNN #1#2#3#4#5
+ { #1 {#2#3#4#5} }
}
% \end{macrocode}
% \end{macro}
@@ -692,7 +687,8 @@
% \end{macro}
%
% \begin{macro}[EXP, pTF]{\@@_codepoint_compare:nNn}
-% \begin{macro}[EXP]{\@@_codepoint_from_chars:Nw}
+% \begin{macro}[EXP]
+% {\@@_codepoint_from_chars:Nw, \@@_codepoint_from_chars_aux:Nw}
% \begin{macro}[EXP]{\@@_codepoint_from_chars:N}
% \begin{macro}[EXP]{\@@_codepoint_from_chars:NN}
% \begin{macro}[EXP]{\@@_codepoint_from_chars:NNN}
@@ -720,62 +716,56 @@
#2 {#3}
\prg_return_true: \prg_return_false:
}
- \cs_new:Npn \@@_codepoint_from_chars:Nw #1
+ \cs_new:Npx \@@_codepoint_from_chars:Nw #1
+ {
+ \exp_not:N \if_int_compare:w `#1 > "80 \exp_not:N \exp_stop_f:
+ \sys_if_engine_pdftex:TF
+ {
+ \exp_not:N \exp_after:wN
+ \exp_not:N \@@_codepoint_from_chars_aux:Nw
+ }
+ {
+ \exp_not:N \if_int_compare:w `#1 > "FF \exp_not:N \exp_stop_f:
+ \exp_not:N \exp_after:wN \exp_not:N \exp_after:wN
+ \exp_not:N \exp_after:wN
+ \exp_not:N \@@_codepoint_from_chars:N
+ \exp_not:N \else:
+ \exp_not:N \exp_after:wN \exp_not:N \exp_after:wN
+ \exp_not:N \exp_after:wN
+ \exp_not:N \@@_codepoint_from_chars_aux:Nw
+ \exp_not:N \fi:
+ }
+ \exp_not:N \else:
+ \exp_not:N \exp_after:wN \exp_not:N \@@_codepoint_from_chars:N
+ \exp_not:N \fi:
+ #1
+ }
+ \cs_new:Npn \@@_codepoint_from_chars_aux:Nw #1
{
- \if_int_compare:w `#1 > "80 \exp_stop_f:
- \if_int_compare:w `#1 < "E0 \exp_stop_f:
+ \if_int_compare:w `#1 < "E0 \exp_stop_f:
+ \exp_after:wN \@@_codepoint_from_chars:NN
+ \else:
+ \if_int_compare:w `#1 < "F0 \exp_stop_f:
\exp_after:wN \exp_after:wN \exp_after:wN
- \@@_codepoint_from_chars:NN
+ \@@_codepoint_from_chars:NNN
\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 \@@_codepoint_from_chars:NNN
- \else:
- \exp_after:wN \exp_after:wN \exp_after:wN
- \exp_after:wN \exp_after:wN \exp_after:wN
- \exp_after:wN \@@_codepoint_from_chars:NNNN
- \fi:
+ \exp_after:wN \exp_after:wN \exp_after:wN
+ \@@_codepoint_from_chars:NNNN
\fi:
- \else:
- \exp_after:wN \@@_codepoint_from_chars:N
\fi:
#1
}
- \cs_new:Npn \@@_codepoint_from_chars:N #1 { `#1 }
+ \cs_new:Npn \@@_codepoint_from_chars:N #1 {`#1}
\cs_new:Npn \@@_codepoint_from_chars:NN #1#2
{ (`#1 - "C0) * "40 + `#2 - "80 }
- % \end{macrocode}
- % Avoid high chars with p\TeX{}.
- % \begin{macrocode}
- \sys_if_engine_ptex:TF
+ \cs_new:Npn \@@_codepoint_from_chars:NNN #1#2#3
+ { (`#1 - "E0) * "1000 + (`#2 - "80) * "40 + `#3 - "80 }
+ \cs_new:Npn \@@_codepoint_from_chars:NNNN #1#2#3#4
{
- \cs_gset:Npn \@@_codepoint_from_chars:Nw #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
- \@@_codepoint_from_chars:NN
- \else:
- \exp_after:wN \exp_after:wN \exp_after:wN
- \@@_codepoint_from_chars:N
- \fi:
- \else:
- \exp_after:wN \@@_codepoint_from_chars:N
- \fi:
- #1
- }
- }
- {
- \cs_new:Npn \@@_codepoint_from_chars:NNN #1#2#3
- { (`#1 - "E0) * "1000 + (`#2 - "80) * "40 + `#3 - "80 }
- \cs_new:Npn \@@_codepoint_from_chars:NNNN #1#2#3#4
- {
- (`#1 - "F0) * "40000
- + (`#2 - "80) * "1000
- + (`#3 - "80) * "40
- + `#4 - "80
- }
+ (`#1 - "F0) * "40000
+ + (`#2 - "80) * "1000
+ + (`#3 - "80) * "40
+ + `#4 - "80
}
}
% \end{macrocode}