[latex3-commits] [git/LaTeX3-latex3-latex3] main: Pass template path to key creation (2d15b1863)
Joseph Wright
joseph.wright at morningstar2.co.uk
Wed May 25 16:31:00 CEST 2022
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/2d15b1863915472d0be8ce214fb9e3d540440dad
>---------------------------------------------------------------
commit 2d15b1863915472d0be8ce214fb9e3d540440dad
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed May 25 15:31:00 2022 +0100
Pass template path to key creation
>---------------------------------------------------------------
2d15b1863915472d0be8ce214fb9e3d540440dad
l3packages/xtemplate/xtemplate.dtx | 62 +++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 31 deletions(-)
diff --git a/l3packages/xtemplate/xtemplate.dtx b/l3packages/xtemplate/xtemplate.dtx
index 34d6225b2..ca56d8281 100644
--- a/l3packages/xtemplate/xtemplate.dtx
+++ b/l3packages/xtemplate/xtemplate.dtx
@@ -1538,8 +1538,8 @@
\@@_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}
+ \keyval_parse:nnn
+ { \@@_parse_vars_elt:n } { \@@_parse_vars_elt:nnn { #1 / #2 } } {#3}
\@@_store_vars:n { #1 / #2 }
\@@_store_restrictions:n { #1 / #2 }
\prop_map_inline:Nn \l_@@_keytypes_prop
@@ -1560,85 +1560,85 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_parse_vars_elt:nn}
+% \begin{macro}{\@@_parse_vars_elt:nnn}
% The actual storage part here is very simple: the storage bin name
% is placed into the property list. At the same time, a comparison is
% made with the keytypes defined earlier: if there is a mismatch then
% an error is raised.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_parse_vars_elt:nn #1#2
+\cs_new_protected:Npn \@@_parse_vars_elt:nnn #1#2#3
{
\tl_set:Nx \l_@@_key_name_tl
- { \tl_trim_spaces:e { \tl_to_str:n {#1} } }
+ { \tl_trim_spaces:e { \tl_to_str:n {#2} } }
\prop_get:NoNTF
\l_@@_keytypes_prop
\l_@@_key_name_tl
\l_@@_keytype_tl
{
\@@_split_keytype_arg:o \l_@@_keytype_tl
- \@@_parse_vars_elt_aux:n {#2}
+ \@@_parse_vars_elt_aux:nn {#1} {#3}
\prop_remove:NV \l_@@_keytypes_prop \l_@@_key_name_tl
}
- { \msg_error:nnx { xtemplate } { unknown-key } {#1} }
+ { \msg_error:nnx { xtemplate } { unknown-key } {#2} }
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\@@_parse_vars_elt_aux:n}
% \begin{macro}{\@@_parse_vars_elt_aux:nn}
-% \begin{macro}{\@@_parse_vars_elt_aux:w}
+% \begin{macro}{\@@_parse_vars_elt_aux:nw}
+% \begin{macro}{\@@_parse_vars_elt_aux:nnn}
% Split off any leading \texttt{global} and they look for the way to
% implement.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_parse_vars_elt_aux:n #1
+\cs_new_protected:Npn \@@_parse_vars_elt_aux:nn #1#2
{
- \@@_parse_vars_elt_aux:w #1 global global \s_@@_stop {#1}
+ \@@_parse_vars_elt_aux:nw {#1} #2 global global \s_@@_stop
}
-\cs_new_protected:Npn \@@_parse_vars_elt_aux:w
- #1 global #2 global #3 \s_@@_stop #4
+\cs_new_protected:Npn \@@_parse_vars_elt_aux:nw
+ #1#2 global #3 global #4 \s_@@_stop
{
- \tl_if_blank:nTF {#3}
- { \@@_parse_vars_elt_aux:nn { } {#1} }
+ \tl_if_blank:nTF {#4}
+ { \@@_parse_vars_elt_aux:nnn {#1} { } {#2} }
{
- \tl_if_blank:nTF {#1}
+ \tl_if_blank:nTF {#2}
{
- \exp_args:Nnx \@@_parse_vars_elt_aux:nn
- { global } { \tl_trim_spaces:n {#2} }
+ \exp_args:Nnnx \@@_parse_vars_elt_aux:nnn
+ {#1} { global } { \tl_trim_spaces:n {#3} }
}
- { \msg_error:nnn { xtemplate } { bad-variable } { #1 global #2 } }
+ { \msg_error:nnn { xtemplate } { bad-variable } { #2 global #3 } }
}
}
-\cs_new_protected:Npn \@@_parse_vars_elt_aux:nn #1#2
+\cs_new_protected:Npn \@@_parse_vars_elt_aux:nnn #1#2#3
{
\str_case:VnF \l_@@_keytype_tl
{
- { choice } { \@@_implement_choices:n {#2} }
+ { choice } { \@@_implement_choices:n {#3} }
{ code }
{
\prop_put:Non \l_@@_vars_prop
- \l_@@_key_name_tl {#1#2}
+ \l_@@_key_name_tl {#2#3}
}
{ function }
{
- \cs_if_exist:NF #2
- { \cs_new:Npn #2 { } }
+ \cs_if_exist:NF #3
+ { \cs_new:Npn #3 { } }
\prop_put:Non \l_@@_vars_prop
- \l_@@_key_name_tl {#1#2}
+ \l_@@_key_name_tl {#2#3}
}
{ instance }
{
\prop_put:Non \l_@@_vars_prop
- \l_@@_key_name_tl {#1#2}
+ \l_@@_key_name_tl {#2#3}
}
}
{
- \tl_if_single:nTF {#2}
+ \tl_if_single:nTF {#3}
{
- \cs_if_exist:NF #2
- { \use:c { \@@_map_var_type: _new:N } #2 }
+ \cs_if_exist:NF #3
+ { \use:c { \@@_map_var_type: _new:N } #3 }
\prop_put:Non \l_@@_vars_prop
- \l_@@_key_name_tl {#1#2}
+ \l_@@_key_name_tl {#2#3}
}
- { \msg_error:nnx { xtemplate } { bad-variable } { #1#2 } }
+ { \msg_error:nnx { xtemplate } { bad-variable } { #2#3 } }
}
}
% \end{macrocode}
More information about the latex3-commits
mailing list.