summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx84
1 files changed, 43 insertions, 41 deletions
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
index 8f9364f993f..67b80d5358a 100644
--- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
@@ -41,19 +41,20 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2012/11/21]
-%<package>\@ifpackagelater{expl3}{2012/11/21}
+\RequirePackage{expl3}[2012/12/21]
+%<package>\@ifpackagelater{expl3}{2012/12/21}
%<package> {}
%<package> {%
-%<package> \PackageError{xparse}{Support package l3kernel too old.}
+%<package> \PackageError{xparse}{Support package l3kernel too old}
%<package> {%
-%<package> Please install an up to date version of l3kernel
-%<package> using your TeX package manager or from CTAN.\\ \\
+%<package> Please install an up to date version of l3kernel\MessageBreak
+%<package> using your TeX package manager or from CTAN.\MessageBreak
+%<package> \MessageBreak
%<package> Loading xparse will abort!%
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: xparse.dtx 4332 2012-11-21 21:40:31Z joseph $
+\GetIdInfo$Id: xparse.dtx 4390 2012-12-21 06:59:20Z joseph $
{L3 Experimental document command parser}
%</driver|package>
%<*driver>
@@ -1047,6 +1048,7 @@
{#1} { \tl_to_str:n {#2} }
}
\prop_put:Nnn \l_@@_environment_arg_specs_prop {#1} {#2}
+ \bool_set_false:N \l_@@_expandable_bool
\bool_set_true:N \l_@@_environment_bool
\@@_declare_env_internal:nnnn {#1} {#2}
}
@@ -1806,8 +1808,8 @@
% \cs{@@_grab_arg:w} is then called to actually do the grabbing.
%
% \begin{macro}{\@@_grab_arg:w}
-% \begin{macro}[aux]{\@@_grab_arg_aux_i:w}
-% \begin{macro}[aux]{\@@_grab_arg_aux_ii:w}
+% \begin{macro}[aux]{\@@_grab_arg_auxi:w}
+% \begin{macro}[aux]{\@@_grab_arg_auxii:w}
% Each time an argument is actually grabbed, \pkg{xparse} defines a
% function to do it. In that way, long arguments from previous functions
% can be included in the definition of the grabber function, so that
@@ -1816,8 +1818,8 @@
% needed in various places.
% \begin{macrocode}
\cs_new_protected:Npn \@@_grab_arg:w { }
-\cs_new_protected:Npn \@@_grab_arg_aux_i:w { }
-\cs_new_protected:Npn \@@_grab_arg_aux_ii:w { }
+\cs_new_protected:Npn \@@_grab_arg_auxi:w { }
+\cs_new_protected:Npn \@@_grab_arg_auxii:w { }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2345,7 +2347,7 @@
% \begin{macro}
% {
% \@@_grab_v_aux_loop:N,
-% \@@_grab_v_aux_loop_ii:NN,
+% \@@_grab_v_aux_loop:NN,
% \@@_grab_v_aux_loop_end:
% }
% Check that the opening delimiter is a character, setup category codes,
@@ -2379,10 +2381,10 @@
\cs_new_protected:Npn \@@_grab_v_aux_loop:N #1
{
\peek_N_type:TF
- { \@@_grab_v_aux_loop_ii:NN #1 }
+ { \@@_grab_v_aux_loop:NN #1 }
{ \@@_grab_v_aux_abort: }
}
-\cs_new_protected:Npn \@@_grab_v_aux_loop_ii:NN #1 #2
+\cs_new_protected:Npn \@@_grab_v_aux_loop:NN #1 #2
{
\@@_grab_v_token_if_char:NTF #2
{
@@ -2407,7 +2409,7 @@
%
% \begin{macro}{\@@_grab_v_bgroup:}
% \begin{macro}{\@@_grab_v_bgroup_loop:}
-% \begin{macro}{\@@_grab_v_bgroup_loop_ii:N}
+% \begin{macro}{\@@_grab_v_bgroup_loop:N}
% \begin{variable}{\l_@@_v_nesting_int}
% If the opening delimiter is a left brace, we keep track of
% how many left and right braces were encountered so far in
@@ -2432,10 +2434,10 @@
\cs_new_protected:Npn \@@_grab_v_bgroup_loop:
{
\peek_N_type:TF
- { \@@_grab_v_bgroup_loop_ii:N }
+ { \@@_grab_v_bgroup_loop:N }
{ \@@_grab_v_aux_abort: }
}
-\cs_new_protected:Npn \@@_grab_v_bgroup_loop_ii:N #1
+\cs_new_protected:Npn \@@_grab_v_bgroup_loop:N #1
{
\@@_grab_v_token_if_char:NTF #1
{
@@ -2466,7 +2468,7 @@
%
% \begin{macro}{\@@_grab_v_aux_catcodes:}
% \begin{macro}{\@@_grab_v_aux_abort:}
-% \begin{macro}{\@@_grab_v_aux_abort_ii:w}
+% \begin{macro}{\@@_grab_v_aux_abort:w}
% In a standalone format, the list of special characters is kept
% as a sequence, \cs{c_@@_special_chars_seq}, and we use
% \tn{dospecials} in package mode.
@@ -2495,9 +2497,9 @@
{
\@@_grab_v_group_end:
\@@_add_arg:o \c_@@_no_value_tl
- \exp_after:wN \@@_grab_v_aux_abort_ii:w \l_@@_args_tl \q_stop
+ \exp_after:wN \@@_grab_v_aux_abort:w \l_@@_args_tl \q_stop
}
-\cs_new_protected:Npn \@@_grab_v_aux_abort_ii:w #1 #2 \q_stop
+\cs_new_protected:Npn \@@_grab_v_aux_abort:w #1 #2 \q_stop
{
\group_begin:
\char_set_lccode:nn { `\# } { \tex_endlinechar:D }
@@ -2594,16 +2596,16 @@
% \subsection{Grabbing arguments expandably}
%
% \begin{macro}[EXP]{\@@_expandable_grab_D:w}
-% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_i:NNNnwN}
-% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_ii:NNNwNnnn}
-% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_iii:Nw}
-% \begin{macro}[EXP, aux]{\@@_expandable_grab_D_iv:nnNNNwN}
+% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:NNNnwN}
+% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:NNNwNnnn}
+% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:Nw}
+% \begin{macro}[EXP, aux]{\@@_expandable_grab_D:nnNNNwN}
% The first step is to grab the first token or group. The generic grabber
% \cs{\meta{function}}\verb*| | is just after \cs{q_@@}, we go and find
% it.
% \begin{macrocode}
\cs_new:Npn \@@_expandable_grab_D:w #1 \q_@@ #2
- { #2 { \@@_expandable_grab_D_i:NNNnwNn #1 \q_@@ #2 } }
+ { #2 { \@@_expandable_grab_D:NNNnwNn #1 \q_@@ #2 } }
% \end{macrocode}
% We then wish to test whether |#7|, which we just grabbed, is exactly |#2|.
% Expand the only grabber function we have, |#1|, once: the two strings below
@@ -2644,14 +2646,14 @@
% no opening delimiter any more, hence the balance is reached, and the final
% argument is \meta{piece 1} \meta{piece 2}.
% \begin{macrocode}
-\cs_new:Npn \@@_expandable_grab_D_i:NNNnwNn #1#2#3#4#5 \q_@@ #6#7
+\cs_new:Npn \@@_expandable_grab_D:NNNnwNn #1#2#3#4#5 \q_@@ #6#7
{
\str_if_eq:onTF
{ #1 { } { } #7 #2 \q_@@ #3 }
{ { } { #2 } { } }
{
#1
- { \@@_expandable_grab_D_ii:NNNwNnnn #1#2#3#5 \q_@@ #6 }
+ { \@@_expandable_grab_D:NNNwNnnn #1#2#3#5 \q_@@ #6 }
\q_nil { } #2 \ERROR \q_@@ \ERROR
}
{ #5 {#4} \q_@@ #6 {#7} }
@@ -2664,14 +2666,14 @@
% for piece 2}. We concatenate those, replacing the two \cs{ERROR} by the
% closing delimiter |#3|.
% \begin{macrocode}
-\cs_new:Npn \@@_expandable_grab_D_ii:NNNwNnnn #1#2#3#4 \q_@@ #5#6#7#8
+\cs_new:Npn \@@_expandable_grab_D:NNNwNnnn #1#2#3#4 \q_@@ #5#6#7#8
{
- \exp_args:Nof \@@_expandable_grab_D_iv:nnNNNwN
+ \exp_args:Nof \@@_expandable_grab_D:nnNNNwN
{ \use_ii:nn #6 #2 }
- { \@@_expandable_grab_D_iii:Nw #3 \exp_stop_f: #7 #8 }
+ { \@@_expandable_grab_D:Nw #3 \exp_stop_f: #7 #8 }
#1#2#3 #4 \q_@@ #5
}
-\cs_new:Npn \@@_expandable_grab_D_iii:Nw #1#2 \ERROR \ERROR { #2 #1 }
+\cs_new:Npn \@@_expandable_grab_D:Nw #1#2 \ERROR \ERROR { #2 #1 }
% \end{macrocode}
% Armed with our two new \meta{pieces}, we are ready to loop. However, we
% must first see if \meta{piece 2} (here |#2|) contains any opening
@@ -2681,9 +2683,9 @@
% delimiter. In that case, we are done, and put the argument (from which we
% remove a spurious pair of delimiters coming from how we started the loop).
% Otherwise, we go back to looping with
-% \cs{@@_expandable_grab_D_ii:NNNwNnnn}.
+% \cs{@@_expandable_grab_D:NNNwNnnn}.
% \begin{macrocode}
-\cs_new:Npn \@@_expandable_grab_D_iv:nnNNNwN #1#2#3#4#5#6 \q_@@ #7
+\cs_new:Npn \@@_expandable_grab_D:nnNNNwN #1#2#3#4#5#6 \q_@@ #7
{
\exp_args:No \tl_if_empty:oTF
{ #3 { \use_none:nnn } #2 \q_@@ #5 #4 \q_@@ #5 }
@@ -2693,7 +2695,7 @@
}
{
#3
- { \@@_expandable_grab_D_ii:NNNwNnnn #3#4#5#6 \q_@@ #7 }
+ { \@@_expandable_grab_D:NNNwNnnn #3#4#5#6 \q_@@ #7 }
\q_nil {#1} #2 \ERROR \q_@@ \ERROR
}
}
@@ -2705,27 +2707,27 @@
% \end{macro}
%
% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:w}
-% \begin{macro}[EXP]{\@@_expandable_grab_D_alt_i:NNnwNn}
-% \begin{macro}[EXP]{\@@_expandable_grab_D_alt_ii:Nw}
+% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:NNnwNn}
+% \begin{macro}[EXP]{\@@_expandable_grab_D_alt:Nw}
% When the delimiters are identical, nesting is not possble and a simplified
% approach is used. The test concept here is the same as for the case where
% the delimiters are different.
% \begin{macrocode}
\cs_new:Npn \@@_expandable_grab_D_alt:w #1 \q_@@ #2
- { #2 { \@@_expandable_grab_D_alt_i:NNnwNn #1 \q_@@ #2 } }
-\cs_new:Npn \@@_expandable_grab_D_alt_i:NNnwNn #1#2#3#4 \q_@@ #5#6
+ { #2 { \@@_expandable_grab_D_alt:NNnwNn #1 \q_@@ #2 } }
+\cs_new:Npn \@@_expandable_grab_D_alt:NNnwNn #1#2#3#4 \q_@@ #5#6
{
\str_if_eq:onTF
{ #1 { } #6 #2 #2 }
{ { } #2 }
{
#1
- { \@@_expandable_grab_D_alt_ii:Nwn #5 #4 \q_@@ }
+ { \@@_expandable_grab_D_alt:Nwn #5 #4 \q_@@ }
#6 \ERROR
}
{ #4 {#3} \q_@@ #5 {#6} }
}
-\cs_new:Npn \@@_expandable_grab_D_alt_ii:Nwn #1#2 \q_@@ #3
+\cs_new:Npn \@@_expandable_grab_D_alt:Nwn #1#2 \q_@@ #3
{ \@@_put_arg_expandable:ow { \use_none:n #3 } #2 \q_@@ #1 }
% \end{macrocode}
% \end{macro}
@@ -2759,7 +2761,7 @@
{ { } { #2 } { } }
{
#1
- { \@@_expandable_grab_D_ii:NNNwNnnn #1#2#3#5 \q_@@ #6 }
+ { \@@_expandable_grab_D:NNNwNnnn #1#2#3#5 \q_@@ #6 }
\q_nil { } #2 \ERROR \q_@@ \ERROR
}
{
@@ -2787,7 +2789,7 @@
{ { } #2 }
{
#1
- { \@@_expandable_grab_D_alt_ii:Nwn #5 #4 \q_@@ }
+ { \@@_expandable_grab_D_alt:Nwn #5 #4 \q_@@ }
#6 \ERROR
}
{