summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3packages/xtemplate.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3packages/xtemplate.dtx')
-rw-r--r--macros/latex/contrib/l3packages/xtemplate.dtx109
1 files changed, 32 insertions, 77 deletions
diff --git a/macros/latex/contrib/l3packages/xtemplate.dtx b/macros/latex/contrib/l3packages/xtemplate.dtx
index 9c038494f3..8dfe79ec34 100644
--- a/macros/latex/contrib/l3packages/xtemplate.dtx
+++ b/macros/latex/contrib/l3packages/xtemplate.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2021-08-27}
+% \date{Released 2021-11-12}
%
% \maketitle
%
@@ -682,7 +682,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xtemplate}{2021-08-27}{}
+\ProvidesExplPackage{xtemplate}{2021-11-12}{}
{L3 Experimental prototype document functions}
% \end{macrocode}
%
@@ -1280,7 +1280,7 @@
\seq_put_right:No \l_@@_key_order_seq \l_@@_key_name_tl
\str_if_eq:onT \l_@@_keytype_tl { choice }
{
- \clist_if_in:NnT \l_@@_keytype_arg_tl { unknown }
+ \exp_args:No \clist_if_in:nnT \l_@@_keytype_arg_tl { unknown }
{ \msg_error:nn { xtemplate } { choice-unknown-reserved } }
}
}
@@ -1446,95 +1446,50 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_store_value_code:n}
-% \begin{macro}{\@@_store_value_choice:n}
-% \begin{macro}{\@@_store_value_commalist:n}
-% \begin{macro}{\@@_store_value_function:n}
-% \begin{macro}{\@@_store_value_instance:n}
-% \begin{macro}{\@@_store_value_real:n}
-% \begin{macro}{\@@_store_value_tokenlist:n}
+% \begin{macro}{\@@_store_value_code:n, \@@_store_value_choice:n,
+% \@@_store_value_function:n, \@@_store_value_instance:n}
% With no need to worry about delayed evaluation, these keytypes all
% just store the input directly.
% \begin{macrocode}
\cs_new_protected:Npn \@@_store_value_code:n #1
{ \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1} }
\cs_new_eq:NN \@@_store_value_choice:n \@@_store_value_code:n
-\cs_new_eq:NN \@@_store_value_commalist:n \@@_store_value_code:n
\cs_new_eq:NN \@@_store_value_function:n \@@_store_value_code:n
\cs_new_eq:NN \@@_store_value_instance:n \@@_store_value_code:n
-\cs_new_eq:NN \@@_store_value_real:n \@@_store_value_code:n
-\cs_new_eq:NN \@@_store_value_tokenlist:n \@@_store_value_code:n
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
%
-% \begin{macro}{\@@_store_value_integer:n}
-% \begin{macro}{\@@_store_value_length:n}
-% \begin{macro}{\@@_store_value_muskip:n}
-% \begin{macro}{\@@_store_value_skip:n}
-% Storing the value of a number is in all cases more or less the same.
-% If evaluation is taking place now, assignment is made to a scratch
-% variable, and this result is then stored. On the other hand, if
-% evaluation is delayed the current data is simply stored \enquote{as is}.
+% \begin{macro}{\@@_store_value_aux:Nn, \@@_store_value_integer:n,
+% \@@_store_value_length:n, \@@_store_value_muskip:n,
+% \@@_store_value_real:n, \@@_store_value_skip:n,
+% \@@_store_value_tokenlist:n, \@@_store_value_commalist:n}
+% Storing values in \cs{l_@@_values_prop} is in most cases the same.
+% If evaluation is taking place now, one \texttt{x}-expands an
+% evaluation function and the result is then stored. On the other
+% hand, if evaluation is delayed the current data is simply stored
+% \enquote{as is}.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_store_value_integer:n #1
- {
- \@@_if_eval_now:nTF {#1}
- {
- \int_set:Nn \l_@@_tmp_int {#1}
- \prop_put:NVV \l_@@_values_prop \l_@@_key_name_int
- \l_@@_tmp_int
- }
- {
- \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1}
- }
- }
-\cs_new_protected:Npn \@@_store_value_length:n #1
- {
- \@@_if_eval_now:nTF {#1}
- {
- \dim_set:Nn \l_@@_tmp_dim {#1}
- \prop_put:NVV \l_@@_values_prop \l_@@_key_name_tl
- \l_@@_tmp_dim
- }
- {
- \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1}
- }
- }
-\cs_new_protected:Npn \@@_store_value_muskip:n #1
- {
- \@@_if_eval_now:nTF {#1}
- {
- \muskip_set:Nn \l_@@_tmp_muskip {#1}
- \prop_put:NVV \l_@@_values_prop \l_@@_key_name_tl
- \l_@@_tmp_muskip
- }
- {
- \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1}
- }
- }
-\cs_new_protected:Npn \@@_store_value_skip:n #1
+\cs_new_protected:Npn \@@_store_value_aux:Nn #1#2
{
- \@@_if_eval_now:nTF {#1}
- {
- \skip_set:Nn \l_@@_tmp_skip {#1}
- \prop_put:NVV \l_@@_values_prop \l_@@_key_name_tl
- \l_@@_tmp_skip
- }
- {
- \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1}
- }
+ \@@_if_eval_now:nTF {#2}
+ { \prop_put:NVx \l_@@_values_prop \l_@@_key_name_tl { #1 {#2} } }
+ { \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#2} }
}
+\cs_new_protected:Npn \@@_store_value_integer:n
+ { \@@_store_value_aux:Nn \int_eval:n }
+\cs_new_protected:Npn \@@_store_value_length:n
+ { \@@_store_value_aux:Nn \dim_eval:n }
+\cs_new_protected:Npn \@@_store_value_muskip:n
+ { \@@_store_value_aux:Nn \muskip_eval:n }
+\cs_new_protected:Npn \@@_store_value_real:n
+ { \@@_store_value_aux:Nn \fp_eval:n }
+\cs_new_protected:Npn \@@_store_value_skip:n
+ { \@@_store_value_aux:Nn \skip_eval:n }
+\cs_new_protected:Npn \@@_store_value_tokenlist:n
+ { \@@_store_value_aux:Nn \use:n }
+\cs_new_eq:NN \@@_store_value_commalist:n \@@_store_value_tokenlist:n
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \subsection{Implementation part of template declaration}
%
@@ -1713,7 +1668,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_implement_choices:n #1
{
- \clist_set_eq:NN \l_@@_tmp_clist \l_@@_keytype_arg_tl
+ \clist_set:No \l_@@_tmp_clist { \l_@@_keytype_arg_tl }
\prop_put:Non \l_@@_vars_prop \l_@@_key_name_tl { }
\keyval_parse:NNn
\@@_implement_choice_elt:n \@@_implement_choice_elt:nn