summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3packages/xtemplate.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-10-11 03:02:59 +0000
committerNorbert Preining <norbert@preining.info>2023-10-11 03:02:59 +0000
commit366cf31a771ded1f10860be3212058d48020398d (patch)
tree99ee483a9fd05dfd4ec908582abb44028bdffbd1 /macros/latex/contrib/l3packages/xtemplate.dtx
parent48eedda2cb4d2644886b862409b24a1d8e9a136f (diff)
CTAN sync 202310110302
Diffstat (limited to 'macros/latex/contrib/l3packages/xtemplate.dtx')
-rw-r--r--macros/latex/contrib/l3packages/xtemplate.dtx145
1 files changed, 70 insertions, 75 deletions
diff --git a/macros/latex/contrib/l3packages/xtemplate.dtx b/macros/latex/contrib/l3packages/xtemplate.dtx
index 8386be5d98..5080d94b0f 100644
--- a/macros/latex/contrib/l3packages/xtemplate.dtx
+++ b/macros/latex/contrib/l3packages/xtemplate.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2023-08-29}
+% \date{Released 2023-10-10}
%
% \maketitle
%
@@ -711,15 +711,10 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xtemplate}{2023-08-29}{}
+\ProvidesExplPackage{xtemplate}{2023-10-10}{}
{L3 Experimental prototype document functions}
% \end{macrocode}
%
-% \begin{macrocode}
-\cs_generate_variant:Nn \keys_define:nn { nx }
-\cs_generate_variant:Nn \tl_trim_spaces:n { e }
-% \end{macrocode}
-%
% \subsection{Variables and constants}
%
% \begin{variable}{\c_@@_code_root_tl}
@@ -943,7 +938,7 @@
\int_compare:nNnTF {#2} = \l_@@_tmp_tl
{#3}
{
- \msg_error:nnxxx { xtemplate }
+ \msg_error:nneee { xtemplate }
{ argument-number-mismatch } {#1} { \l_@@_tmp_tl } {#2}
}
}
@@ -959,7 +954,7 @@
\cs_if_exist:cTF { \c_@@_code_root_tl #1 / #2 }
{#3}
{
- \msg_error:nnxx { xtemplate } { no-template-code }
+ \msg_error:nnee { xtemplate } { no-template-code }
{#1} {#2}
}
}
@@ -976,7 +971,7 @@
{
\cs_if_exist:cTF { @@_store_value_ #1 :n }
{#2}
- { \msg_error:nnx { xtemplate } { unknown-keytype } {#1} }
+ { \msg_error:nne { xtemplate } { unknown-keytype } {#1} }
}
\cs_generate_variant:Nn \@@_execute_if_keytype_exist:nT { o }
% \end{macrocode}
@@ -990,7 +985,7 @@
{
\prop_if_in:NnTF \g_@@_object_type_prop {#1}
{#2}
- { \msg_error:nnx { xtemplate } { unknown-object-type } {#1} }
+ { \msg_error:nne { xtemplate } { unknown-object-type } {#1} }
}
% \end{macrocode}
% \end{macro}
@@ -1005,7 +1000,7 @@
\cs_if_exist:cTF { \c_@@_keytypes_root_tl #1 / #2 }
{#3}
{
- \msg_error:nnxx { xtemplate } { unknown-template }
+ \msg_error:nnee { xtemplate } { unknown-template }
{#1} {#2}
}
}
@@ -1191,13 +1186,13 @@
\int_set:Nn \l_@@_tmp_int {#2}
\int_compare:nTF { 0 <= \l_@@_tmp_int <= 9 }
{
- \msg_info:nnxx { xtemplate } { declare-object-type }
- {#1} { \exp_not:V \l_@@_tmp_int }
+ \msg_info:nnnV { xtemplate } { declare-object-type }
+ {#1} \l_@@_tmp_int
\prop_gput:NnV \g_@@_object_type_prop {#1}
\l_@@_tmp_int
}
{
- \msg_error:nnxx { xtemplate } { bad-number-of-arguments }
+ \msg_error:nnee { xtemplate } { bad-number-of-arguments }
{#1} { \exp_not:V \l_@@_tmp_int }
}
}
@@ -1266,7 +1261,7 @@
\seq_if_in:NoTF \l_@@_key_order_seq
\l_@@_key_name_tl
{
- \msg_error:nnx { xtemplate }
+ \msg_error:nne { xtemplate }
{ duplicate-key-interface }
{ \l_@@_key_name_tl }
}
@@ -1281,7 +1276,7 @@
{
\tl_if_empty:NT \l_@@_keytype_arg_tl
{
- \msg_error:nnx { xtemplate }
+ \msg_error:nne { xtemplate }
{ keytype-requires-argument } {#1}
\bool_set_true:N \l_@@_error_bool
\seq_map_break:
@@ -1290,7 +1285,7 @@
}
\cs_new:Npn \@@_parse_keys_elt_aux:
{
- \tl_set:Nx \l_@@_tmp_tl
+ \tl_set:Ne \l_@@_tmp_tl
{
\l_@@_keytype_tl
\tl_if_empty:NF \l_@@_keytype_arg_tl
@@ -1331,7 +1326,7 @@
% that, the standard delimited argument method is used to separate the
% two parts.
% \begin{macrocode}
-\cs_new_protected:Npx \@@_split_keytype:n #1
+\cs_new_protected:Npe \@@_split_keytype:n #1
{
\exp_not:N \bool_set_false:N \exp_not:N \l_@@_error_bool
\tl_set:Nn \exp_not:N \l_@@_tmp_tl {#1}
@@ -1347,32 +1342,32 @@
}
{
\exp_not:N \bool_set_true:N \exp_not:N \l_@@_error_bool
- \msg_error:nnx { xtemplate } { missing-keytype } {#1}
+ \msg_error:nne { xtemplate } { missing-keytype } {#1}
}
}
-\use:x
+\use:e
{
\cs_new_protected:Npn \exp_not:N \@@_split_keytype_aux:w
- ##1 \token_to_str:N : ##2 \s_@@_stop
+ #1 \token_to_str:N : #2 \s_@@_stop
{
- \tl_put_right:Nx \exp_not:N \l_@@_key_name_tl
+ \tl_put_right:Ne \exp_not:N \l_@@_key_name_tl
{
\exp_not:N \tl_trim_spaces:e
- { \exp_not:N \tl_to_str:n {##1} }
+ { \exp_not:N \tl_to_str:n {#1} }
}
- \tl_if_in:nnTF {##2} { \token_to_str:N : }
+ \tl_if_in:nnTF {#2} { \token_to_str:N : }
{
\tl_put_right:Nn \exp_not:N \l_@@_key_name_tl
{ \token_to_str:N : }
- \exp_not:N \@@_split_keytype_aux:w ##2 \s_@@_stop
+ \exp_not:N \@@_split_keytype_aux:w #2 \s_@@_stop
}
{
\exp_not:N \tl_if_empty:NTF \exp_not:N \l_@@_key_name_tl
{
- \msg_error:nnx { xtemplate } { empty-key-name }
- { \token_to_str:N : ##2 }
+ \msg_error:nne { xtemplate } { empty-key-name }
+ { \token_to_str:N : #2 }
}
- { \exp_not:N \@@_split_keytype_arg:n {##2} }
+ { \exp_not:N \@@_split_keytype_arg:n {#2} }
}
}
}
@@ -1395,7 +1390,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_split_keytype_arg:n #1
{
- \tl_set:Nx \l_@@_keytype_tl { \tl_trim_spaces:n {#1} }
+ \tl_set:Ne \l_@@_keytype_tl { \tl_trim_spaces:n {#1} }
\tl_clear:N \l_@@_keytype_arg_tl
\cs_set_protected:Npn \@@_split_keytype_arg_aux:n ##1
{
@@ -1406,11 +1401,11 @@
{
\tl_if_blank:nT {####1}
{
- \tl_set:Nx \l_@@_keytype_tl
+ \tl_set:Ne \l_@@_keytype_tl
{ \tl_trim_spaces:n {##1} }
\tl_if_blank:nF {####2}
{
- \tl_set:Nx \l_@@_keytype_arg_tl
+ \tl_set:Ne \l_@@_keytype_arg_tl
{ \use:n ####2 }
}
\seq_map_break:
@@ -1548,7 +1543,7 @@
\@@_store_restrictions:n { #1 / #2 }
\prop_map_inline:Nn \l_@@_keytypes_prop
{
- \msg_error:nnxxx { xtemplate } { key-not-implemented }
+ \msg_error:nneee { xtemplate } { key-not-implemented }
{##1} {#2} {#1}
}
}
@@ -1560,7 +1555,7 @@
% this is an error function.
% \begin{macrocode}
\cs_new_protected:Npn \@@_parse_vars_elt:n #1
- { \msg_error:nnx { xtemplate } { key-no-variable } {#1} }
+ { \msg_error:nne { xtemplate } { key-no-variable } {#1} }
% \end{macrocode}
% \end{macro}
%
@@ -1572,7 +1567,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_parse_vars_elt:nnn #1#2#3
{
- \tl_set:Nx \l_@@_key_name_tl
+ \tl_set:Ne \l_@@_key_name_tl
{ \tl_trim_spaces:e { \tl_to_str:n {#2} } }
\prop_get:NoNTF
\l_@@_keytypes_prop
@@ -1583,7 +1578,7 @@
\@@_parse_vars_elt_aux:nn {#1} {#3}
\prop_remove:NV \l_@@_keytypes_prop \l_@@_key_name_tl
}
- { \msg_error:nnx { xtemplate } { unknown-key } {#2} }
+ { \msg_error:nne { xtemplate } { unknown-key } {#2} }
}
% \end{macrocode}
% \end{macro}
@@ -1606,7 +1601,7 @@
{
\tl_if_blank:nTF {#2}
{
- \exp_args:Nnnx \@@_parse_vars_elt_aux:nnn
+ \exp_args:Nnne \@@_parse_vars_elt_aux:nnn
{#1} { global } { \tl_trim_spaces:n {#3} }
}
{ \msg_error:nnn { xtemplate } { bad-variable } { #2 global #3 } }
@@ -1630,7 +1625,7 @@
\exp_not:c
{ cs_ \str_if_eq:nnT {#1} { global } { g } set:Npn }
{ \exp_not:o \l_@@_keytype_arg_tl }
- {####1}
+ {##1}
}
}
\prop_put:Non \l_@@_vars_prop
@@ -1644,7 +1639,7 @@
{
\exp_not:c
{ cs_ \str_if_eq:nnT {#1} { global } { g } set:Npn }
- \exp_not:N #3 { \UseInstance {####1} }
+ \exp_not:N #3 { \UseInstance {##1} }
}
}
\prop_put:Non \l_@@_vars_prop
@@ -1665,12 +1660,12 @@
\prop_put:Non \l_@@_vars_prop
\l_@@_key_name_tl {#2#3}
}
- { \msg_error:nnx { xtemplate } { bad-variable } { #2#3 } }
+ { \msg_error:nne { xtemplate } { bad-variable } { #2#3 } }
}
}
\cs_new_protected:Npn \@@_parse_vars_elt_key:nn #1#2
{
- \keys_define:nx { template / #1 }
+ \keys_define:ne { template / #1 }
{ \l_@@_key_name_tl #2 }
}
% \end{macrocode}
@@ -1708,7 +1703,7 @@
{
\clist_set:No \l_@@_tmp_clist { \l_@@_keytype_arg_tl }
\prop_put:Non \l_@@_vars_prop \l_@@_key_name_tl { }
- \keys_define:nx { template / #1 } { \l_@@_key_name_tl .choice: }
+ \keys_define:ne { template / #1 } { \l_@@_key_name_tl .choice: }
\keyval_parse:nnn
{ \@@_implement_choice_elt:n }
{ \@@_implement_choice_elt:nnn {#1} }
@@ -1720,7 +1715,7 @@
{
\clist_map_inline:Nn \l_@@_tmp_clist
{
- \msg_error:nnx { xtemplate } { choice-not-implemented }
+ \msg_error:nne { xtemplate } { choice-not-implemented }
{##1}
}
}
@@ -1731,11 +1726,11 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_implement_choices_default:
{
- \tl_set:Nx \l_@@_tmp_tl
+ \tl_set:Ne \l_@@_tmp_tl
{ \l_@@_key_name_tl \c_space_tl \l_@@_tmp_tl }
\prop_if_in:NoF \l_@@_vars_prop \l_@@_tmp_tl
{
- \tl_set:Nx \l_@@_tmp_tl
+ \tl_set:Ne \l_@@_tmp_tl
{ \l_@@_key_name_tl \c_space_tl \l_@@_tmp_tl }
\prop_if_in:NoF \l_@@_vars_prop \l_@@_tmp_tl
{
@@ -1744,7 +1739,7 @@
\@@_split_keytype_arg:o \l_@@_tmp_tl
\prop_get:NoN \l_@@_values_prop \l_@@_key_name_tl
\l_@@_tmp_tl
- \msg_error:nnxxx { xtemplate } { unknown-default-choice }
+ \msg_error:nneee { xtemplate } { unknown-default-choice }
{ \l_@@_key_name_tl } { \l_@@_key_name_tl }
{ \l_@@_keytype_arg_tl }
}
@@ -1772,7 +1767,7 @@
\prop_get:NoN \l_@@_keytypes_prop \l_@@_key_name_tl
\l_@@_tmp_tl
\@@_split_keytype_arg:o \l_@@_tmp_tl
- \msg_error:nnxxx { xtemplate } { unknown-choice }
+ \msg_error:nneee { xtemplate } { unknown-choice }
{ \l_@@_key_name_tl } {#2}
{ \l_@@_keytype_arg_tl }
}
@@ -1787,7 +1782,7 @@
\prop_get:NoN \l_@@_keytypes_prop \l_@@_key_name_tl
\l_@@_tmp_tl
\@@_split_keytype_arg:o \l_@@_tmp_tl
- \msg_error:nnxxx { xtemplate } { unknown-choice }
+ \msg_error:nneee { xtemplate } { unknown-choice }
{ \l_@@_key_name_tl } {#2}
{ \l_@@_keytype_arg_tl }
}
@@ -1795,15 +1790,15 @@
}
\cs_new_protected:Npn \@@_implement_choice_elt_aux:nnn #1#2#3
{
- \keys_define:nx { template / #1 }
+ \keys_define:ne { template / #1 }
{ \l_@@_key_name_tl / #2 .code:n = { \exp_not:n {#3} } }
- \tl_set:Nx \l_@@_tmp_tl
+ \tl_set:Ne \l_@@_tmp_tl
{ \l_@@_key_name_tl \c_space_tl #2 }
\prop_put:Non \l_@@_vars_prop \l_@@_tmp_tl {#3}
}
\cs_new_protected:Npn \@@_implement_choice_elt:n #1
{
- \msg_error:nnxxx { xtemplate } { choice-requires-code }
+ \msg_error:nneee { xtemplate } { choice-requires-code }
{ \l_@@_key_name_tl } {#1}
}
% \end{macrocode}
@@ -1886,7 +1881,7 @@
\cs_new_protected:Npn \@@_parse_values_elt:n #1
{
\bool_set_true:N \l_@@_error_bool
- \msg_error:nnx { xtemplate } { key-no-value } {#1}
+ \msg_error:nne { xtemplate } { key-no-value } {#1}
}
% \end{macrocode}
% \end{macro}
@@ -1900,7 +1895,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_parse_values_elt:nn #1#2
{
- \tl_set:Nx \l_@@_key_name_tl
+ \tl_set:Ne \l_@@_key_name_tl
{ \tl_trim_spaces:e { \tl_to_str:n {#1} } }
\prop_get:NoNTF \l_@@_keytypes_prop \l_@@_key_name_tl
\l_@@_tmp_tl
@@ -1914,7 +1909,7 @@
{ \@@_parse_values_elt_aux:n {#2} }
}
{
- \msg_error:nnx { xtemplate } { unknown-key }
+ \msg_error:nne { xtemplate } { unknown-key }
{ \l_@@_key_name_tl }
}
}
@@ -1978,7 +1973,7 @@
\prop_put:Nnn \l_@@_values_prop { from~template } {#2}
\@@_store_values:n { #1 / #3 / #4 }
\@@_convert_to_assignments:
- \cs_set_protected:cpx { \c_@@_instances_root_tl #1 / #3 / #4 }
+ \cs_set_protected:cpe { \c_@@_instances_root_tl #1 / #3 / #4 }
{
\exp_not:N \@@_assignments_push:n
{ \exp_not:o \l_@@_assignments_tl }
@@ -2009,7 +2004,7 @@
{ \c_@@_instances_root_tl #1 / #2 / #3 }
}
{
- \msg_error:nnxx { xtemplate } { unknown-instance }
+ \msg_error:nnee { xtemplate } { unknown-instance }
{#1} {#3}
}
}
@@ -2035,7 +2030,7 @@
{#2} {#3} {#4}
}
{
- \msg_error:nnxx { xtemplate } { unknown-instance }
+ \msg_error:nnee { xtemplate } { unknown-instance }
{#1} {#3}
}
}
@@ -2094,7 +2089,7 @@
\tl_set:Nn \l_@@_key_name_tl {#1}
\use:c { @@_assign_ \l_@@_keytype_tl : }
}
- { \msg_error:nnx { xtemplate } { unknown-attribute } {#1} }
+ { \msg_error:nne { xtemplate } { unknown-attribute } {#1} }
}
}
\cs_generate_variant:Nn \@@_convert_to_assignments_aux:nn { no }
@@ -2170,7 +2165,7 @@
\@@_if_key_value:oTF \l_@@_value_tl
{
\@@_key_to_value:
- \tl_put_right:Nx \l_@@_assignments_tl
+ \tl_put_right:Ne \l_@@_assignments_tl
{
\exp_not:c { #1 _eq:NN }
\exp_not:o \l_@@_var_tl
@@ -2178,7 +2173,7 @@
}
}
{
- \tl_put_right:Nx \l_@@_assignments_tl
+ \tl_put_right:Ne \l_@@_assignments_tl
{
\exp_not:c { #1 _ \l_@@_value_tl :N }
\exp_not:o \l_@@_var_tl
@@ -2197,16 +2192,16 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_assign_choice:
{
- \@@_assign_choice_aux:xF
+ \@@_assign_choice_aux:eF
{ \l_@@_key_name_tl \c_space_tl \l_@@_value_tl }
{
- \@@_assign_choice_aux:xF
+ \@@_assign_choice_aux:eF
{ \l_@@_key_name_tl \c_space_tl unknown }
{
\prop_get:NoN \l_@@_keytypes_prop \l_@@_key_name_tl
\l_@@_tmp_tl
\@@_split_keytype_arg:o \l_@@_tmp_tl
- \msg_error:nnxxx { xtemplate } { unknown-choice }
+ \msg_error:nneee { xtemplate } { unknown-choice }
{ \l_@@_key_name_tl } { \l_@@_value_tl }
{ \l_@@_keytype_arg_tl }
}
@@ -2220,7 +2215,7 @@
\l_@@_tmp_tl
{ \tl_put_right:No \l_@@_assignments_tl \l_@@_tmp_tl }
}
-\cs_generate_variant:Nn \@@_assign_choice_aux:nF { x }
+\cs_generate_variant:Nn \@@_assign_choice_aux:nF { e }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2237,7 +2232,7 @@
}
\cs_new_protected:Npn \@@_assign_function_aux:N #1
{
- \tl_put_right:Nx \l_@@_assignments_tl
+ \tl_put_right:Ne \l_@@_assignments_tl
{
\cs_generate_from_arg_count:NNnn
\exp_not:o \l_@@_var_tl
@@ -2264,7 +2259,7 @@
}
\cs_new_protected:Npn \@@_assign_instance_aux:N #1
{
- \tl_put_right:Nx \l_@@_assignments_tl
+ \tl_put_right:Ne \l_@@_assignments_tl
{
\exp_not:N #1 \exp_not:o \l_@@_var_tl
{
@@ -2340,14 +2335,14 @@
\@@_if_key_value:oTF \l_@@_value_tl
{
\@@_key_to_value:
- \tl_put_right:Nx \l_@@_assignments_tl
+ \tl_put_right:Ne \l_@@_assignments_tl
{
#1 \exp_not:o \l_@@_var_tl
\exp_not:o \l_@@_value_tl
}
}
{
- \tl_put_right:Nx \l_@@_assignments_tl
+ \tl_put_right:Ne \l_@@_assignments_tl
{
#2 \exp_not:o \l_@@_var_tl
{ \exp_not:o \l_@@_value_tl }
@@ -2379,7 +2374,7 @@
{
\@@_if_key_value:oT \l_@@_value_tl
{ \@@_key_to_value: }
- \tl_put_right:Nx \l_@@_assignments_tl
+ \tl_put_right:Ne \l_@@_assignments_tl
{
#1 \exp_not:o \l_@@_var_tl
{ \exp_not:o \l_@@_value_tl }
@@ -2403,7 +2398,7 @@
{ \exp_after:wN \@@_key_to_value_auxi:w \l_@@_value_tl }
\cs_new_protected:Npn \@@_key_to_value_auxi:w \KeyValue #1
{
- \tl_set:Nx \l_@@_tmp_tl { \tl_trim_spaces:e { \tl_to_str:n {#1} } }
+ \tl_set:Ne \l_@@_tmp_tl { \tl_trim_spaces:e { \tl_to_str:n {#1} } }
\prop_get:NoNTF
\l_@@_vars_prop
\l_@@_tmp_tl
@@ -2413,7 +2408,7 @@
\s_@@_mark global \q_@@_nil \s_@@_stop
}
{
- \msg_error:nnx { xtemplate } { unknown-attribute }
+ \msg_error:nne { xtemplate } { unknown-attribute }
{ \l_@@_tmp_tl }
}
}
@@ -2450,7 +2445,7 @@
{
\str_if_eq:nnTF {#1} {#3}
{ \@@_use_template:nnn {#3} {#4} {#5} }
- { \msg_error:nnxx { xtemplate } { type-mismatch } {#1} {#3} }
+ { \msg_error:nnee { xtemplate } { type-mismatch } {#1} {#3} }
}
\cs_new_protected:Npn \@@_use_instance_aux:nn #1#2
{
@@ -2468,7 +2463,7 @@
\@@_if_instance_exist:nnnTF {#1} { } {#2}
{ \use:c { \c_@@_instances_root_tl #1 / / #2 } }
{
- \msg_error:nnxx { xtemplate } { unknown-instance }
+ \msg_error:nnee { xtemplate } { unknown-instance }
{#1} {#2}
}
}
@@ -2570,7 +2565,7 @@
}
\cs_new_protected:Npn \@@_show:Nnnn #1#2#3#4
{
- \msg_show:nnxxxx { xtemplate } { show-attribute }
+ \msg_show:nneeee { xtemplate } { show-attribute }
{ \tl_to_str:n {#2} }
{ \tl_to_str:n {#3} }
{ \tl_to_str:n {#4} }
@@ -2589,7 +2584,7 @@
\@@_if_instance_exist:nnnT {#1} {#2} {#3}
{
\@@_recover_values:n { #1 / #2 / #3 }
- \msg_show:nnxxxx { xtemplate } { show-values }
+ \msg_show:nneeee { xtemplate } { show-values }
{ \tl_to_str:n {#1} }
{ \tl_to_str:n {#2} }
{ \tl_to_str:n {#3} }