[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use fast \char_generate:nn for Unicode data loader (267c1c1)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Jan 11 23:51:44 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/267c1c1d1f87a10ed0069e90874fe6d064b1371a

>---------------------------------------------------------------

commit 267c1c1d1f87a10ed0069e90874fe6d064b1371a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Jan 11 22:47:51 2019 +0000

    Use fast \char_generate:nn for Unicode data loader


>---------------------------------------------------------------

267c1c1d1f87a10ed0069e90874fe6d064b1371a
 l3kernel/l3unicode.dtx |   38 ++++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3unicode.dtx b/l3kernel/l3unicode.dtx
index 8d20576..e959a2a 100644
--- a/l3kernel/l3unicode.dtx
+++ b/l3kernel/l3unicode.dtx
@@ -86,6 +86,28 @@
 %    \begin{macrocode}
       \cs_set_eq:NN \@@_generate:w \tex_Uchar:D
 %    \end{macrocode}
+%   A fast local implementation for generating characters.
+%    \begin{macrocode}
+      \cs_set:Npx \@@_generate:nn #1#2
+        {
+          \sys_if_engine_luatex:TF
+            {
+              \exp_not:N \lua_now:e
+                {
+                  l3kernel.charcat
+                    (
+                      \exp_not:N \int_eval:n {#1} ,
+                      \exp_not:N \int_eval:n {#2}
+                    )
+                }
+            }
+            {
+              \exp_not:N \tex_Ucharcat:D
+                \exp_not:N \int_eval:n {#1} ~
+                \exp_not:N \int_eval:n {#2} ~
+            }
+        }
+%    \end{macrocode}
 % Parse the main Unicode data file for title case exceptions (the one-to-one
 % lower and upper case mappings it contains are all be covered by the \TeX{}
 % data). There are no comments in the main data file so this can be done using
@@ -105,7 +127,7 @@
               \tl_const:cx
                 { c_@@_mixed_case_ \@@_generate:w "#1 _tl }
                 {
-                   \char_generate:nn { "#7 }
+                   \@@_generate:nn { "#7 }
                     { \char_value_catcode:n { "#7 } }
                 }
             \fi:
@@ -138,7 +160,7 @@
                   \tl_const:cx
                     { c_@@_fold_case_ \@@_generate:w "#1 _tl }
                     {
-                      \char_generate:nn { "#3 }
+                      \@@_generate:nn { "#3 }
                         { \char_value_catcode:n { "#3 } }
                     }
                 }
@@ -152,13 +174,13 @@
         {
           \tl_const:cx { c_@@_fold_case_ \@@_generate:w "#1 _tl }
             {
-              \char_generate:nn { "#2 }
+              \@@_generate:nn { "#2 }
                 { \char_value_catcode:n { "#2 } }
-              \char_generate:nn { "#3 }
+              \@@_generate:nn { "#3 }
                 { \char_value_catcode:n { "#3 } }
               \tl_if_blank:nF {#4}
                 {
-                  \char_generate:nn { "#4 }
+                  \@@_generate:nn { "#4 }
                     { \char_value_catcode:n { "#4 } }
                 }
             }
@@ -194,13 +216,13 @@
             {
               \tl_const:cx { c_@@_ #2 _case_ \@@_generate:w "#1 _tl }
                 {
-                  \char_generate:nn { "#3 }
+                  \@@_generate:nn { "#3 }
                     { \char_value_catcode:n { "#3 } }
-                  \char_generate:nn { "#4 }
+                  \@@_generate:nn { "#4 }
                     { \char_value_catcode:n { "#4 } }
                   \tl_if_blank:nF {#5}
                     {
-                      \char_generate:nn { "#5 }
+                      \@@_generate:nn { "#5 }
                         { \char_value_catcode:n { "#5 } }
                     }
                 }





More information about the latex3-commits mailing list