[latex3-commits] [git/LaTeX3-latex3-latex3] main: Fix implementation of \DeclareRestrictedTemplate (d0082f56f)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu May 6 16:19:03 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/d0082f56fec0b58becc6c165e8d3f1b4ff61a729

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

commit d0082f56fec0b58becc6c165e8d3f1b4ff61a729
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu May 6 15:19:03 2021 +0100

    Fix implementation of \DeclareRestrictedTemplate


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

d0082f56fec0b58becc6c165e8d3f1b4ff61a729
 l3packages/CHANGELOG.md            |  3 +++
 l3packages/xtemplate/xtemplate.dtx | 13 +++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/l3packages/CHANGELOG.md b/l3packages/CHANGELOG.md
index cf52f56e8..dbd3bb54a 100644
--- a/l3packages/CHANGELOG.md
+++ b/l3packages/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Fixed
+- Implmentation of `\DeclareRestrictedTemplate`
+
 ## [2021-03-12]
 
 ### Fixed
diff --git a/l3packages/xtemplate/xtemplate.dtx b/l3packages/xtemplate/xtemplate.dtx
index d80d34807..6b494abc7 100644
--- a/l3packages/xtemplate/xtemplate.dtx
+++ b/l3packages/xtemplate/xtemplate.dtx
@@ -1574,12 +1574,12 @@
 \cs_new_protected:Npn \@@_store_key_implementation:nnn #1#2#3
   {
     \@@_recover_defaults:n { #1 / #2 }
+    \@@_recover_restrictions:n { #1 / #2 }
     \@@_recover_keytypes:n { #1 / #2 }
     \prop_clear:N \l_@@_vars_prop
     \keyval_parse:NNn
       \@@_parse_vars_elt:n \@@_parse_vars_elt:nn {#3}
     \@@_store_vars:n { #1 / #2 }
-    \clist_clear:N \l_@@_restrict_clist
     \@@_store_restrictions:n { #1 / #2 }
     \prop_map_inline:Nn \l_@@_keytypes_prop
       {
@@ -1855,15 +1855,19 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\@@_parse_values:nn}
+% \begin{macro}{\@@_parse_values:nn, \@@_parse_values_aux:nn}
 %   The routine to parse values is the same for both editing a
 %   template and setting up an instance. So the code here does only the
 %   minimum necessary for reading the values.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_parse_values:nn #1#2
   {
-    \@@_recover_keytypes:n {#1}
     \clist_clear:N \l_@@_restrict_clist
+    \@@_parse_values_aux:nn {#1} {#2}
+  }
+\cs_new_protected:Npn \@@_parse_values_aux:nn #1#2
+  {
+    \@@_recover_keytypes:n {#1}
     \keyval_parse:NNn
       \@@_parse_values_elt:n \@@_parse_values_elt:nn {#2}
   }
@@ -1954,6 +1958,7 @@
     \@@_execute_if_code_exist:nnT {#1} {#2}
       {
         \@@_recover_defaults:n { #1 / #2 }
+        \@@_recover_restrictions:n { #1 / #2 }
         \@@_recover_vars:n { #1 / #2 }
         \@@_declare_instance_aux:nnnnn {#1} {#2} {#3} {#4} {#5}
       }
@@ -1961,7 +1966,7 @@
 \cs_new_protected:Npn \@@_declare_instance_aux:nnnnn #1#2#3#4#5
   {
     \bool_set_false:N \l_@@_error_bool
-    \@@_parse_values:nn { #1 / #2 } {#5}
+    \@@_parse_values_aux:nn { #1 / #2 } {#5}
     \bool_if:NF \l_@@_error_bool
       {
         \prop_put:Nnn \l_@@_values_prop { from~template } {#2}





More information about the latex3-commits mailing list.