diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx b/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx index ab2f5d2887c..ab45217f33f 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 2125 2011-01-09 15:24:39Z joseph $ +\GetIdInfo$Id: xparse.dtx 2136 2011-01-23 12:15:49Z joseph $ {Generic document command parser} %\iffalse %<*driver> @@ -90,7 +90,7 @@ % \item \cs{RenewDocumentEnvironment} % \item \cs{ProvideDocumentEnvironment} % \item \cs{IfNoValue(TF)} (the need for \cs{IfValue(TF)} is currently -% an item of active discussion)x +% an item of active discussion) % \item \cs{IfBoolean(TF)} %\end{itemize} % with the other functions currently regarded as `experimental'. Please @@ -166,7 +166,7 @@ % \item |#4| = |{Bar}| % \item |#5| = |{default}| %\end{itemize} -% whereas `|[One][Two]{}[three]|' would be parsed as: +% whereas `|[One][Two]{}[Three]|' would be parsed as: %\begin{itemize}[nolistsep] % \item |#1| = |\BooleanFalse| % \item |#2| = |{One}| @@ -175,8 +175,10 @@ % \item |#5| = |{Three}| %\end{itemize} % Note that after parsing the input there will be always exactly the -% same number of brace groups or tokens as the number of letters in the -% argument specifier. +% same number of \meta{balanced text} arguments as the number of letters +% in the argument specifier. The \cs{BooleanTrue} and \cs{BooleanFalse} +% tokens are passed without braces; all other arguments are passed as +% brace groups. % % Two more tokens have a special meaning when creating an argument % specifier. First, \texttt{+} is used to make an argument long (to @@ -324,7 +326,7 @@ % \IfNoValueTF {#1} { % \DoSomethingJustWithMandatoryArgument {#2} % }{ -% \DoSomethingBothArguments {#1} {#2} +% \DoSomethingWithBothArguments {#1} {#2} % } % } % \end{verbatim} @@ -441,6 +443,9 @@ % An error is given if too many \meta{tokens} are present in the % input. The processed input is places inside % \( \text{\meta{number}} + 1 \) sets of braces for further use. +% If there are less than \Arg{number} of \Arg{tokens} in the argument +% then empty brace groups are added at the end of the processed +% argument. % \begin{verbatim} % \DeclareDocumentCommand \foo % { > { \SplitArgument { 2 } { ; } } m } @@ -577,6 +582,10 @@ % the \meta{function} or \meta{environment} has no known argument % specification then an error is issued. %\end{function} +% +%\end{documentation} +% +%\begin{implementation} % %\subsection{Variables and constants} % @@ -954,10 +963,6 @@ % depending on the \cs{long} status of the expandable function. %\end{function} % -%\end{documentation} -% -%\begin{implementation} -% %\section{\pkg{xparse} implementation} % % The usual lead-off: only needed for the package, of course (one day we @@ -1796,7 +1801,7 @@ } #5 \xparse_grab_arg_aux_ii:w ##1 #2 { \tl_if_in:nnTF {##1} {#1} { - \xparse_grab_D_nested:NNNnn #1 #2 {##1} {#4} #5 + \xparse_grab_D_nested:NNnnN #1 #2 {##1} {#4} #5 }{ \xparse_add_arg:n {##1} #4 \l_xparse_args_tl @@ -1815,7 +1820,7 @@ %\end{macro} %\end{macro} %\end{macro} -%\begin{macro}[aux]{\xparse_grab_D_nested:NNnNn} +%\begin{macro}[aux]{\xparse_grab_D_nested:NNnnN} %\begin{macro}{\_l_xparse_nesting_a_tl} %\begin{macro}{\_l_xparse_nesting_b_tl} %\begin{macro}{\q_xparse} @@ -1834,7 +1839,7 @@ \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 { +\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 @@ -1844,6 +1849,7 @@ \tl_if_in:nnTF {##2} {#1} { \xparse_grab_arg:w ##2 \q_xparse } { + \tl_put_right:Nn \_l_xparse_nesting_a_tl {##2} \tl_if_in:NnTF \_l_xparse_nesting_b_tl {#1} { \tl_set_eq:NN \l_xparse_tmp_tl \_l_xparse_nesting_b_tl @@ -1852,7 +1858,6 @@ \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 |