diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty index b7ecc485e91..2210b51102d 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty @@ -23,8 +23,8 @@ %% (C) Copyright 2004-2008 Frank Mittelbach, %% The LaTeX3 Project %% (C) Copyright 2009-2017 The LaTeX3 Project -\RequirePackage{expl3}[2017/07/15] -\@ifpackagelater{expl3}{2017/07/15} +\RequirePackage{expl3}[2017/07/19] +\@ifpackagelater{expl3}{2017/07/19} {} {% \PackageError{xparse}{Support package l3kernel too old} @@ -36,7 +36,7 @@ }% \endinput } -\ProvidesExplPackage{xparse}{2017/07/15}{} +\ProvidesExplPackage{xparse}{2017/07/19}{} {L3 Experimental document command parser} \tl_const:Nx \c__xparse_no_value_tl { \char_generate:nn { `\- } { 11 } NoValue- } @@ -450,9 +450,9 @@ } \cs_new_protected:Npn \__xparse_normalize_type_D:w #1#2#3 { - \__xparse_single_token_check:n {#1} - \__xparse_single_token_check:n {#2} \quark_if_recursion_tail_stop_do:nn {#3} { \__xparse_bad_arg_spec:wn } + \__xparse_single_char_check:n {#1} + \__xparse_single_char_check:n {#2} \__xparse_add_arg_spec:n { D #1 #2 {#3} } \tl_put_right:Nn \l__xparse_last_delimiters_tl {#1} \bool_set_false:N \l__xparse_grab_expandably_bool @@ -462,7 +462,7 @@ { \quark_if_recursion_tail_stop_do:nn {#2} { \__xparse_bad_arg_spec:wn } \tl_if_blank:nT {#1} { \__xparse_bad_arg_spec:wn } - \tl_map_function:nN {#1} \__xparse_single_token_check:n + \tl_map_function:nN {#1} \__xparse_single_char_check:n \__xparse_normalize_E_unique_check:w #1 \q_nil \q_stop \int_compare:nNnT { \tl_count:n {#2} } > { \tl_count:n {#1} } { \__xparse_bad_arg_spec:wn } @@ -490,8 +490,8 @@ } \cs_new_protected:Npn \__xparse_normalize_type_t:w #1 { - \__xparse_single_token_check:n {#1} \quark_if_recursion_tail_stop_do:Nn #1 { \__xparse_bad_arg_spec:wn } + \__xparse_single_char_check:n {#1} \tl_put_right:Nn \l__xparse_arg_spec_tl { t #1 } \tl_put_right:Nn \l__xparse_last_delimiters_tl {#1} \bool_set_false:N \l__xparse_grab_expandably_bool @@ -516,9 +516,9 @@ } \cs_new_protected:Npn \__xparse_normalize_type_R:w #1#2#3 { - \__xparse_single_token_check:n {#1} - \__xparse_single_token_check:n {#2} \quark_if_recursion_tail_stop_do:nn {#3} { \__xparse_bad_arg_spec:wn } + \__xparse_single_char_check:n {#1} + \__xparse_single_char_check:n {#2} \__xparse_delimiter_check:nnn {#1} { R/r } { \tl_to_str:n {#1} } \__xparse_add_arg_spec:n { R #1 #2 {#3} } \int_incr:N \l__xparse_mandatory_args_int @@ -543,11 +543,22 @@ \tl_clear:N \l__xparse_last_delimiters_tl \__xparse_normalize_arg_spec_loop:n } -\cs_new_protected:Npn \__xparse_single_token_check:n #1 +\cs_new_protected:Npn \__xparse_single_char_check:n #1 { - \exp_args:Nx \tl_if_single_token:nF { \tl_trim_spaces:n {#1} } + \exp_args:Nx \tl_if_single_token:nTF { \tl_trim_spaces:n {#1} } { - \__msg_kernel_error:nnxx { xparse } { not-single-token } + \group_begin: + \tex_escapechar:D = 92 \scan_stop: + \exp_args:Nx \tl_if_single_token:nF + { \exp_args:No \tl_to_str:n { \use:nn #1 { } } } + { + \__msg_kernel_warning:nnxx { xparse } { not-single-char } + { \iow_char:N \\ \l__xparse_function_tl } { \tl_to_str:n {#1} } + } + \group_end: + } + { + \__msg_kernel_error:nnxx { xparse } { not-single-char } { \iow_char:N \\ \l__xparse_function_tl } { \tl_to_str:n {#1} } \__xparse_bad_def:wn } @@ -595,18 +606,17 @@ \cs_new_protected:Npn \__xparse_bad_def:wn #1 \__xparse_break_point:n #2 { } \cs_new_protected:Npn \__xparse_add_arg_spec:n #1 { - \bool_if:NF \l__xparse_long_bool + \bool_lazy_and:nnT + { ! \l__xparse_long_bool } + { \l__xparse_some_long_bool } { - \bool_if:NT \l__xparse_some_long_bool + \bool_if:NT \l__xparse_expandable_bool { - \bool_if:NT \l__xparse_expandable_bool - { - \__msg_kernel_error:nnx { xparse } { inconsistent-long } - { \iow_char:N \\ \l__xparse_function_tl } - \__xparse_bad_def:wn - } - \bool_set_false:N \l__xparse_grab_expandably_bool + \__msg_kernel_error:nnx { xparse } { inconsistent-long } + { \iow_char:N \\ \l__xparse_function_tl } + \__xparse_bad_def:wn } + \bool_set_false:N \l__xparse_grab_expandably_bool } \bool_if:NTF \l__xparse_long_bool { \bool_set_true:N \l__xparse_some_long_bool } @@ -1919,12 +1929,15 @@ \\ \\ LaTeX~will~ignore~this~entire~definition. } -\__msg_kernel_new:nnnn { xparse } { not-single-token } - { Argument~delimiter~'#2'~for~the~command~'#1'~should~be~a~single~token. } +\__msg_kernel_new:nnnn { xparse } { not-single-char } + { + Argument~delimiter~'#2'~for~the~command~'#1'~should~be~ + a~single~character. + } { \c__msg_coding_error_text_tl - The~argument~specification~provided~was~not~valid:~ - in~a~place~where~a~single~token~is~required,~LaTeX~found~'#2'. \\ \\ + The~argument~specification~provided~was~not~valid:~in~a~place~ + where~a~single~character~is~required,~LaTeX~found~'#2'. \\ \\ LaTeX~will~ignore~this~entire~definition. } \__msg_kernel_new:nnnn { xparse } { processor-in-expandable } |