[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use primitive conditionals for Unicode data loader (7fd3db0)
Joseph Wright
joseph.wright at morningstar2.co.uk
Fri Jan 11 23:51:18 CET 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/7fd3db0b055fccc12f5a0246c36447e6f6af7d72
>---------------------------------------------------------------
commit 7fd3db0b055fccc12f5a0246c36447e6f6af7d72
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Jan 11 22:06:05 2019 +0000
Use primitive conditionals for Unicode data loader
>---------------------------------------------------------------
7fd3db0b055fccc12f5a0246c36447e6f6af7d72
l3kernel/l3unicode.dtx | 41 +++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/l3kernel/l3unicode.dtx b/l3kernel/l3unicode.dtx
index ef39b6e..8d20576 100644
--- a/l3kernel/l3unicode.dtx
+++ b/l3kernel/l3unicode.dtx
@@ -73,7 +73,9 @@
% As only the data needs to remain at the end of this process, everything
% is set up inside a group. The only thing that is outside is creating a
% stream: they are global anyway and it is best to force a stream for
-% all engines.
+% all engines. For performance reasons, some of the code here is very
+% low-level: the material is read during loading \pkg{expl3} in package
+% mode.
% \begin{macrocode}
\ior_new:N \g_@@_data_ior
\bool_lazy_or:nnTF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: }
@@ -96,23 +98,25 @@
\cs_set_protected:Npn \@@_data_auxii:w
#1 ; #2 ; #3 ; #4 ; #5 ; #6 ; #7 \q_stop
{
- \tl_if_blank:nF {#7}
- {
- \str_if_eq:nnF {#5} {#7}
+ \cs_set_nopar:Npn \l_@@_tmpa_tl {#7}
+ \reverse_if:N \if_meaning:w \l_@@_tmpa_tl \c_empty_tl
+ \cs_set_nopar:Npn \l_@@_tmpb_tl {#5}
+ \reverse_if:N \if_meaning:w \l_@@_tmpa_tl \l_@@_tmpb_tl
+ \tl_const:cx
+ { c_@@_mixed_case_ \@@_generate:w "#1 _tl }
{
- \tl_const:cx
- { c_@@_mixed_case_ \@@_generate:w "#1 _tl }
- {
- \char_generate:nn { "#7 }
- { \char_value_catcode:n { "#7 } }
- }
+ \char_generate:nn { "#7 }
+ { \char_value_catcode:n { "#7 } }
}
- }
+ \fi:
+ \fi:
}
\ior_map_inline:Nn \g_@@_data_ior
{
- \tl_if_blank:nF {#1}
- { \@@_data_auxi:w #1 \q_stop }
+ \cs_set_nopar:Npn \l_@@_tmpa_tl {#1}
+ \reverse_if:N \if_meaning:w \l_@@_tmpa_tl \c_space_tl
+ \@@_data_auxi:w #1 \q_stop
+ \fi:
}
\ior_close:N \g_@@_data_ior
% \end{macrocode}
@@ -161,11 +165,12 @@
}
\ior_str_map_inline:Nn \g_@@_data_ior
{
- \tl_if_blank:nF {#1}
- {
- \str_if_eq:eeF { \tl_head:n {#1} } { \c_hash_str }
- { \@@_data_auxi:w #1 \q_stop }
- }
+ \cs_set_nopar:Npn \l_@@_tmpa_tl {#1}
+ \reverse_if:N \if_meaning:w \l_@@_tmpa_tl \c_empty_tl
+ \reverse_if:N \if:w \tl_head:n { #1 ? } \c_hash_str
+ \@@_data_auxi:w #1 \q_stop
+ \fi:
+ \fi:
}
\ior_close:N \g_@@_data_ior
% \end{macrocode}
More information about the latex3-commits
mailing list