[latex3-commits] [l3svn] branch master updated: Move key default data

noreply at latex-project.org noreply at latex-project.org
Tue Sep 20 09:53:12 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  06e579b   Move key default data
06e579b is described below

commit 06e579bfd30000ef0c1c0c85b8742e94fd157e9c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Sep 20 08:52:52 2016 +0100

    Move key default data
    
    Working on performance/logic/...
---
 l3kernel/l3keys.dtx                     |   54 +++++++++++++++++--------------
 l3kernel/testfiles/m3expl001.luatex.tlg |    2 +-
 l3kernel/testfiles/m3expl001.ptex.tlg   |    2 +-
 l3kernel/testfiles/m3expl001.tlg        |    2 +-
 l3kernel/testfiles/m3expl001.uptex.tlg  |    2 +-
 l3kernel/testfiles/m3expl001.xetex.tlg  |    2 +-
 l3kernel/testfiles/m3expl003.luatex.tlg |    2 +-
 l3kernel/testfiles/m3expl003.ptex.tlg   |    2 +-
 l3kernel/testfiles/m3expl003.tlg        |    2 +-
 l3kernel/testfiles/m3expl003.uptex.tlg  |    2 +-
 l3kernel/testfiles/m3expl003.xetex.tlg  |    2 +-
 11 files changed, 40 insertions(+), 34 deletions(-)

diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index ff6d5bc..a431db6 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -1554,19 +1554,21 @@
 % \end{macro}
 %
 % \begin{macro}[int]{\@@_default_set:n}
-%   Setting a default value is easy.
+%   Setting a default value is easy. These are stored using \cs{cs_set:cpx} as this
+%   avoids any worries about whether a token list exists.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_default_set:n #1
   {
-    \@@_ensure_exist:V \l_keys_path_tl
     \tl_if_empty:nTF {#1}
       {
-        \prop_remove:cn { \c_@@_info_root_tl \l_keys_path_tl }
-          { default }
+        \cs_set_eq:cN
+          { \c_@@_default_root_tl \l_keys_path_tl }
+          \tex_undefined:D
       }
       {
-        \prop_put:cnn { \c_@@_info_root_tl \l_keys_path_tl }
-          { default } {#1}
+        \cs_set:cpx
+          { \c_@@_default_root_tl \l_keys_path_tl }
+          { \exp_not:n {#1} }
       }
   }
 %    \end{macrocode}
@@ -2154,7 +2156,7 @@
     \@@_value_or_default:n {#3}
     \bool_if:NTF \l_@@_selective_bool
       { \@@_set_selective: }
-      { \@@_set_aux: }
+      { \@@_execute: }
     \tl_set:Nn \l_@@_module_tl {#1}
   }
 \cs_generate_variant:Nn \@@_set_aux:nnn { o }
@@ -2171,16 +2173,6 @@
         \@@_find_key_module:w #2 \q_stop
       }
   }
-\cs_new_protected:Npn \@@_set_aux:
-  {
-    \cs_if_exist:cTF { \c_@@_code_root_tl \l_keys_path_tl }
-      {
-        \cs_if_exist_use:c { \c_@@_validate_root_tl \l_keys_path_tl }
-        \cs:w \c_@@_code_root_tl \l_keys_path_tl \exp_after:wN \cs_end:
-          \exp_after:wN { \l_keys_value_tl }
-      }
-      { \@@_execute_unknown: }
-  }
 %    \end{macrocode}
 %  If selective setting is active, there are a number of possible sub-cases
 %  to consider. The key name may not be known at all or if it is, it may not
@@ -2196,13 +2188,13 @@
           { \@@_check_groups: }
           {
             \bool_if:NTF \l_@@_filtered_bool
-              { \@@_set_aux: }
+              { \@@_execute: }
               { \@@_store_unused: }
           }
       }
       {
         \bool_if:NTF \l_@@_filtered_bool
-          { \@@_set_aux: }
+          { \@@_execute: }
           { \@@_store_unused: }
       }
   }
@@ -2230,11 +2222,11 @@
       {
         \bool_if:NTF \l_@@_filtered_bool
           { \@@_store_unused: }
-          { \@@_set_aux: }
+          { \@@_execute: }
       }
       {
         \bool_if:NTF \l_@@_filtered_bool
-          { \@@_set_aux: }
+          { \@@_execute: }
           { \@@_store_unused: }
       }
   }
@@ -2252,8 +2244,12 @@
   {
     \bool_if:NTF \l_@@_no_value_bool
       {
-        \prop_get:cnNF { \c_@@_info_root_tl \l_keys_path_tl }
-          { default } \l_keys_value_tl
+        \cs_if_exist:cTF { \c_@@_default_root_tl \l_keys_path_tl }
+          {
+            \tl_set_eq:Nc
+              \l_keys_value_tl
+              { \c_@@_default_root_tl \l_keys_path_tl } 
+          }
           { \tl_clear:N \l_keys_value_tl }
       }
       { \tl_set:Nn \l_keys_value_tl {#1} }
@@ -2261,7 +2257,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}[aux]{\@@_execute_unknown:}
+% \begin{macro}[aux]{\@@_execute:, \@@_execute_unknown:}
 % \begin{macro}[aux, EXP]{\@@_execute:nn}
 % \begin{macro}[aux]{\@@_store_unused:}
 %   Actually executing a key is done in two parts. First, look for the
@@ -2270,6 +2266,16 @@
 %   is unknown depends on whether unknown keys are being skipped or if
 %   an error should be raised.
 %    \begin{macrocode}
+\cs_new_protected:Npn \@@_execute:
+  {
+    \cs_if_exist:cTF { \c_@@_code_root_tl \l_keys_path_tl }
+      {
+        \cs_if_exist_use:c { \c_@@_validate_root_tl \l_keys_path_tl }
+        \cs:w \c_@@_code_root_tl \l_keys_path_tl \exp_after:wN \cs_end:
+          \exp_after:wN { \l_keys_value_tl }
+      }
+      { \@@_execute_unknown: }
+  }
 \cs_new_protected:Npn \@@_execute_unknown:
   {
     \bool_if:NTF \l_@@_only_known_bool
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 59aac2a..e92cbf1 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -3293,10 +3293,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 84a1794..7912c5e 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -3284,10 +3284,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index cd977eb..1014fca 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -3284,10 +3284,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index ba39b5c..3e26da1 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -3284,10 +3284,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 53b051e..a9e4409 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -3291,10 +3291,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 6f5561f..55bb16c 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -3294,10 +3294,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index cc83ed4..025c43b 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -3285,10 +3285,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index e063a7e..7485fdd 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -3285,10 +3285,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index f601af8..c7e855c 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -3285,10 +3285,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 82a05f4..f2a338d 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -3292,10 +3292,10 @@ Defining \__keys_set:nn on line ...
 Defining \__keys_set_aux:nnn on line ...
 Defining \__keys_set_aux:onn on line ...
 Defining \__keys_find_key_module:w on line ...
-Defining \__keys_set_aux: on line ...
 Defining \__keys_set_selective: on line ...
 Defining \__keys_check_groups: on line ...
 Defining \__keys_value_or_default:n on line ...
+Defining \__keys_execute: on line ...
 Defining \__keys_execute_unknown: on line ...
 Defining \__keys_execute:nn on line ...
 Defining \__keys_store_unused: 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