[latex3-commits] [git/LaTeX3-latex3-latex3] unicode-data: More pTeX work (aa84518eb)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Oct 13 14:19:46 CEST 2022
Repository : https://github.com/latex3/latex3
On branch : unicode-data
Link : https://github.com/latex3/latex3/commit/aa84518ebe290e656fc7cd6c0bb2fd3ce18c72f4
>---------------------------------------------------------------
commit aa84518ebe290e656fc7cd6c0bb2fd3ce18c72f4
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Oct 13 13:19:07 2022 +0100
More pTeX work
>---------------------------------------------------------------
aa84518ebe290e656fc7cd6c0bb2fd3ce18c72f4
l3kernel/l3text.dtx | 56 ++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 38 insertions(+), 18 deletions(-)
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 0747912c4..3aac8cc14 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -675,9 +675,11 @@
{ \use:n }
{#1} #2
}
- \sys_if_engine_ptex:T
+ \cs_new:Npn \@@_codepoint_process:nNN #1#2#3
+ { #1 {#2#3} }
+ \sys_if_engine_ptex:TF
{
- \cs_new:Npn \@@_codepoint_process:nN #1#2
+ \cs_gset:Npn \@@_codepoint_process:nN #1#2
{
\int_compare:nNnTF { `#2 } > { "80 }
{
@@ -687,14 +689,14 @@
}
{ \use:n }
{#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}
@@ -754,19 +756,37 @@
\cs_new:Npn \@@_codepoint_compare_aux:N #1 { `#1 }
\cs_new:Npn \@@_codepoint_compare:NN #1#2
{ (`#1 - "C0) * "40 + `#2 - "80 }
- \cs_new:Npn \@@_codepoint_compare:NNN #1#2#3
- { (`#1 - "E0) * "1000 + (`#2 - "80) * "40 + `#3 - "80 }
- \cs_new:Npn \@@_codepoint_compare:NNNN #1#2#3#4
+ % \end{macrocode}
+ % Avoid high chars with p\TeX{}
+ % \begin{macrocode}
+ \sys_if_engine_ptex:TF
{
- (`#1 - "F0) * "40000
- + (`#2 - "80) * "1000
- + (`#3 - "80) * "40
- + `#4 - "80
+ \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
+ }
}
- \sys_if_engine_ptex:T
{
- \cs_gset:Npn \@@_codepoint_from_chars:NNN #1#2#3 { -1 }
- \cs_gset:Npn \@@_codepoint_from_chars:NNNN #1#2#3#4 { -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
+ }
}
}
% \end{macrocode}
More information about the latex3-commits
mailing list.