summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xpackages/xbase
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-03-31 00:05:09 +0000
committerKarl Berry <karl@freefriends.org>2010-03-31 00:05:09 +0000
commita41411cfff0a41be6e8d9b793009b47e67d6f9b3 (patch)
treec10afd18e4e8e6bd3f6ea04d6da79bdec787b1e0 /Master/texmf-dist/source/latex/xpackages/xbase
parent3ab55a61f6f8d2218a8f3175bc7481ce162b60d3 (diff)
xpackages 1881 (30mar10)
git-svn-id: svn://tug.org/texlive/trunk@17632 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/xpackages/xbase')
-rw-r--r--Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx457
-rw-r--r--Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx384
2 files changed, 413 insertions, 428 deletions
diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx b/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx
index 49f83b1efbf..6966f9f1e5a 100644
--- a/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx
+++ b/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx
@@ -41,7 +41,7 @@
\RequirePackage{l3names}
%</driver|package>
%\fi
-\GetIdInfo$Id: xparse.dtx 1727 2009-11-06 22:58:32Z joseph $
+\GetIdInfo$Id: xparse.dtx 1876 2010-03-27 07:20:51Z joseph $
{Generic document command parser}
%\iffalse
%<*driver>
@@ -377,14 +377,7 @@
% own processors. These need to accept one argument, which is the
% tokens as grabbed (or as returned by a previous processor function).
% Processor functions should return the processed argument as the
-% variable \cs{ProcessedArgument}. This is initialised as a toks before
-% each processor is called, but may also be set equal to any other
-% variable type:
-% \begin{verbatim}
-% \toks_set:Nn \ProcessedArgument { <content> }
-% \toks_set:NV \ProcessedArgument \LocalVariable
-% \cs_set_eq:NN \ProcessedArgument \LocalVariable
-% \end{verbatim}
+% variable \cs{ProcessedArgument}.
%\end{variable}
%
%\begin{function}{\xparse_process_to_str:n}
@@ -518,20 +511,20 @@
% and not be be altered later!
%\end{variable}
%
-%\begin{variable}{\l_xparse_arg_toks}
-% Token register used as internal representation of
+%\begin{variable}{\l_xparse_arg_tl}
+% Variable used as internal representation of
% \cs{ProcessedArgument}. Unlike the later, this register should not
% be used directly when creating new processors.
%\end{variable}
%
-%\begin{variable}{\l_xparse_args_toks}
-% Token register for arguments as they are picked up for passing on to
-% user functions.
+%\begin{variable}{\l_xparse_args_tl}
+% Token list variable for arguments as they are picked up for passing
+% on to user functions.
%\end{variable}
%
-%\begin{variable}{\l_xparse_environment_args_toks}
-% Token register to pass arguments to the end of an environment from
-% the beginning.
+%\begin{variable}{\l_xparse_environment_args_tl}
+% Token list register to pass arguments to the end of an environment
+% from the beginning.
%\end{variable}
%
%\begin{variable}{\l_xparse_environment_bool}
@@ -578,15 +571,6 @@
% be zero for any trailing optional arguments.
%\end{variable}
%
-%\begin{variable}{
-% \l_xparse_nested_int |
-% \l_xparse_nested_toks
-%}
-% Nested optional (delimited) arguments have to be handled by hand:
-% \TeX\ will not count up the token-matching. So an integer is needed
-% to count tokens, and a token register to build up the argument.
-%\end{variable}
-%
%\begin{variable}{\l_xparse_processor_bool}
% When converting an argument specification into a signature there is
% a need to know if there are any argument processors set up. This is
@@ -601,10 +585,10 @@
% to the collection order.
%\end{variable}
%
-%\begin{variable}{\l_xparse_signature_toks}
+%\begin{variable}{\l_xparse_signature_tl}
% For constructing the signature of the function defined. As
% \pkg{xparse} works through an argument specification, grabber
-% functions are added to this toks for each argument.
+% functions are added to this variable for each argument.
%\end{variable}
%
%\begin{variable}{\l_xparse_tmp_tl}
@@ -804,7 +788,7 @@
% \xparse_grab_u_long:w |
%}
% \begin{syntax}
-% "\xparse_grab_D:w" <arg data> "\l_xparse_args_toks"
+% "\xparse_grab_D:w" <arg data> "\l_xparse_args_tl"
% \end{syntax}
% Argument grabbing functions, which re-arrange other <arg data>
% so that the argument is read correctly. The \texttt{trailing}
@@ -930,24 +914,24 @@
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_xparse_arg_toks}
+%\begin{macro}{\l_xparse_arg_tl}
% Token registers for single grabbed argument when post-processing.
% \begin{macrocode}
-\toks_new:N \l_xparse_arg_toks
+\tl_new:N \l_xparse_arg_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_xparse_args_toks}
+%\begin{macro}{\l_xparse_args_tl}
% Token registers for grabbed arguments.
% \begin{macrocode}
-\toks_new:N \l_xparse_args_toks
+\tl_new:N \l_xparse_args_tl
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_xparse_environment_args_toks}
+%\begin{macro}{\l_xparse_environment_args_tl}
% Used to pass arguments to the end of an environment.
% \begin{macrocode}
-\toks_new:N \l_xparse_environment_args_toks
+\tl_new:N \l_xparse_environment_args_tl
% \end{macrocode}
%\end{macro}
%
@@ -979,7 +963,7 @@
%\begin{macro}{\l_xparse_last_arg_tl}
% Used when creating expandable arguments.
% \begin{macrocode}
-\toks_new:N \l_xparse_last_arg_tl
+\tl_new:N \l_xparse_last_arg_tl
% \end{macrocode}
%\end{macro}
%
@@ -1015,18 +999,6 @@
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_xparse_nested_int}
-%\begin{macro}{\l_xparse_nested_toks}
-% To deal with nested delimited arguments, the code needs to do some
-% token counting `by hand'. That requires an integer, and also a token
-% register to store the growing argument collected.
-% \begin{macrocode}
-\int_new:N \l_xparse_nested_int
-\toks_new:N \l_xparse_nested_toks
-% \end{macrocode}
-%\end{macro}
-%\end{macro}
-%
%\begin{macro}{\l_xparse_processor_bool}
% When reading through the argument specifier, a flag is needed to
% show that a processor has been found for the current argument. This
@@ -1045,10 +1017,10 @@
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_xparse_signature_toks}
+%\begin{macro}{\l_xparse_signature_tl}
% Token registers for constructing signatures.
% \begin{macrocode}
-\toks_new:N \l_xparse_signature_toks
+\tl_new:N \l_xparse_signature_tl
% \end{macrocode}
%\end{macro}
%
@@ -1087,7 +1059,7 @@
% searching for the argument.
% \begin{macrocode}
\cs_new_nopar:Npn \xparse_add_grabber_mandatory:N #1 {
- \toks_put_right:Nx \l_xparse_signature_toks {
+ \tl_put_right:Nx \l_xparse_signature_tl {
\exp_not:c {
xparse_grab_ #1 \bool_if:NT \l_xparse_long_bool { _long } :w
}
@@ -1096,7 +1068,7 @@
\int_decr:N \l_xparse_mandatory_args_int
}
\cs_new_nopar:Npn \xparse_add_grabber_optional:N #1 {
- \toks_put_right:Nx \l_xparse_signature_toks {
+ \tl_put_right:Nx \l_xparse_signature_tl {
\exp_not:c {
xparse_grab_ #1
\bool_if:NT \l_xparse_long_bool { _long }
@@ -1147,7 +1119,7 @@
\bool_set_true:N \l_xparse_processor_bool
\xparse_flush_m_args:
\int_decr:N \l_xparse_total_args_int
- \toks_put_right:Nn \l_xparse_signature_toks {
+ \tl_put_right:Nn \l_xparse_signature_tl {
\xparse_process_arg:n {#1}
}
\xparse_prepare_signature_aux:N
@@ -1176,7 +1148,7 @@
\cs_new:Npn \xparse_add_type_D:w #1#2#3 {
\xparse_flush_m_args:
\xparse_add_grabber_optional:N D
- \toks_put_right:Nn \l_xparse_signature_toks { #1 #2 {#3} }
+ \tl_put_right:Nn \l_xparse_signature_tl { #1 #2 {#3} }
\xparse_prepare_signature:N
}
% \end{macrocode}
@@ -1199,7 +1171,7 @@
\cs_new:Npn \xparse_add_type_G:w #1 {
\xparse_flush_m_args:
\xparse_add_grabber_optional:N G
- \toks_put_right:Nn \l_xparse_signature_toks { {#1} }
+ \tl_put_right:Nn \l_xparse_signature_tl { {#1} }
\xparse_prepare_signature:N
}
% \end{macrocode}
@@ -1246,7 +1218,7 @@
\cs_new:Npn \xparse_add_type_t:w #1 {
\xparse_flush_m_args:
\xparse_add_grabber_optional:N t
- \toks_put_right:Nn \l_xparse_signature_toks { #1 }
+ \tl_put_right:Nn \l_xparse_signature_tl { #1 }
\xparse_prepare_signature:N
}
% \end{macrocode}
@@ -1259,7 +1231,7 @@
\cs_new:Npn \xparse_add_type_u:w #1 {
\xparse_flush_m_args:
\xparse_add_grabber_mandatory:N u
- \toks_put_right:Nn \l_xparse_signature_toks { {#1} }
+ \tl_put_right:Nn \l_xparse_signature_tl { {#1} }
\xparse_prepare_signature:N
}
% \end{macrocode}
@@ -1393,11 +1365,11 @@
\cs_if_exist:NTF #1
{
\msg_kernel_warning:nnxx { xparse } { redefine-command }
- { \exp_not:N #1 } { \exp_not:n {#2} }
+ { \token_to_str:N #1 } { \exp_not:n {#2} }
}
{
\msg_kernel_info:nnxx { xparse } { define-command }
- { \exp_not:N #1 } { \exp_not:n {#2} }
+ { \token_to_str:N #1 } { \exp_not:n {#2} }
}
\xparse_declare_cmd_aux:Nnn #1 {#2}
}
@@ -1419,10 +1391,10 @@
\cs_set_protected_nopar:Npx #1 {
\exp_not:n {
\int_zero:N \l_xparse_processor_int
- \toks_set:Nn \l_xparse_args_toks
+ \tl_set:Nn \l_xparse_args_tl
} { \exp_not:c { \token_to_str:N #1 } }
- \toks_use:N \l_xparse_signature_toks
- \exp_not:n{ \toks_use:N \l_xparse_args_toks }
+ \exp_not:V \l_xparse_signature_tl
+ \exp_not:N \l_xparse_args_tl
}
\cs_generate_from_arg_count:cNnn
{ \token_to_str:N #1 } \cs_set:Npn \l_xparse_total_args_int {#2}
@@ -1475,10 +1447,10 @@
\cs_set_protected_nopar:Npx #1 {
\exp_not:n {
\int_zero:N \l_xparse_processor_int
- \toks_set:Nn \l_xparse_args_toks
+ \tl_set:Nn \l_xparse_args_tl
} { \exp_not:c { \token_to_str:N #1 } }
- \toks_use:N \l_xparse_signature_toks
- \exp_not:n{ \toks_use:N \l_xparse_args_toks }
+ \exp_not:V \l_xparse_signature_tl
+ \exp_not:N \l_xparse_args_tl
}
\cs_generate_from_arg_count:cNnn
{ \token_to_str:N #1 } \cs_set:Npn \l_xparse_total_args_int
@@ -1513,15 +1485,14 @@
}
\xparse_declare_cmd_aux:cnn { environment_begin_ #1 :w } {#2} {
\group_begin:
- \toks_set_eq:NN \l_xparse_environment_args_toks
- \l_xparse_args_toks
+ \tl_set_eq:NN \l_xparse_environment_args_tl \l_xparse_args_tl
#3
}
\bool_set_false:N \l_xparse_environment_bool
\cs_set_nopar:cpx { environment_end_ #1 :w } {
\exp_not:N \exp_last_unbraced:NV
\exp_not:c { environment_end_ #1 _aux:N }
- \exp_not:N \l_xparse_environment_args_toks
+ \exp_not:N \l_xparse_environment_args_tl
\exp_not:N \group_end:
}
\cs_set_nopar:cpx { environment_end_ #1 _aux:N } ##1 {
@@ -1551,7 +1522,7 @@
\cs_if_exist:cT {
xparse_grab_m_ \int_use:N \l_xparse_m_args_int :w
} {
- \toks_put_right:Nx \l_xparse_signature_toks {
+ \tl_put_right:Nx \l_xparse_signature_tl {
\exp_not:c { xparse_grab_m_ \int_use:N \l_xparse_m_args_int :w }
}
\int_set:Nn \l_xparse_mandatory_args_int {
@@ -1580,7 +1551,7 @@
%
%\begin{macro}{\xparse_prepare_signature:n}
% Creating the signature is a case of working through the input and
-% turning into the output in \cs{l_xparse_signature_toks}. A track is
+% turning into the output in \cs{l_xparse_signature_tl}. A track is
% also kept of the total number of arguments. This function sets
% everything up then hands off to the parser.
% \begin{macrocode}
@@ -1593,7 +1564,7 @@
\bool_set_true:N \l_xparse_m_only_bool
}
\bool_set_false:N \l_xparse_processor_bool
- \toks_clear:N \l_xparse_signature_toks
+ \tl_clear:N \l_xparse_signature_tl
\int_zero:N \l_xparse_total_args_int
\xparse_prepare_signature:N #1 \q_nil
}
@@ -1659,11 +1630,11 @@
% \begin{macrocode}
\cs_new:Npn \xparse_add_arg:n #1 {
\intexpr_compare:nTF { \l_xparse_processor_int = \c_zero } {
- \toks_put_right:Nn \l_xparse_args_toks { {#1} }
+ \tl_put_right:Nn \l_xparse_args_tl { {#1} }
}{
\xparse_if_no_value:nTF {#1} {
\int_zero:N \l_xparse_processor_int
- \toks_put_right:Nn \l_xparse_args_toks { {#1} }
+ \tl_put_right:Nn \l_xparse_args_tl { {#1} }
}{
\xparse_add_arg_aux:n {#1}
}
@@ -1671,12 +1642,12 @@
}
\cs_generate_variant:Nn \xparse_add_arg:n { V }
\cs_new:Npn \xparse_add_arg_aux:n #1 {
- \cs_set_eq:NN \ProcessedArgument \l_xparse_arg_toks
+ \tl_set_eq:NN \ProcessedArgument \l_xparse_arg_tl
\use:c { xparse_processor_ \int_use:N \l_xparse_processor_int :n }
{#1}
\int_decr:N \l_xparse_processor_int
\intexpr_compare:nTF { \l_xparse_processor_int = \c_zero } {
- \toks_put_right:Nx \l_xparse_args_toks {
+ \tl_put_right:Nx \l_xparse_args_tl {
{ \exp_not:V \ProcessedArgument }
}
}{
@@ -1723,19 +1694,19 @@
% a peek test before calling \cs{xparse_grab_arg:w}, so that the
% optional nature of the argument works as expected.
% \begin{macrocode}
-\cs_new:Npn \xparse_grab_D:w #1#2#3#4 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_D:w #1#2#3#4 \l_xparse_args_tl {
\xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set_nopar:Npn
{ _ignore_spaces }
}
-\cs_new:Npn \xparse_grab_D_long:w #1#2#3#4 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_D_long:w #1#2#3#4 \l_xparse_args_tl {
\xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set:Npn
{ _ignore_spaces }
}
-\cs_new:Npn \xparse_grab_D_trailing:w #1#2#3#4 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_D_trailing:w #1#2#3#4 \l_xparse_args_tl {
\xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set_nopar:Npn { }
}
\cs_new:Npn \xparse_grab_D_long_trailing:w #1#2#3#4
- \l_xparse_args_toks {
+ \l_xparse_args_tl {
\xparse_grab_D_aux:NNnnNn #1 #2 {#3} {#4} \cs_set:Npn { }
}
% \end{macrocode}
@@ -1769,17 +1740,17 @@
}
#5 \xparse_grab_arg_aux_ii:w ##1 #2 {
\tl_if_in:nnTF {##1} {#1} {
- \xparse_grab_D_nested:NNnNn #1 #2 {#4} #5 {##1}
+ \xparse_grab_D_nested:NNNnn #1 #2 {##1} {#4} #5
}{
\xparse_add_arg:n {##1}
- #4 \l_xparse_args_toks
+ #4 \l_xparse_args_tl
}
}
\use:c { peek_charcode #6 :NTF } #1 {
\xparse_grab_arg:w
}{
\xparse_add_arg:n {#3}
- #4 \l_xparse_args_toks
+ #4 \l_xparse_args_tl
}
}
% \end{macrocode}
@@ -1789,39 +1760,57 @@
%\end{macro}
%\end{macro}
%\begin{macro}[aux]{\xparse_grab_D_nested:NNnNn}
-%\begin{macro}[aux]{\xparse_grab_D_nested_aux:n}
-% Catching nested optional arguments means more work. As \TeX\ does not
-% help here, the brackets have to be counted by hand. The code then
-% keeps looking for closing tokens until all of the opening ones
-% are matched.
-% \begin{macrocode}
-\cs_new:Npn \xparse_grab_D_nested:NNnNn #1#2#3#4#5 {
- \int_zero:N \l_xparse_nested_int
- \toks_set:Nn \l_xparse_nested_toks { #5 #2 }
- \cs_set:Npn \xparse_grab_D_nested_aux:n ##1 {
- \tl_if_eq:nnT {#1} {##1} {
- \int_incr:N \l_xparse_nested_int
- }
- }
- \tl_map_function:nN {#5} \xparse_grab_D_nested_aux:n
- #4 \xparse_grab_arg:w ##1 #2 {
- \int_decr:N \l_xparse_nested_int
- \tl_map_function:nN {##1} \xparse_grab_D_nested_aux:n
- \intexpr_compare:nTF { \l_xparse_nested_int = \c_zero } {
- \toks_put_right:Nn \l_xparse_nested_toks {##1}
- \xparse_add_arg:V \l_xparse_nested_toks
- #3 \l_xparse_args_toks
- }{
- \toks_put_right:Nn \l_xparse_nested_toks { ##1 #2 }
- \xparse_grab_arg:w
+%\begin{macro}{\_l_xparse_nesting_a_tl}
+%\begin{macro}{\_l_xparse_nesting_b_tl}
+%\begin{macro}{\_q_xparse}
+% Catching nested optional arguments means more work. The aim here is
+% to collect up each pair of optional tokens without \TeX\ helping out,
+% and without counting anything. The code above will already have
+% removed the leading opening token and a closing token, but the
+% wrong one. The aim is then to work through the the material grabbed
+% so far and divide it up on each opening token, grabbing a closing
+% token to match (thus working in pairs). Once there are no opening
+% tokens, then there is a second check to see if there are any
+% opening tokens in the second part of the argument (for things
+% like "[][]"). Once everything has been found, the entire collected
+% material is added to the output as a single argument.
+% \begin{macrocode}
+\tl_new:N \_l_xparse_nesting_a_tl
+\tl_new:N \_l_xparse_nesting_b_tl
+\quark_new:N \_q_xparse
+\cs_new_protected:Npn \xparse_grab_D_nested:NNNnn #1#2#3#4#5 {
+ \tl_clear:N \_l_xparse_nesting_a_tl
+ \tl_clear:N \_l_xparse_nesting_b_tl
+ #5 \xparse_grab_arg:w ##1 #1 ##2 \_q_xparse ##3 #2
+ {
+ \tl_put_right:Nn \_l_xparse_nesting_a_tl { ##1 #1 }
+ \tl_put_right:Nn \_l_xparse_nesting_b_tl { #2 ##3 }
+ \tl_if_in:nnTF {##2} {#1}
+ { \xparse_grab_arg:w ##2 \_q_xparse }
+ {
+ \tl_if_in:NnTF \_l_xparse_nesting_b_tl {#1}
+ {
+ \tl_set_eq:NN \l_xparse_tmp_tl \_l_xparse_nesting_b_tl
+ \tl_clear:N \_l_xparse_nesting_b_tl
+ \exp_last_unbraced:NV \xparse_grab_arg:w
+ \l_xparse_tmp_tl \_q_xparse
+ }
+ {
+ \tl_put_right:Nn \_l_xparse_nesting_a_tl {##2}
+ \tl_put_right:NV \_l_xparse_nesting_a_tl
+ \_l_xparse_nesting_b_tl
+ \xparse_add_arg:V \_l_xparse_nesting_a_tl
+ #4 \l_xparse_args_tl
+ }
+ }
}
- }
- \xparse_grab_arg:w
+ \xparse_grab_arg:w #3 \_q_xparse
}
-\cs_new:Npn \xparse_grab_D_nested_aux:n #1 { }
% \end{macrocode}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
%\begin{macro}{\xparse_grab_G:w}
%\begin{macro}{\xparse_grab_G_long:w}
@@ -1831,28 +1820,28 @@
% Optional groups are checked by meaning, so that the same code will
% work with, for example, Con\TeX{}t-like input.
% \begin{macrocode}
-\cs_new:Npn \xparse_grab_G:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_G:w #1#2 \l_xparse_args_tl {
\xparse_grab_G_aux:nnNn {#1} {#2} \cs_set_nopar:Npn { _ignore_spaces }
}
-\cs_new:Npn \xparse_grab_G_long:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_G_long:w #1#2 \l_xparse_args_tl {
\xparse_grab_G_aux:nnNn {#1} {#2} \cs_set:Npn { _ignore_spaces }
}
-\cs_new:Npn \xparse_grab_G_trailing:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_G_trailing:w #1#2 \l_xparse_args_tl {
\xparse_grab_G_aux:nnNn {#1} {#2} \cs_set_nopar:Npn { }
}
-\cs_new:Npn \xparse_grab_G_long_trailing:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_G_long_trailing:w #1#2 \l_xparse_args_tl {
\xparse_grab_G_aux:nnNn {#1} {#2} \cs_set:Npn { }
}
\cs_set:Npn \xparse_grab_G_aux:nnNn #1#2#3#4 {
#3 \xparse_grab_arg:w ##1 {
\xparse_add_arg:n {##1}
- #2 \l_xparse_args_toks
+ #2 \l_xparse_args_tl
}
\use:c { peek_meaning #4 :NTF } \c_group_begin_token {
\xparse_grab_arg:w
}{
\xparse_add_arg:n {#1}
- #2 \l_xparse_args_toks
+ #2 \l_xparse_args_tl
}
}
% \end{macrocode}
@@ -1867,16 +1856,16 @@
%\begin{macro}[aux]{\xparse_grab_l_aux:nN}
% Argument grabbers for mandatory \TeX\ arguments are pretty simple.
% \begin{macrocode}
-\cs_new:Npn \xparse_grab_l:w #1 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_l:w #1 \l_xparse_args_tl {
\xparse_grab_l_aux:nN {#1} \cs_set_nopar:Npn
}
-\cs_new:Npn \xparse_grab_l_long:w #1 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_l_long:w #1 \l_xparse_args_tl {
\xparse_grab_l_aux:nN {#1} \cs_set:Npn
}
\cs_new:Npn \xparse_grab_l_aux:nN #1#2 {
#2 \xparse_grab_arg:w ##1## {
\xparse_add_arg:n {##1}
- #1 \l_xparse_args_toks
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
@@ -1889,17 +1878,17 @@
%\begin{macro}{\xparse_grab_m_long:w}
% Collecting a single mandatory argument is quite easy.
% \begin{macrocode}
-\cs_new:Npn \xparse_grab_m:w #1 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_m:w #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1 {
\xparse_add_arg:n {##1}
- #1 \l_xparse_args_toks
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:Npn \xparse_grab_m_long:w #1 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_m_long:w #1 \l_xparse_args_tl {
\cs_set:Npn \xparse_grab_arg:w ##1 {
\xparse_add_arg:n {##1}
- #1 \l_xparse_args_toks
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
@@ -1920,67 +1909,67 @@
% mandatory. Each function has an auxiliary so that \cs{par} tokens
% from other arguments still work.
% \begin{macrocode}
-\cs_new:cpn { xparse_grab_m_1:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_1:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1 {
- \toks_put_right:Nn \l_xparse_args_toks { {##1} }
- #1 \l_xparse_args_toks
+ \tl_put_right:Nn \l_xparse_args_tl { {##1} }
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:cpn { xparse_grab_m_2:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_2:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1##2 {
- \toks_put_right:Nn \l_xparse_args_toks { {##1} {##2} }
- #1 \l_xparse_args_toks
+ \tl_put_right:Nn \l_xparse_args_tl { {##1} {##2} }
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:cpn { xparse_grab_m_3:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_3:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3 {
- \toks_put_right:Nn \l_xparse_args_toks { {##1} {##2} {##3} }
- #1 \l_xparse_args_toks
+ \tl_put_right:Nn \l_xparse_args_tl { {##1} {##2} {##3} }
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:cpn { xparse_grab_m_4:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_4:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4 {
- \toks_put_right:Nn \l_xparse_args_toks { {##1} {##2} {##3} {##4} }
- #1 \l_xparse_args_toks
+ \tl_put_right:Nn \l_xparse_args_tl { {##1} {##2} {##3} {##4} }
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:cpn { xparse_grab_m_5:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_5:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5 {
- \toks_put_right:Nn \l_xparse_args_toks {
+ \tl_put_right:Nn \l_xparse_args_tl {
{##1} {##2} {##3} {##4} {##5}
}
- #1 \l_xparse_args_toks
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:cpn { xparse_grab_m_6:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_6:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5##6 {
- \toks_put_right:Nn \l_xparse_args_toks {
+ \tl_put_right:Nn \l_xparse_args_tl {
{##1} {##2} {##3} {##4} {##5} {##6}
}
- #1 \l_xparse_args_toks
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:cpn { xparse_grab_m_7:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_7:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5##6##7 {
- \toks_put_right:Nn \l_xparse_args_toks {
+ \tl_put_right:Nn \l_xparse_args_tl {
{##1} {##2} {##3} {##4} {##5} {##6} {##7}
}
- #1 \l_xparse_args_toks
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
-\cs_new:cpn { xparse_grab_m_8:w } #1 \l_xparse_args_toks {
+\cs_new:cpn { xparse_grab_m_8:w } #1 \l_xparse_args_tl {
\cs_set_nopar:Npn \xparse_grab_arg:w ##1##2##3##4##5##6##7##8 {
- \toks_put_right:Nn \l_xparse_args_toks {
+ \tl_put_right:Nn \l_xparse_args_tl {
{##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8}
}
- #1 \l_xparse_args_toks
+ #1 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
@@ -2002,26 +1991,26 @@
% Dealing with a token is quite easy. Check the match, remove the
% token if needed and add a flag to the output.
% \begin{macrocode}
-\cs_new:Npn \xparse_grab_t:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_t:w #1#2 \l_xparse_args_tl {
\xparse_grab_t_aux:NnNn #1 {#2} \cs_set_nopar:Npn { _ignore_spaces }
}
-\cs_new:Npn \xparse_grab_t_long:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_t_long:w #1#2 \l_xparse_args_tl {
\xparse_grab_t_aux:NnNn #1 {#2} \cs_set:Npn { _ignore_spaces }
}
-\cs_new:Npn \xparse_grab_t_trailing:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_t_trailing:w #1#2 \l_xparse_args_tl {
\xparse_grab_t_aux:NnNn #1 {#2} \cs_set_nopar:Npn { }
}
-\cs_new:Npn \xparse_grab_t_long_trailing:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_t_long_trailing:w #1#2 \l_xparse_args_tl {
\xparse_grab_t_aux:NnNn #1 {#2} \cs_set:Npn { }
}
\cs_new:Npn \xparse_grab_t_aux:NnNn #1#2#3#4 {
#3 \xparse_grab_arg:w {
\use:c { peek_charcode_remove #4 :NTF } #1 {
\xparse_add_arg:n { \BooleanTrue }
- #2 \l_xparse_args_toks
+ #2 \l_xparse_args_tl
}{
\xparse_add_arg:n { \BooleanFalse }
- #2 \l_xparse_args_toks
+ #2 \l_xparse_args_tl
}
}
\xparse_grab_arg:w
@@ -2039,16 +2028,16 @@
% Grabbing up to a list of tokens is quite easy: define the grabber,
% and then collect.
% \begin{macrocode}
-\cs_new:Npn \xparse_grab_u:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_u:w #1#2 \l_xparse_args_tl {
\xparse_grab_u_aux:NnN {#1} {#2} \cs_set_nopar:Npn
}
-\cs_new:Npn \xparse_grab_u_long:w #1#2 \l_xparse_args_toks {
+\cs_new:Npn \xparse_grab_u_long:w #1#2 \l_xparse_args_tl {
\xparse_grab_u_aux:NnN {#1} {#2} \cs_set:Npn
}
\cs_new:Npn \xparse_grab_u_aux:NnN #1#2#3 {
#3 \xparse_grab_arg:w ##1 #1 {
\xparse_add_arg:n {##1}
- #2 \l_xparse_args_toks
+ #2 \l_xparse_args_tl
}
\xparse_grab_arg:w
}
@@ -2063,7 +2052,7 @@
% A basic argument processor: as much an example as anything else.
% \begin{macrocode}
\cs_new:Npn \xparse_process_to_str:n #1 {
- \toks_set:Nx \ProcessedArgument {
+ \tl_set:Nx \ProcessedArgument {
\tl_to_str:n {#1}
}
}
@@ -2078,11 +2067,11 @@
\tl_if_in:nnTF {#1} { , } {
\xparse_process_comma_split_aux:w #1 \q_stop
}{
- \toks_set:Nn \ProcessedArgument { {#1} { \NoValue } }
+ \tl_set:Nn \ProcessedArgument { {#1} { \NoValue } }
}
}
\cs_new:Npn \xparse_process_comma_split_aux:w #1 , #2 \q_stop {
- \toks_set:Nn \ProcessedArgument { {#1} {#2} }
+ \tl_set:Nn \ProcessedArgument { {#1} {#2} }
}
% \end{macrocode}
%\end{macro}
@@ -2110,7 +2099,7 @@
%\begin{macro}{\xparse_exp_add_type_D:w}
% The most complex argument to grab in an expandable manner is the
% general delimited one. First, a short-cut is set up in
-% \cs{l_xparse_tmpa_tl} for the name of the current grabber function.
+% \cs{l_xparse_tmp_tl} for the name of the current grabber function.
% This is then created to grab one argument and test if it is equal
% to the opening delimiter. If the test fails, the code adds the default
% value and closing delimiter before `recycling' the argument. In either
@@ -2120,20 +2109,20 @@
% grabbed thus-far using \cs{q_xparse_stop} as a marker.
% \begin{macrocode}
\cs_new:Npn \xparse_exp_add_type_D:w #1#2#3 {
- \tl_set:Nx \l_xparse_tmpa_tl {
+ \tl_set:Nx \l_xparse_tmp_tl {
\exp_after:wN \token_to_str:N \l_xparse_function_tl
\int_use:N \l_xparse_total_args_int
}
- \xparse_exp_set:cpx { \l_xparse_tmpa_tl } ##1 \q_xparse_stop ##2 {
+ \xparse_exp_set:cpx { \l_xparse_tmp_tl } ##1 \q_xparse_stop ##2 {
\exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 {
- \exp_not:c { \l_xparse_tmpa_tl aux }
+ \exp_not:c { \l_xparse_tmp_tl aux }
##1 \exp_not:N \q_xparse_stop
}{
- \exp_not:c { \l_xparse_tmpa_tl aux }
+ \exp_not:c { \l_xparse_tmp_tl aux }
##1 \exp_not:N \q_xparse_stop #3 #2 {##2}
}
}
- \xparse_exp_set:cpx { \l_xparse_tmpa_tl aux}
+ \xparse_exp_set:cpx { \l_xparse_tmp_tl aux}
##1 \q_xparse_stop ##2 #2 {
\exp_not:c {
\exp_after:wN \token_to_str:N \l_xparse_function_tl
@@ -2191,7 +2180,7 @@
% arguments. In the later case, the grabber argument must be `recycled'.
% \begin{macrocode}
\cs_new:Npn \xparse_exp_add_type_t:w #1 {
- \tl_set:Nx \l_xparse_tmpa_tl {
+ \tl_set:Nx \l_xparse_tmp_tl {
\exp_after:wN \token_to_str:N \l_xparse_function_tl
\intexpr_eval:n { \l_xparse_total_args_int + 1 }
}
@@ -2200,10 +2189,10 @@
\int_use:N \l_xparse_total_args_int
} ##1 \q_xparse_stop ##2 {
\exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 {
- \exp_not:c { \l_xparse_tmpa_tl }
+ \exp_not:c { \l_xparse_tmp_tl }
##1 \exp_not:n { { \BooleanTrue } \q_xparse_stop }
}{
- \exp_not:c { \l_xparse_tmpa_tl }
+ \exp_not:c { \l_xparse_tmp_tl }
##1 \exp_not:n { { \BooleanFalse } \q_xparse_stop {##2} }
}
}
@@ -2269,11 +2258,11 @@
\cs_if_exist:NTF #1
{
\msg_kernel_warning:nnxx { xparse } { redefine-command }
- { \exp_not:N #1 } { \exp_not:n {#2} }
+ { \token_to_str:N #1 } { \exp_not:n {#2} }
}
{
\msg_kernel_info:nnxx { xparse } { define-command }
- { \exp_not:N #1 } { \exp_not:n {#2} }
+ { \token_to_str:N #1 } { \exp_not:n {#2} }
}
\tl_set:Nn \l_xparse_function_tl {#1}
\xparse_exp_prepare_function:n {#2}
@@ -2419,100 +2408,100 @@
% Some messages intended as errors.
% \begin{macrocode}
\msg_kernel_new:nnnn { xparse } { command-already-defined }
- {Command `#1' already defined!}
- {%
- You have used \token_to_str:N \NewDocumentCommand\\%
- with a command that already has a definition.\\%
- Perhaps you meant \token_to_str:N \RenewDocumentCommand.%
+ { Command~'#1'~already~defined! }
+ {
+ You~have~used~\token_to_str:N \NewDocumentCommand \\
+ with~a~command~that~already~has~a~definition.\\
+ Perhaps~you~meant~\token_to_str:N \RenewDocumentCommand.
}
\msg_kernel_new:nnnn { xparse } { command-not-yet-defined }
- {Command `#1' not yet defined!}
- {%
- You have used \token_to_str:N \RenewDocumentCommand\\%
- with a command that was never defined.\\%
- Perhaps you meant \token_to_str:N \NewDocumentCommand.%
+ { Command ~'#1'~not~yet~defined! }
+ {
+ You~have~used~\token_to_str:N \RenewDocumentCommand \\
+ with~a~command~that~was~never~defined.\\
+ Perhaps~you~meant~\token_to_str:N \NewDocumentCommand.
}
\msg_kernel_new:nnnn { xparse } { environment-already-defined }
- {Environment `#1' already defined!}
- {%
- You have used \token_to_str:N \NewDocumentEnvironment\\%
- with a command that already has a definition.\\%
- Perhaps you meant \token_to_str:N \RenewDocumentEnvironment.%
+ { Environment~'#1'~already~defined! }
+ {
+ You~have~used~\token_to_str:N \NewDocumentEnvironment \\
+ with~a~command~that~already~has~a~definition.\\
+ Perhaps~you~meant~\token_to_str:N \RenewDocumentEnvironment.
}
\msg_kernel_new:nnnn { xparse } { environment-not-yet-defined }
- {Environment `#1' not yet defined!}
- {%
- You have used \token_to_str:N \RenewDocumentEnvironment\\%
- with a command that was never defined.\\%
- Perhaps you meant \token_to_str:N \NewDocumentEnvironment.%
+ {Environment~'#1'~not~yet~defined! }
+ {
+ You~have~used~\token_to_str:N \RenewDocumentEnvironment \\
+ with~a command~that~was~never~defined.\\
+ Perhaps~you~meant~\token_to_str:N \NewDocumentEnvironment.
}
\msg_kernel_new:nnnn { xparse } { expandable-ending-optional }
- {%
- Signature for expandable command ends with \\%
- optional argument \msg_line_context:.%
- }
- {%
- Expandable commands must have a final mandatory argument\\%
- (or no arguments at all). You cannot have a terminal optional\\%
- argument with expandable commands.%
+ {
+ Signature~for~expandable~command~ends~with \\
+ optional~argument~\msg_line_context:.
+ }
+ {
+ Expandable~commands~must~have~a~final~mandatory~argument \\
+ (or~no arguments~at all).~You~cannot~have~a~terminal~optional \\
+ argument~with~expandable~commands.
}
\msg_kernel_new:nnnn { xparse } { expandable-inconsistent-long }
- {%
- Inconsistent handling of long arguments for\\%
- expandable command \msg_line_context:.%
+ {
+ Inconsistent~handling~of~long~arguments~for \\
+ expandable~command~\msg_line_context:.
}
- {%
- The arguments for an expandable command must either all be\\%
- short or all be long. You have tried to mix the two types.%
+ {
+ The~arguments~for~an~expandable~command~must~either~all~be \\
+ short~or~all~be~long.~You~have~tried~to mix~the~two~types.
}
\msg_kernel_new:nnnn { xparse } { grouped-in-expandable }
{%
- Argument specifier `#1' forbidden in expandable commands
- \msg_line_context:.%
+ Argument~specifier~'#1'~forbidden~in~expandable~commands~
+ \msg_line_context:.
}
- {%
- Argument specification `#2' contains the optional grouped
- argument `#1':\\%
- this is only supported for standard robust functions.%
+ {
+ Argument~specification~'#2'~contains~the~optional~grouped~
+ argument~#1':\\
+ this~is only~supported~for~standard~robust~functions.
}
\msg_kernel_new:nnnn { xparse } { processor-in-expandable }
- {%
- Argument processors cannot be used\\%
- with expandable functions \msg_line_context:.%
+ {
+ Argument~processors~cannot~be~used \\
+ with~expandable~functions~\msg_line_context:.
}
- {%
- Argument specification `#1' contains a processor function:\\%
- this is only supported for standard robust functions.%
+ {
+ Argument~specification~'#1'~contains~a~processor~function:\\
+ this~is~only~supported~for~standard~robust~functions.
}
\msg_kernel_new:nnnn { xparse } { unknown-argument-type }
- {Unknown argument type `#1' replaced by `m'. Fingers crossed ...}
- {%
- The letter `#1' does not specify a known argument type.\\%
- I'm assuming you want a standard mandatory argument (type `m').%
+ { Unknown~argument~type~'#1'~replaced~by~'m'.~Fingers~crossed~... }
+ {
+ The~letter~#1'~does~not~specify~a~known~argument~type.\\
+ I'm~assuming~you~want~a~standard~mandatory~argument~(type~'m').
}
% \end{macrocode}
%
% Intended more for information.
% \begin{macrocode}
\msg_kernel_new:nnn { xparse } { define-command }
- {%
- Defining document command #1\\%
- with arg. spec. `#2' \msg_line_context:.%
+ {
+ Defining~document~command~#1\\
+ with~arg.~spec.~'#2'~\msg_line_context:.
}
\msg_kernel_new:nnn { xparse } { define-environment }
- {%
- Defining document environment `#1'\\%
- with arg. spec. `#2' \msg_line_context:.%
+ {
+ Defining~document~environment~'#1'\\
+ with~arg.~spec.~'#2'~\msg_line_context:.
}
\msg_kernel_new:nnn { xparse } { redefine-command }
- {%
- Redefining document command #1\\%
- with arg. spec. `#2' \msg_line_context:.%
+ {
+ Redefining~document~command~#1\\
+ with~arg.~spec.~'#2'~\msg_line_context:.
}
\msg_kernel_new:nnn { xparse } { redefine-environment }
- {%
- Redefining document environment `#1'\\%
- with arg. spec. `#2' \msg_line_context:.%
+ {
+ Redefining~document~environment~'#1'\\
+ with~arg.~spec.~'#2'~\msg_line_context:.
}
% \end{macrocode}
%
@@ -2543,7 +2532,7 @@
\cs_new_protected:Npn \NewDocumentCommand #1#2#3 {
\cs_if_exist:NTF #1 {
\msg_kernel_error:nnx { xparse } { command-already-defined }
- { \exp_not:N #1 }
+ { \token_to_str:N #1 }
}{
\xparse_declare_cmd:Nnn #1 {#2} {#3}
}
@@ -2553,7 +2542,7 @@
\xparse_declare_cmd:Nnn #1 {#2} {#3}
}{
\msg_kernel_error:nnx { xparse } { command-not-yet-defined }
- { \exp_not:N #1 }
+ { \token_to_str:N #1 }
}
}
\cs_new_protected:Npn \ProvideDocumentCommand #1#2#3 {
diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx b/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx
index 445474da3ef..0287282d898 100644
--- a/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx
+++ b/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx
@@ -1,6 +1,6 @@
% \iffalse
%% File: xtemplate.dtx (C) Copyright 1999-2001 David Carlisle, Frank Mittelbach
-%% (C) Copyright 2004-2009 Frank Mittelbach, LaTeX3 Project
+%% (C) Copyright 2004-2010 Frank Mittelbach, LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -38,7 +38,7 @@
\RequirePackage{l3names}
%</driver|package>
%\fi
-\GetIdInfo$Id: xtemplate.dtx 1746 2009-11-16 01:34:59Z will $
+\GetIdInfo$Id: xtemplate.dtx 1879 2010-03-29 17:48:38Z mittelba $
{Prototype document functions}
%\iffalse
%<*driver>
@@ -365,6 +365,12 @@
% \end{verbatim}
% The \texttt{unknown} entry must be the last one given, and should
% \emph{not} be listed in the interface part of of the template.
+%
+% For keys which accept the values "true" and "false" both the boolean
+% and choice key types can be used. As template interfaces are intended
+% to prompt clarity at the design level, the boolean key type should be
+% favoured, with the choice type reserved for keys which take arbitrary
+% values.
%
% \subsection{Instances}\label{sec:instances}
%
@@ -718,8 +724,8 @@
% of arguments each requires.
%\end{variable}
%
-%\begin{variable}{\l_xtemplate_assignments_toks}
-% This token register is used in two places. First, it is where the
+%\begin{variable}{\l_xtemplate_assignments_tl}
+% This token list variable is used in two places. First, it is where the
% list of assignments for an instance is constructed during
% \cs{DeclareInstance}. Second, it is where these are copied to to
% allow \cs{AssignTemplateKeys} to work correctly.
@@ -1139,7 +1145,7 @@
% "\xtemplate_convert_to_assignments:"
% \end{syntax}
% Converts the contents of the various scratch property lists into
-% a list of variable assignments in \cs{l_xtemplate_assignments_toks}.
+% a list of variable assignments in \cs{l_xtemplate_assignments_tl}.
%\end{function}
%
%\begin{function}{\xtemplate_find_global:}
@@ -1227,7 +1233,7 @@
% \begin{syntax}
% "\xtemplate_assignments_pop:"
% \end{syntax}
-% Pops \cs{l_xtemplate_assignment_toks}, and therefore executes
+% Pops \cs{l_xtemplate_assignment_tl}, and therefore executes
% the assignements stored there.
%\end{function}
%
@@ -1235,7 +1241,7 @@
% \begin{syntax}
% "\xtemplate_assignments_push:n" \marg{assignments}
% \end{syntax}
-% Pushes <assignments> to \cs{l_xtemplate_assignment_toks} for later
+% Pushes <assignments> to \cs{l_xtemplate_assignment_tl} for later
% execution.
%\end{function}
%
@@ -1314,7 +1320,7 @@
%\begin{macro}{\c_xtemplate_vars_root_tl}
% So that literal values are kept to a minimum.
% \begin{macrocode}
-\tl_new:Nn \c_xtemplate_code_root_tl { xtemplate_code > }
+\tl_const:Nn \c_xtemplate_code_root_tl { xtemplate_code > }
\tl_new:Nn \c_xtemplate_defaults_root_tl { xtemplate_defaults > }
\tl_new:Nn \c_xtemplate_instances_root_tl { xtemplate_instances > }
\tl_new:Nn \c_xtemplate_keytypes_root_tl { xtemplate_keytypes > }
@@ -1356,11 +1362,10 @@
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_xtemplate_assignments_toks}
-% When creating an instance, the assigned values are collected here. A
-% toks is needed as there can be |#| tokens.
+%\begin{macro}{\l_xtemplate_assignments_tl}
+% When creating an instance, the assigned values are collected here.
% \begin{macrocode}
-\toks_new:N \l_xtemplate_assignments_toks
+\tl_new:N \l_xtemplate_assignments_tl
% \end{macrocode}
%\end{macro}
%
@@ -1408,10 +1413,10 @@
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\l_xtemplate_restricted_clist}
+%\begin{macro}{\l_xtemplate_restrict_clist}
% A scratch list for restricting templates.
% \begin{macrocode}
-\clist_new:N \l_xtemplate_restricted_clist
+\clist_new:N \l_xtemplate_restrict_clist
% \end{macrocode}
%\end{macro}
%
@@ -1486,13 +1491,6 @@
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\xtemplate_space:}
-% A space!
-% \begin{macrocode}
-\cs_new_eq:NN \xtemplate_space: \iow_space:
-% \end{macrocode}
-%\end{macro}
-%
%\subsection{Testing existence and validity}
%
% There are a number of checks needed for either the existence of
@@ -1672,6 +1670,9 @@
\l_xtemplate_values_prop
}
\cs_new:Npn \xtemplate_store_restrictions:n #1 {
+ \cs_if_free:cT { g_ \c_xtemplate_restrict_root_tl #1 _clist } {
+ \clist_new:c { g_ \c_xtemplate_restrict_root_tl #1 _clist }
+ }
\clist_gset_eq:cN { g_ \c_xtemplate_restrict_root_tl #1 _clist }
\l_xtemplate_restrict_clist
}
@@ -1712,6 +1713,10 @@
{ g_ \c_xtemplate_keytypes_root_tl #1 _prop }
}
\cs_new:Npn \xtemplate_recover_restrictions:n #1 {
+% FMi why is this called before being defined????
+ \cs_if_free:cT { g_ \c_xtemplate_restrict_root_tl #1 _clist } {
+ \clist_new:c { g_ \c_xtemplate_restrict_root_tl #1 _clist }
+ }
\clist_set_eq:Nc \l_xtemplate_restrict_clist
{ g_ \c_xtemplate_restrict_root_tl #1 _clist }
}
@@ -1788,9 +1793,8 @@
\prop_clear:N \l_xtemplate_values_prop
\prop_clear:N \l_xtemplate_keytypes_prop
\seq_clear:N \l_xtemplate_key_seq
- \cs_set_eq:NN \KV_key_no_value_elt:n \xtemplate_parse_keys_elt:n
- \cs_set_eq:NN \KV_key_value_elt:nn \xtemplate_parse_keys_elt:nn
- \KV_parse_space_removal_sanitize:n {#4}
+ \KV_process_space_removal_sanitize:NNn
+ \xtemplate_parse_keys_elt:n \xtemplate_parse_keys_elt:nn {#4}
\prop_put:NVV \l_xtemplate_keytypes_prop \c_xtemplate_key_order_tl
\l_xtemplate_key_seq
\xtemplate_store_defaults:n { #1 / #2 }
@@ -1897,11 +1901,11 @@
\group_end:
\cs_new:Npn \xtemplate_split_keytype:n #1 {
\bool_set_false:N \l_xtemplate_error_bool
- \tl_set:Nn \l_xtemplate_tmpa_tl {#1}
- \tl_replace_all_in:Nnn \l_xtemplate_tmpa_tl { ~ } { }
- \tl_replace_all_in:Nnn \l_xtemplate_tmpa_tl { : } { @ }
- \tl_if_in:VnTF \l_xtemplate_tmpa_tl { @ } {
- \exp_after:wN \xtemplate_split_keytype_aux:w \l_xtemplate_tmpa_tl
+ \tl_set:Nn \l_xtemplate_tmp_tl {#1}
+ \tl_replace_all_in:Nnn \l_xtemplate_tmp_tl { ~ } { }
+ \tl_replace_all_in:Nnn \l_xtemplate_tmp_tl { : } { @ }
+ \tl_if_in:VnTF \l_xtemplate_tmp_tl { @ } {
+ \exp_after:wN \xtemplate_split_keytype_aux:w \l_xtemplate_tmp_tl
\q_stop
}{
\bool_set_true:N \l_xtemplate_error_bool
@@ -2013,12 +2017,12 @@
% \begin{macrocode}
\cs_new:Npn \xtemplate_store_value_choice:n #1 {
\tl_set:Nx \l_xtemplate_tmp_tl
- { \l_xtemplate_key_name_tl \xtemplate_space: #1 }
+ { \l_xtemplate_key_name_tl \c_space_tl #1 }
\prop_if_in:NVTF \l_xtemplate_vars_prop \l_xtemplate_tmp_tl {
\xtemplate_store_value_choice_aux:V \l_xtemplate_tmp_tl
}{
\tl_set:Nx \l_xtemplate_tmp_tl
- { \l_xtemplate_key_name_tl \xtemplate_space: unknown }
+ { \l_xtemplate_key_name_tl \c_space_tl unknown }
\prop_if_in:NVTF \l_xtemplate_vars_prop \l_xtemplate_tmp_tl {
\xtemplate_store_value_choice_aux:V \l_xtemplate_tmp_tl
}{
@@ -2042,7 +2046,7 @@
\cs_generate_variant:Nn \xtemplate_store_value_choice_aux:n { V }
\cs_new:Npn \xtemplate_store_value_choice_name:n #1 {
\tl_set:Nx \l_xtemplate_tmp_tl
- { \l_xtemplate_key_name_tl \xtemplate_space: default }
+ { \l_xtemplate_key_name_tl \c_space_tl default }
\prop_put:NVn \l_xtemplate_values_prop \l_xtemplate_tmp_tl {#1}
}
% \end{macrocode}
@@ -2160,9 +2164,8 @@
\xtemplate_recover_defaults:n { #1 / #2 }
\xtemplate_recover_keytypes:n { #1 / #2 }
\prop_clear:N \l_xtemplate_vars_prop
- \cs_set_eq:NN \KV_key_no_value_elt:n \xtemplate_parse_vars_elt:n
- \cs_set_eq:NN \KV_key_value_elt:nn \xtemplate_parse_vars_elt:nn
- \KV_parse_space_removal_sanitize:n {#3}
+ \KV_process_space_removal_sanitize:NNn
+ \xtemplate_parse_vars_elt:n \xtemplate_parse_vars_elt:nn {#3}
% \end{macrocode}
% In certain cases (when choices are involved) parsing the key results in
% changes to the default values. Therefore we have to save those back.
@@ -2223,9 +2226,7 @@
% \begin{macrocode}
\cs_new:Npn \xtemplate_parse_vars_elt_aux:n #1 {
\tl_if_eq:VnTF \l_xtemplate_keytype_tl { choice }
- {
- \xtemplate_implement_choices:n {#1}
- }
+ { \xtemplate_implement_choices:n {#1} }
{
\tl_if_eq:VnTF \l_xtemplate_keytype_tl { code }
{
@@ -2295,14 +2296,12 @@
% \begin{macrocode}
\cs_new:Npn \xtemplate_implement_choices:n #1 {
\clist_set_eq:NN \l_xtemplate_tmp_clist \l_xtemplate_keytype_arg_tl
- \cs_set_eq:NN \KV_key_no_value_elt:n \xtemplate_implement_choice_elt:n
- \cs_set_eq:NN \KV_key_value_elt:nn \xtemplate_implement_choice_elt:nn
\prop_put:NVn \l_xtemplate_vars_prop \l_xtemplate_key_name_tl { }
- \KV_parse_space_removal_sanitize:n {#1}
- \cs_set_eq:NN \KV_key_no_value_elt:n \xtemplate_parse_vars_elt:n
- \cs_set_eq:NN \KV_key_value_elt:nn \xtemplate_parse_vars_elt:nn
+ \KV_process_space_removal_sanitize:NNn
+ \xtemplate_implement_choice_elt:n \xtemplate_implement_choice_elt:nn
+ {#1}
\tl_set:Nx \l_xtemplate_tmp_tl
- { \l_xtemplate_key_name_tl \xtemplate_space: default }
+ { \l_xtemplate_key_name_tl \c_space_tl default }
\prop_if_in:NVT \l_xtemplate_values_prop \l_xtemplate_tmp_tl {
\prop_get:NVN \l_xtemplate_values_prop \l_xtemplate_tmp_tl
\l_xtemplate_tmp_tl
@@ -2355,7 +2354,7 @@
\cs_new:Npn \xtemplate_implement_choice_elt:nn #1#2 {
\xtemplate_implement_choice_elt:n {#1}
\tl_set:Nx \l_xtemplate_tmp_tl
- { \l_xtemplate_key_name_tl \xtemplate_space: #1 }
+ { \l_xtemplate_key_name_tl \c_space_tl #1 }
\prop_put:NVn \l_xtemplate_vars_prop \l_xtemplate_tmp_tl {#2}
}
% \end{macrocode}
@@ -2416,10 +2415,9 @@
% \begin{macrocode}
\cs_new:Npn \xtemplate_parse_values:nn #1#2 {
\xtemplate_recover_keytypes:n {#1}
- \clist_clear:N \l_xtemplate_restricted_clist
- \cs_set_eq:NN \KV_key_no_value_elt:n \xtemplate_parse_values_elt:n
- \cs_set_eq:NN \KV_key_value_elt:nn \xtemplate_parse_values_elt:nn
- \KV_parse_space_removal_sanitize:n {#2}
+ \clist_clear:N \l_xtemplate_restrict_clist
+ \KV_process_space_removal_sanitize:NNn
+ \xtemplate_parse_values_elt:n \xtemplate_parse_values_elt:nn {#2}
}
% \end{macrocode}
%\end{macro}
@@ -2447,7 +2445,7 @@
\tl_replace_all_in:Nnn \l_xtemplate_key_name_tl { ~ } { }
\prop_if_in:NVTF \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl {
\bool_if:NTF \l_xtemplate_restrict_bool {
- \clist_if_in:NVF \l_xtemplate_restricted_clist
+ \clist_if_in:NVF \l_xtemplate_restrict_clist
\l_xtemplate_key_name_tl {
\xtemplate_parse_values_elt_aux:Vn \l_xtemplate_key_name_tl {#2}
}
@@ -2460,7 +2458,7 @@
}
}
\cs_new:Npn \xtemplate_parse_values_elt_aux:nn #1#2 {
- \clist_put_right:Nn \l_xtemplate_restricted_clist {#1}
+ \clist_put_right:Nn \l_xtemplate_restrict_clist {#1}
\prop_get:NnN \l_xtemplate_keytypes_prop {#1} \l_xtemplate_tmp_tl
\xtemplate_split_keytype_arg:V \l_xtemplate_tmp_tl
\use:c { xtemplate_store_value_ \l_xtemplate_keytype_tl :n } {#2}
@@ -2518,7 +2516,7 @@
\xtemplate_convert_to_assignments:
\cs_set:cpx { \c_xtemplate_instances_root_tl #1 / #3 / #4 :w } {
\exp_not:N \xtemplate_assignments_push:n {
- \exp_not:V \l_xtemplate_assignments_toks
+ \exp_not:V \l_xtemplate_assignments_tl
}
\exp_not:c { \c_xtemplate_code_root_tl #1 / #2 :w }
}
@@ -2573,7 +2571,7 @@
% This is done using a sequence as property lists are not ``ordered''.
% \begin{macrocode}
\cs_new_nopar:Npn \xtemplate_convert_to_assignments: {
- \toks_clear:N \l_xtemplate_assignments_toks
+ \tl_clear:N \l_xtemplate_assignments_tl
\prop_get:NVN \l_xtemplate_keytypes_prop \c_xtemplate_key_order_tl
\l_xtemplate_key_seq
\seq_map_function:NN \l_xtemplate_key_seq
@@ -2673,7 +2671,7 @@
\xtemplate_if_key_value:VT \l_xtemplate_value_tl {
\xtemplate_key_to_value:
}
- \toks_put_left:Nx \l_xtemplate_assignments_toks {
+ \tl_put_left:Nx \l_xtemplate_assignments_tl {
\exp_not:c { #1 _ \l_xtemplate_value_tl :N }
\exp_not:V \l_xtemplate_var_tl
}
@@ -2688,7 +2686,7 @@
% place.
% \begin{macrocode}
\cs_new_nopar:Npn \xtemplate_assign_choice: {
- \toks_put_left:NV \l_xtemplate_assignments_toks \l_xtemplate_value_tl
+ \tl_put_left:NV \l_xtemplate_assignments_tl \l_xtemplate_value_tl
}
% \end{macrocode}
%\end{macro}
@@ -2697,10 +2695,10 @@
%\begin{macro}{\xtemplate_assign_code:n}
% Assigning general code to a key needs a scratch function to be created
% and run when \cs{AssignTemplateKeys} is called. So the appropriate
-% definition then use is created in the toks.
+% definition then use is created in the token list variable.
% \begin{macrocode}
\cs_new_nopar:Npn \xtemplate_assign_code: {
- \toks_put_left:Nx \l_xtemplate_assignments_toks {
+ \tl_put_left:Nx \l_xtemplate_assignments_tl {
\exp_not:N \cs_set:Npn \exp_not:N \xtemplate_assign_code:n ##1 {
\exp_not:V \l_xtemplate_var_tl
}
@@ -2715,7 +2713,6 @@
%
%\begin{macro}{\xtemplate_assign_function:}
%\begin{macro}[aux]{\xtemplate_assign_function_aux:N}
-% For functions, the toks needs to have a cs-generation step created.
% This looks a bit messy but is only actually one function.
% \begin{macrocode}
\cs_new_nopar:Npn \xtemplate_assign_function: {
@@ -2726,7 +2723,7 @@
}
}
\cs_new_nopar:Npn \xtemplate_assign_function_aux:N #1 {
- \toks_put_left:Nx \l_xtemplate_assignments_toks {
+ \tl_put_left:Nx \l_xtemplate_assignments_tl {
\exp_not:N \cs_generate_from_arg_count:NNnn
\exp_not:V \l_xtemplate_var_tl
\exp_not:N #1
@@ -2741,7 +2738,7 @@
%\begin{macro}{\xtemplate_assign_instance:}
%\begin{macro}[aux]{\xtemplate_assign_instance_aux:N}
% Using an instance means adding the appropriate function creation to
-% the toks. No checks are made at this stage, so if the instance is
+% the tl. No checks are made at this stage, so if the instance is
% not valid then errors will arise later.
% \begin{macrocode}
\cs_new_nopar:Npn \xtemplate_assign_instance: {
@@ -2752,7 +2749,7 @@
}
}
\cs_new_nopar:Npn \xtemplate_assign_instance_aux:N #1 {
- \toks_put_left:Nx \l_xtemplate_assignments_toks {
+ \tl_put_left:Nx \l_xtemplate_assignments_tl {
\exp_not:N #1 \exp_not:V \l_xtemplate_var_tl {
\exp_not:N \xtemplate_use_instance:nn
{ \exp_not:V \l_xtemplate_keytype_arg_tl }
@@ -2814,7 +2811,7 @@
\cs_new_eq:NN \xtemplate_assign_commalist:
\xtemplate_assign_tokenlist:
\cs_new_nopar:Npn \xtemplate_assign_tokenlist_aux:N #1 {
- \toks_put_left:Nx \l_xtemplate_assignments_toks {
+ \tl_put_left:Nx \l_xtemplate_assignments_tl {
\exp_not:N #1 \exp_not:V \l_xtemplate_var_tl
{ \exp_not:V \l_xtemplate_value_tl }
}
@@ -2833,7 +2830,7 @@
\xtemplate_if_key_value:VT \l_xtemplate_value_tl {
\xtemplate_key_to_value:
}
- \toks_put_left:Nx \l_xtemplate_assignments_toks {
+ \tl_put_left:Nx \l_xtemplate_assignments_tl {
\exp_not:N #1 \exp_not:V \l_xtemplate_var_tl
{ \exp_not:V \l_xtemplate_value_tl }
}
@@ -2950,7 +2947,7 @@
% To actually use the assignments.
% \begin{macrocode}
\cs_new_nopar:Npn \xtemplate_assignments_pop: {
- \toks_use:N \l_xtemplate_assignments_toks
+ \tl_use:N \l_xtemplate_assignments_tl
}
% \end{macrocode}
%\end{macro}
@@ -2959,7 +2956,7 @@
% Here, the assignments are stored for later use.
% \begin{macrocode}
\cs_new:Npn \xtemplate_assignments_push:n #1 {
- \toks_set:Nn \l_xtemplate_assignments_toks {#1}
+ \tl_set:Nn \l_xtemplate_assignments_tl {#1}
}
% \end{macrocode}
%\end{macro}
@@ -3027,194 +3024,193 @@
% The text for error messages: short and long text for all of them.
% \begin{macrocode}
\msg_kernel_new:nnnn { xtemplate } { argument-number-mismatch }
- {Object type `#1' takes `#2' not `#3' argument(s).}
- {%
- Objects of type `#1' require `#2' arguments.\\%
- You have tried to make a template for `#1'\\%
- with `#3' arguments, which is not possible:\\%
- the number of arguments must agree.%
+ { Object~type~'#1'~takes~'#2' ~not~'#3'~argument(s). }
+ {
+ Objects~of~type~'#1'~require~'#2'~arguments.\\
+ You~have~tried~to~make~a~template~for~'#1'\\
+ with~'#3'~arguments,~which~is~not~possible:\\
+ the~number~of~arguments~must~agree.%
}
\msg_kernel_new:nnnn { xtemplate } { bad-number-of-arguments }
- {%
- Impossible number of arguments declared for\\%
- object type `#1'.%
+ {
+ Impossible~number~of~arguments~declared~for \\
+ object~type~'#1'.
}
- {%
- An object may accept between 0 and 9 arguments.\\%
- You asked to use #2 arguments: this is not supported.%
+ {
+ An~object~may~accept~between~0~and~9~arguments.\\
+ You~asked~to~use~#2~arguments:~this~is~not~supported.
}
\msg_kernel_new:nnnn { xtemplate } { bad-variable }
- {Incorrect variable description \msg_line_context:.}
- {%
- The argument `#1'\\%
- is not of the form `<variable>' or `global <variable>'.\\%
- It must be given in one of these formats to be used in a template.%
+ { Incorrect~variable~description~\msg_line_context:. }
+ {
+ The~argument~'#1'\\
+ is~not~of~the~form~'<variable>'~or~'global~<variable>'.\\
+ It~must~be~given~in~one~of~these~formats~to~be~used~in~a~template.
}
\msg_kernel_new:nnnn { xtemplate } { choice-not-implemented }
- {The choice `#1' has no implementation \msg_line_context:.}
- {%
- Each choice listed in the interface for a template must\\%
- have an implementation.\\%
- I did not find an implementation for `#1'.%
+ { The~choice~'#1'~has~no~implementation~\msg_line_context:. }
+ {
+ Each~choice~listed~in~the~interface~for~a~template~must\\
+ have~an~implementation.\\
+ I~did~not~find~an~implementation~for~'#1'.
}
\msg_kernel_new:nnnn { xtemplate } { choice-unknown-reserved }
- {The choice `unknown' cannot be given for a template key.}
- {%
- The `unknown' choice is automatically checked by template when\\%
- a choice key is given with an unknown value. It should not be\\%
- included in the list of named choices for a key, and is always\\%
- given last in the implementation of choices.%
+ { The~choice~'unknown'~cannot~be~given~for~a~template~key.}
+ {
+ The~'unknown'~choice~is~automatically~checked~by~template~when \\
+ a~choice~key~is~given with~an~unknown~value.~It~should~not~be \\
+ included~in~the~list~of~named~choices~for~a~key,~and~is~always \\
+ given~last~in~the~implementation~of~choices.
}
\msg_kernel_new:nnnn { xtemplate } { duplicate-key-interface }
- {Key `#1' appears twice in interface definition \msg_line_context:.}
- {%
- Each key can only have one interface declared in a template.\\%
- I found two interfaces for `#1': probably a typing error.%
+ { Key~'#1'~appears~twice~in~interface~definition~\msg_line_context:. }
+ {
+ Each~key~can~only~have~one~interface~declared~in~a~template.\\
+ I~found~two~interfaces~for~'#1':~probably~a~typing~error.
}
\msg_kernel_new:nnnn { xtemplate } { empty-key-name }
- {No key name found in `#1' \msg_line_context:.}
- {%
- A template key name and type is given in the form:\\%
- \msg_space: <name> : <type> \\%
- Parsing your input, I found a `:' but nothing before
- it!%
+ { No~key~name~found~in~'#1'~\msg_line_context:. }
+ {
+ A~template~key~name~and~type~is~given~in~the~form:\\
+ \c_space_tl <name>~:~<type> \\
+ Parsing~your~input~I~found~a~:'~but~nothing~before~it!
}
\msg_kernel_new:nnnn { xtemplate } { key-no-value }
- {The key `#1' has no value \msg_line_context:.}
- {%
- When creating an instance of a template\\%
- every key listed must include a value:
- \msg_two_spaces: <key> = <value>
+ { The~key~'#1'~has~no~value~\msg_line_context:.}
+ {
+ When~creating~an~instance~of~a~template\\
+ every~key~listed~must~include~a~value:
+ \c_space_tl \c_space_tl <key>~=~<value>
}
\msg_kernel_new:nnnn { xtemplate } { key-no-variable }
- {The key `#1' requires implementation details \msg_line_context:.}
- {%
- When creating template code using
- \token_to_str:N \DeclareTemplateCode,\\%
- each key name must have an associated implementation.\\%
- This should be given after an `=' sign: I did not find one.%
+ { The~key~'#1'~requires~implementation~details~\msg_line_context:. }
+ {
+ When~creating~template~code~using~
+ \token_to_str:N \DeclareTemplateCode,\\
+ each~key~name~must~have~an~associated~implementation.\\
+ This~should~be~given~after~a~'='~sign:~I~did~not~find~one.
}
\msg_kernel_new:nnnn { xtemplate } { key-not-implemented }
- {Key `#1' has no implementation \msg_line_context:.}
- {%
- The definition of key implementations for template `#2'\\%
- of object type `#3' does not include any details for key `#1'.\\%
- The key was declared in the interface definition,\\%
- and so an implementation is required.%
+ { Key~'#1'~has~no~implementation~\msg_line_context:. }
+ {
+ The~definition~of key implementations~for~template~'#2'\\
+ of~object~type~'#3'~does not~include~any~details~for~key~'#1'.\\
+ The~key was declared~in~the~interface definition,\\
+ and~so~an~implementation~is~required.
}
\msg_kernel_new:nnnn { xtemplate } { keytype-requires-argument }
- {The keytype `#1' requires an argument \msg_line_context:}
- {%
- You should have put:\\%
- \msg_two_spaces: <key-name> : #1
- \token_to_str:N { <argument> \token_to_str:N } \\%
- but I did not find an <argument>.%
+ { The~keytype~'#1'~requires~an~argument~\msg_line_context:. }
+ {
+ You~should~have~put:\\
+ \c_space_tl \c_space_tl <key-name>~:~#1
+ \token_to_str:N {~<argument>~\token_to_str:N } \\
+ but~I~did~not~find~an~<argument>.
}
\msg_kernel_new:nnnn { xtemplate } { no-keytype }
- {The key `#1' is missing a keytype \msg_line_context:}
+ { The~key~'#1'~is missing~a~keytype~\msg_line_context:. }
{%
- You should have put:\\%
- \msg_two_spaces: #1 : <keytype>\\%
- but I did not find an <keytype>.%
+ You~should~have~put:\\
+ \c_space_tl \c_space_tl #1~:~<keytype>\\
+ but~I~did~not~find~a~<keytype>.
}
\msg_kernel_new:nnnn { xtemplate } { no-template-code }
- {%
- The template `#2' of type `#1' is unknown\\%
- or has no implementation.%
+ {
+ The~template~'#2'~of~type~'#1'~is~unknown\\
+ or~has~no~implementation.
}
- {%
- You need to declare a template with
- \token_to_str:N \DeclareTemplateInterface \\%
- and its code with
- \token_to_str:N \DeclareTemplateCode \msg_space:
- prior to using it.%
+ {
+ You~need~to~declare~a~templat~with
+ \token_to_str:N \DeclareTemplateInterface \\
+ and~its~code~with
+ \token_to_str:N \DeclareTemplateCode \c_space_tl
+ prior~to~using~it.
}
\msg_kernel_new:nnnn { xtemplate } { type-mismatch }
- {Object types `#1' and `#2' do not agree.}
- {%
- You are trying to use a template directly with
- \token_to_str:N \UseInstance \\%
- (or a similar function), but the object types do not match.%
+ { Object~types~'#1'~and~'#2'~do~not~agree. }
+ {
+ You~are~trying~to~use~a~template~directly~with
+ \token_to_str:N \UseInstance \\
+ (or~a~similar~function),~but~the~object~types~do~not~match.
}
\msg_kernel_new:nnnn { xtemplate } { undeclared-variable }
- {The variable #1has not been declared.}
- {%
- Before declaring an instance, all of the required variables\\%
- used in template keys must be created.%
+ {The~variable~#1~has~not~been~declared. }
+ {
+ Before~declaring~an~instance,~all~of~the~required~variables\\
+ used~in~template~keys~must~be~created.
}
\msg_kernel_new:nnnn { xtemplate } { unknown-attribute }
- {The template attribute `#1' is unknown.}
- {%
- There is a definition in the current template reading\\%
+ { The~template~attribute~'#1'~is~unknown. }
+ {
+ There~is~a~definition~in~the~current~template~reading\\
\token_to_str:N \KeyValue
- \token_to_str:N { #1 \token_to_str:N }\\%
- but there is no key called `#1'.%
+ \token_to_str:N {~#1~\token_to_str:N }\\
+ but~there~is~no~key~called~'#1'.
}
\msg_kernel_new:nnnn { xtemplate } { unknown-choice }
- {The choice `#1' was not declared for key `#2' \msg_line_context:.}
- {%
- The key `#2' takes a fixed number of choices:\\%
+ { The~choice~'#1'~was~not~declared~for~key~'#2'~\msg_line_context:. }
+ {
+ The~key '#2'~takes~a~fixed~number~of~choices:\\
\clist_map_function:NN #3 \xtemplate_unknown_choice_aux:n
- and this list does not include `#1'.%
+ and~this~list~does~not~include~'#1'.
}
\cs_new:Npn \xtemplate_unknown_choice_aux:n #1 { -~ #1 ;\\}
\msg_kernel_new:nnnn { xtemplate } { unknown-keytype }
- {The keytype `#1' is unknown \msg_line_context:.}
- {%
- Valid keytypes are:\\%
- - boolean;\\%
- - choice;\\%
- - code;\\%
- - commalist;\\%
- - function;\\%
- - instance;\\%
- - integer;\\%
- - length;\\%
- - skip;\\%
- - tokenlist.%
+ { The~keytype '#1'~is~unknown~\msg_line_context:. }
+ {
+ Valid~keytypes~are:\\
+ -~boolean;\\
+ -~choice;\\
+ -~code;\\
+ -~commalist;\\
+ -~function;\\
+ -~instance;\\
+ -~integer;\\
+ -~length;\\
+ -~skip;\\
+ -~tokenlist.
}
\msg_kernel_new:nnnn { xtemplate } { unknown-object-type }
- {The object type `#1' is unknown \msg_line_context:.}
- {%
- An object type needs to be declared with
- \token_to_str:N \DeclareObjectType \msg_space:
- prior to using it.%
+ { The ~object~type~'#1'~is~unknown~\msg_line_context:. }
+ {
+ An~object~type~needs~to~be~declared~with
+ \token_to_str:N \DeclareObjectType \c_space_tl
+ prior~to~using~it.
}
\msg_kernel_new:nnnn { xtemplate } { unknown-instance }
- {The instance `#2' of type `#1' is unknown.}
- {%
- You have asked to use an instance `#2',\\%
- but this has not been created.%
+ { The~instance~'#2'~of~type~'#1'~is~unknown. }
+ {
+ You~have~asked~to~use~an~instance~'#2',\\
+ but~this~has~not~been~created.
}
\msg_kernel_new:nnnn { xtemplate } { unknown-key }
- {Unknown template key `#1' \msg_line_context:.}
- {%
- The key `#1' was not declared in the interface\\%
- for the current template.\\%
- Probably you have misspelled the key name.%
+ { Unknown~template~key~'#1'~\msg_line_context:. }
+ {
+ The~key~'#1'~was~not~declared~in~the~interface\\
+ for~the~current~template.\\
+ Probably~you~have~misspelled~the~key~name.
}
\msg_kernel_new:nnnn { xtemplate } { unknown-template }
- {The template `#2' of type `#1' is unknown \msg_line_context:.}
- {%
- No interface has been declared for a template\\%
- `#2' of object type `#1'.%
+ { The~template~'#2'~of~type~'#1'~is~unknown~\msg_line_context:. }
+ {
+ No~interface~has~been~declared~for~a~template\\
+ '#2'~of~object~type~'#1'.
}
% \end{macrocode}
%
% Information messages only have text: more text should not be needed.
% \begin{macrocode}
\msg_kernel_new:nnn { xtemplate } { define-template-code }
- {Defining template code for `#1' \msg_line_context:.}
+ {Defining~template~code~for~'#1'~\msg_line_context:.}
\msg_kernel_new:nnn { xtemplate } { define-template-interface }
- {Defining template interface for `#1' \msg_line_context:.}
+ {Defining~template~interface~for~'#1'~\msg_line_context:.}
\msg_kernel_new:nnn { xtemplate } { define-object-type }
- {Defining object type `#1' with #2 argument(s) \msg_line_context:.}
+ {Defining~object~type~'#1'~with~#2~argument(s)~\msg_line_context:.}
\msg_kernel_new:nnn { xtemplate } { redefine-template-code }
- {Redefining template code for `#1' \msg_line_context:.}
+ {Redefining~template~code~for~'#1'~\msg_line_context:.}
\msg_kernel_new:nnn { xtemplate } { redefine-template-interface }
- {Redefining template interface for `#1' \msg_line_context:.}
+ {Redefining~template~interface~for~'#1'~\msg_line_context:.}
\msg_kernel_new:nnn { xtemplate } { redefine-object-type }
- {Redefining object type `#1' with #2 argument(s) \msg_line_context:.}
+ {Redefining~object~type~'#1'~with~#2~argument(s)~\msg_line_context:.}
% \end{macrocode}
%
%\subsubsection{User functions}