[latex3-commits] [l3svn] branch master updated: Working on l3keys performance

noreply at latex-project.org noreply at latex-project.org
Sun Sep 18 12:21:55 CEST 2016


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

The following commit(s) were added to refs/heads/master by this push:
       new  3e91c6a   Working on l3keys performance
3e91c6a is described below

commit 3e91c6aab234003dfb7795e61447662a9b65327e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Sep 18 11:20:53 2016 +0100

    Working on l3keys performance
    
    This is step 2 of the job: revise parts of the \keys_define:nn mechanism.
    The structure of keys themselves will change, and will show up here.
---
 l3kernel/l3keys.dtx                     |   78 +++++++++++++++++++------------
 l3kernel/testfiles/m3expl001.luatex.tlg |   11 +++--
 l3kernel/testfiles/m3expl001.ptex.tlg   |   11 +++--
 l3kernel/testfiles/m3expl001.tlg        |   11 +++--
 l3kernel/testfiles/m3expl001.uptex.tlg  |   11 +++--
 l3kernel/testfiles/m3expl001.xetex.tlg  |   11 +++--
 l3kernel/testfiles/m3expl003.luatex.tlg |   11 +++--
 l3kernel/testfiles/m3expl003.ptex.tlg   |   11 +++--
 l3kernel/testfiles/m3expl003.tlg        |   11 +++--
 l3kernel/testfiles/m3expl003.uptex.tlg  |   11 +++--
 l3kernel/testfiles/m3expl003.xetex.tlg  |   11 +++--
 11 files changed, 107 insertions(+), 81 deletions(-)

diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index c5b07ce..b426b0b 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -1241,7 +1241,7 @@
 \cs_new_protected:Npn \@@_define:nnn #1#2#3
   {
     \tl_set:Nx \l_@@_module_tl { \@@_remove_spaces:n {#2} }
-    \keyval_parse:NNn \@@_define_elt:n \@@_define_elt:nn {#3}
+    \keyval_parse:NNn \@@_define:n \@@_define:nn {#3}
     \tl_set:Nn \l_@@_module_tl {#1}
   }
 \cs_generate_variant:Nn \@@_define:nnn { o }
@@ -1249,33 +1249,33 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[int]{\@@_define_elt:n}
-% \begin{macro}[int]{\@@_define_elt:nn}
-% \begin{macro}[aux]{\@@_define_elt_aux:nn}
+% \begin{macro}[int]{\@@_define:n}
+% \begin{macro}[int]{\@@_define:nn}
+% \begin{macro}[aux]{\@@_define_aux:nn}
 %   The outer functions here record whether a value was given and then
 %   converge on a common internal mechanism. There is first a search for
 %   a property in the current key name, then a check to make sure it is
 %   known before the code hands off to the next step.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_define_elt:n #1
+\cs_new_protected:Npn \@@_define:n #1
   {
     \bool_set_true:N \l_@@_no_value_bool
-    \@@_define_elt_aux:nn {#1} { }
+    \@@_define_aux:nn {#1} { }
   }
-\cs_new_protected:Npn \@@_define_elt:nn #1#2
+\cs_new_protected:Npn \@@_define:nn #1#2
   {
     \bool_set_false:N \l_@@_no_value_bool
-    \@@_define_elt_aux:nn {#1} {#2}
+    \@@_define_aux:nn {#1} {#2}
   }
-\cs_new_protected:Npn \@@_define_elt_aux:nn #1#2
+\cs_new_protected:Npn \@@_define_aux:nn #1#2
   {
     \@@_property_find:n {#1}
     \cs_if_exist:cTF { \c_@@_props_root_tl \l_@@_property_tl }
-      { \@@_define_key:n {#2} }
+      { \@@_define_code:n {#2} }
       {
-        \str_if_eq_x:nnF { \l_@@_property_tl } { .abort: }
-          {
-            \__msg_kernel_error:nnxx { kernel } { property-unknown }
+         \tl_if_empty:NF \l_@@_property_tl
+           {
+             \__msg_kernel_error:nnxx { kernel } { property-unknown }
               { \l_@@_property_tl } { \l_keys_path_tl }
            }
       }
@@ -1293,45 +1293,57 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_property_find:n #1
   {
-    \tl_set:Nx \l_keys_path_tl { \l_@@_module_tl / }
-    \tl_if_in:nnTF {#1} { . }
-      { \@@_property_find:w #1 \q_stop }
+    \tl_set:Nx \l_@@_property_tl { \@@_remove_spaces:n {#1} }
+    \exp_after:wN \@@_property_find:w \l_@@_property_tl . . \q_stop {#1}
+  }
+\cs_new_protected:Npn \@@_property_find:w #1 . #2 . #3 \q_stop #4
+  {
+    \tl_if_blank:nTF {#3}
       {
-        \__msg_kernel_error:nnx { kernel } { key-no-property } {#1}
-        \tl_set:Nn \l_@@_property_tl { .abort: }
+        \tl_clear:N \l_@@_property_tl
+        \__msg_kernel_error:nnn { kernel } { key-no-property } {#4}
+      }
+      {
+        \str_if_eq:nnTF {#3} { . }
+          {
+            \tl_set:Nx \l_keys_path_tl { \l_@@_module_tl / #1 }
+            \tl_set:Nn \l_@@_property_tl { . #2 }
+          }
+          {
+            \tl_set:Nx \l_keys_path_tl { \l_@@_module_tl / #1 . #2 }
+            \@@_property_search:w #3 \q_stop
+          }
       }
   }
-\cs_new_protected:Npn \@@_property_find:w #1 . #2 \q_stop
+\cs_new_protected:Npn \@@_property_search:w #1 . #2 \q_stop
   {
-    \tl_set:Nx \l_keys_path_tl
+    \str_if_eq:nnTF {#2} { . }
       {
-        \l_keys_path_tl
-        \@@_remove_spaces:n {#1}
+        \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl }
+        \tl_set:Nn \l_@@_property_tl { . #1 }
       }
-    \tl_if_in:nnTF {#2} { . }
       {
-        \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl . }
-        \@@_property_find:w #2 \q_stop
+        \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl . #1 }
+        \@@_property_search:w #2 \q_stop
       }
-      { \tl_set:Nn \l_@@_property_tl { . #2 } }
   }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[int]{\@@_define_key:n}
-% \begin{macro}[aux]{\@@_define_key:w}
+% \begin{macro}[int]{\@@_define_code:n}
+% \begin{macro}[aux, EXP]{\@@_define_code:w}
 %   Two possible cases. If there is a value for the key, then just use
 %   the function. If not, then a check to make sure there is no need for
 %   a value with the property. If there should be one then complain,
 %   otherwise execute it. There is no need to check for a |:| as if it
 %   is missing the earlier tests will have failed.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_define_key:n #1
+\cs_new_protected:Npn \@@_define_code:n #1
   {
     \bool_if:NTF \l_@@_no_value_bool
       {
-        \exp_after:wN \@@_define_key:w
+        \exp_after:wN \@@_define_code:w
           \l_@@_property_tl \q_stop
           { \use:c { \c_@@_props_root_tl \l_@@_property_tl } }
           {
@@ -1342,7 +1354,11 @@
       }
       { \use:c { \c_@@_props_root_tl \l_@@_property_tl } {#1} }
   }
-\cs_new_protected:Npn \@@_define_key:w #1 : #2 \q_stop
+\use:x
+  {
+    \cs_new:Npn \exp_not:N \__keys_define_code:w
+      ##1 \c_colon_str ##2 \exp_not:N \q_stop
+  }
   { \tl_if_empty:nTF {#2} }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 9e8e9bb..2bb5a2a 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -3150,13 +3150,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 28e4d89..2f2e11e 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -3141,13 +3141,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 174dbab..05d3491 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -3141,13 +3141,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 0e9674d..b84a8bd 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -3141,13 +3141,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index fd13449..8031340 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -3148,13 +3148,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 05737ef..9511560 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -3151,13 +3151,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 5281ade..ead35e2 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -3142,13 +3142,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index cb7d7b0..1c5830b 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -3142,13 +3142,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 3d3a5b1..6460b6b 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -3142,13 +3142,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 5c63e03..3cc05d5 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -3149,13 +3149,14 @@ Defining \l__keys_tmp_bool on line ...
 Defining \keys_define:nn on line ...
 Defining \__keys_define:nnn on line ...
 Defining \__keys_define:onn on line ...
-Defining \__keys_define_elt:n on line ...
-Defining \__keys_define_elt:nn on line ...
-Defining \__keys_define_elt_aux:nn on line ...
+Defining \__keys_define:n on line ...
+Defining \__keys_define:nn on line ...
+Defining \__keys_define_aux:nn on line ...
 Defining \__keys_property_find:n on line ...
 Defining \__keys_property_find:w on line ...
-Defining \__keys_define_key:n on line ...
-Defining \__keys_define_key:w on line ...
+Defining \__keys_property_search:w on line ...
+Defining \__keys_define_code:n on line ...
+Defining \__keys_define_code:w on line ...
 Defining \__keys_ensure_exist:n on line ...
 Defining \__keys_ensure_exist:V on line ...
 Defining \__keys_bool_set:Nn on line ...

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list