diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-27 01:01:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-27 01:01:05 +0000 |
commit | 2a02b4779d0acc1e6bfd719c6c19e12940617bec (patch) | |
tree | cd84dfbfa5bbed35e60b5a31d28ff46a5efd0273 /Master/texmf-dist/tex/latex/xpackages/xbase | |
parent | 61d5522194a84bc8c81973ff2fd8901e5ce10de0 (diff) |
xpackages update (26apr10)
git-svn-id: svn://tug.org/texlive/trunk@18019 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xpackages/xbase')
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty | 73 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty | 46 |
2 files changed, 83 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty index a5204eeef15..18e704e88cd 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty @@ -57,7 +57,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: xparse.dtx 1876 2010-03-27 07:20:51Z joseph $ +\GetIdInfo$Id: xparse.dtx 1897 2010-04-26 05:56:56Z joseph $ {Generic document command parser} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -654,16 +654,60 @@ \tl_to_str:n {#1} } } -\cs_new:Npn \xparse_process_comma_split:n #1 { - \tl_if_in:nnTF {#1} { , } { - \xparse_process_comma_split_aux:w #1 \q_stop - }{ - \tl_set:Nn \ProcessedArgument { {#1} { \NoValue } } - } -} -\cs_new:Npn \xparse_process_comma_split_aux:w #1 , #2 \q_stop { - \tl_set:Nn \ProcessedArgument { {#1} {#2} } +\cs_new_protected:Npn \_xparse_bool_reverse:N #1 { + \bool_if:NTF #1 + { \tl_set:Nn \ProcessedArgument { \c_false_bool } } + { \tl_set:Nn \ProcessedArgument { \c_true_bool } } } +\tl_new:N \_l_xparse_split_argument_tl +\group_begin: + \char_make_active:N \@ + \cs_gset_protected:Npn \_xparse_split_argument:nnn #1#2#3 + { + \tl_set:Nn \_l_xparse_split_argument_tl {#3} + \group_begin: + \char_set_lccode:nn { `\@ } { `#2} + \tl_to_lowercase:n + { + \group_end: + \tl_replace_all_in:Nnn \_l_xparse_split_argument_tl { @ } {#2} + } + \cs_set_protected:Npn \_xparse_split_argument_aux_i:w + ##1 \q_nil ##2 #2 ##3 \q_stop + { + \tl_put_right:Nn \ProcessedArgument { {##2} } + ##1 \q_nil ##3 \q_stop + } + \cs_set_protected:Npn \_xparse_split_argument_aux_iii:w + ##1 #2 ##2 \q_stop + { + \IfNoValueF {##1} + { + \msg_kernel_error:nnxxx { xparse } { split-excess-tokens } + { \exp_not:n {#2} } {#1} { \exp_not:n {#3} } + } + } + \tl_set:Nx \_l_xparse_tmp_tl + { + \prg_replicate:nn { #1 + 1 } + { \_xparse_split_argument_aux_i:w } + \_xparse_split_argument_aux_ii:w + \exp_not:N \q_nil + \exp_not:V \_l_xparse_split_argument_tl + \prg_replicate:nn {#1} { \exp_not:n {#2} \NoValue } + \exp_not:n { #2 \q_stop } + } + \_l_xparse_tmp_tl + } +\group_end: +\cs_set_protected:Npn \_xparse_split_argument_aux_i:w { } +\cs_set_protected:Npn \_xparse_split_argument_aux_ii:w + #1 \q_nil #2 \q_stop + { + \tl_if_empty:nF {#2} + { \_xparse_split_argument_aux_iii:w #2 \q_stop } + } +\cs_set_protected:Npn \_xparse_split_argument_aux_iii:w { } \cs_new:Npn \xparse_exp_add_type_d:w #1#2 { \xparse_exp_add_type_D:w #1 #2 { \NoValue } } @@ -938,6 +982,13 @@ Argument~specification~'#1'~contains~a~processor~function:\\ this~is~only~supported~for~standard~robust~functions. } +\msg_kernel_set:nnnn { xparse } { split-excess-tokens } + { Too~many~'#1'~tokens~when~trying~to~split~argument. } + { + LaTeX~was~asked~to~split~the~input~'#3'\\ + at~each~occurrence~of~the~token~'#1',~up~to~a~maximum~of~#2~tokens.\\ + There~were~too~many~'#1'~tokens. + } \msg_kernel_new:nnnn { xparse } { unknown-argument-type } { Unknown~argument~type~'#1'~replaced~by~'m'.~Fingers~crossed~... } { @@ -1036,6 +1087,8 @@ } \cs_new_protected:Npn \NoValue { -NoValue- } \cs_new:Npn \ProcessedArgument { } +\cs_new_eq:NN \ReverseBoolean \_xparse_bool_reverse:N +\cs_new_eq:NN \SplitArgument \_xparse_split_argument:nnn \endinput %% %% End of file `xparse.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty index b2dbada94c7..6ff224fff23 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty @@ -54,7 +54,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: xtemplate.dtx 1879 2010-03-29 17:48:38Z mittelba $ +\GetIdInfo$Id: xtemplate.dtx 1896 2010-04-14 17:40:38Z joseph $ {Prototype document functions} @@ -332,7 +332,7 @@ \cs_new:Npn \xtemplate_split_keytype:n #1 { \bool_set_false:N \l_xtemplate_error_bool \tl_set:Nn \l_xtemplate_tmp_tl {#1} - \tl_replace_all_in:Nnn \l_xtemplate_tmp_tl { ~ } { } + \tl_remove_all_in:Nn \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 @@ -802,9 +802,9 @@ } \cs_new_nopar:Npn \xtemplate_assign_code: { \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 - } + \exp_not:N \cs_set:Npn \exp_not:N \xtemplate_assign_code:n + \exp_not:n {##1} + { \exp_not:V \l_xtemplate_var_tl } \exp_not:N \xtemplate_assign_code:n { \exp_not:V \l_xtemplate_value_tl } } @@ -986,7 +986,7 @@ } } \msg_kernel_new:nnnn { xtemplate } { argument-number-mismatch } - { Object~type~'#1'~takes~'#2' ~not~'#3'~argument(s). } + { 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'\\ @@ -1020,7 +1020,7 @@ { 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 \\ + 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. } @@ -1047,24 +1047,23 @@ \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,\\ + When~creating~template~code~using~\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'\\ + 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,\\ + 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:\\ - \c_space_tl \c_space_tl <key-name>~:~#1 + \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>. } @@ -1081,21 +1080,17 @@ or~has~no~implementation. } { - 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. + You~need~to~declare~a~template~with~\DeclareTemplateInterface \\ + and~its~code~with~\DeclareTemplateCode 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 \\ + You~are~trying~to~use~a~template~directly~with~\UseInstance \\ (or~a~similar~function),~but~the~object~types~do~not~match. } \msg_kernel_new:nnnn { xtemplate } { undeclared-variable } - {The~variable~#1~has~not~been~declared. } + { The~variable~#1~has~not~been~declared. } { Before~declaring~an~instance,~all~of~the~required~variables\\ used~in~template~keys~must~be~created. @@ -1111,13 +1106,13 @@ \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~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'. } \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:. } + { The~keytype~'#1'~is~unknown~\msg_line_context:. } { Valid~keytypes~are:\\ -~boolean;\\ @@ -1132,11 +1127,10 @@ -~tokenlist. } \msg_kernel_new:nnnn { xtemplate } { unknown-object-type } - { The ~object~type~'#1'~is~unknown~\msg_line_context:. } + { 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. + An~object~type~needs~to~be~declared~with~ + \DeclareObjectType prior~to~using~it. } \msg_kernel_new:nnnn { xtemplate } { unknown-instance } { The~instance~'#2'~of~type~'#1'~is~unknown. } |