diff options
author | Karl Berry <karl@freefriends.org> | 2011-12-11 22:31:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-12-11 22:31:42 +0000 |
commit | c56f30c6154e55286a21f438d5ed545a5169f13b (patch) | |
tree | 78d305bd23e7a50cbbd320c30ffcff1e0fb193a5 /Master/texmf-dist/tex/latex/l3packages/xparse | |
parent | a57ec5a6dea711c791fc567803079341c6fbfae3 (diff) |
l3packages 3036 (11dec11)
git-svn-id: svn://tug.org/texlive/trunk@24821 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3packages/xparse')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty index 8e0d8a77b4d..ceb28c984f4 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty @@ -51,12 +51,12 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{expl3} -\GetIdInfo$Id: xparse.dtx 2966 2011-11-19 15:58:47Z joseph $ +\GetIdInfo$Id: xparse.dtx 3036 2011-12-07 19:29:18Z joseph $ {L3 Experimental document command parser} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \RequirePackage{expl3} -\@ifpackagelater { expl3 } { 2011/11/19 } +\@ifpackagelater { expl3 } { 2011/12/07 } { } { \PackageError { xparse } { Support~package~l3kernel~too~old. } @@ -910,36 +910,41 @@ { \xparse_split_argument_aux_iii:w #2 \q_stop } } \cs_new_protected:Npn \xparse_split_argument_aux_iii:w { } +\seq_new:N \l_xparse_split_list_seq \tl_new:N \l_xparse_split_list_tl -\group_begin: - \char_set_catcode_active:N \@ - \cs_new_protected:Npn \xparse_split_list:nn #1#2 - { - \tl_set:Nn \l_xparse_split_list_tl {#2} - \group_begin: - \char_set_lccode:nn { `\@ } { `#1 } - \tl_to_lowercase:n - { - \group_end: - \tl_replace_all:Nnn \l_xparse_split_list_tl { @ } {#1} - } - \cs_set:Npn \xparse_split_list_aux:w ##1 #1 - { - \quark_if_recursion_tail_stop:n {##1} - \tl_put_right:Nn \ProcessedArgument { {##1} } - \xparse_split_list_aux:w - } - \tl_if_empty:NTF \l_xparse_split_list_tl - { \tl_set:Nn \ProcessedArgument { { } } } - { - \tl_clear:N \ProcessedArgument - \exp_after:wN \xparse_split_list_aux:w - \l_xparse_split_list_tl #1 - \q_recursion_tail #1 \q_recursion_stop - } +\cs_new_protected:Npn \xparse_split_list:nn #1#2 + { + \bool_if:nTF + { + \tl_if_single_p:n {#1} && + ! (\token_if_cs_p:N #1 ) + } + { \xparse_split_list_single:Nn #1 {#2} } + { \xparse_split_list_multi:nn {#1} {#2} } } +\cs_set_protected:Npn \xparse_split_list_multi:nn #1#2 + { + \seq_set_split:Nnn \l_xparse_split_list_seq {#1} {#2} + \tl_clear:N \ProcessedArgument + \seq_map_inline:Nn \l_xparse_split_list_seq + { \tl_put_right:Nn \ProcessedArgument { {##1} } } + } +\cs_generate_variant:Nn \xparse_split_list_multi:nn { nV } +\group_begin: +\char_set_catcode_active:N \@ +\cs_new_protected:Npn \xparse_split_list_single:Nn #1#2 + { + \tl_set:Nn \l_xparse_split_list_tl {#2} + \group_begin: + \char_set_lccode:nn { `\@ } { `#1 } + \tl_to_lowercase:n + { + \group_end: + \tl_replace_all:Nnn \l_xparse_split_list_tl { @ } {#1} + } + \xparse_split_list_multi:nV {#1} \l_xparse_split_list_tl + } \group_end: -\cs_new_protected:Npn \xparse_split_list_aux:w { } \cs_new_protected:Npn \xparse_trim_spaces:n #1 { \tl_set:Nx \ProcessedArgument { \tl_trim_spaces:n {#1} } } \cs_new_protected:Npn \xparse_exp_add_type_d:w #1#2 |