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.dtx65
1 files changed, 31 insertions, 34 deletions
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
index 06a424ba694..733cc3dcff8 100644
--- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
@@ -27,8 +27,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2017/03/11]
-%<package>\@ifpackagelater{expl3}{2017/03/11}
+\RequirePackage{expl3}[2017/03/18]
+%<package>\@ifpackagelater{expl3}{2017/03/18}
%<package> {}
%<package> {%
%<package> \PackageError{xparse}{Support package l3kernel too old}
@@ -40,10 +40,8 @@
%<package> }%
%<package> \endinput
%<package> }
-\def\ExplFileName{xparse}
-\def\ExplFileDescription{L3 Experimental document command parser}
-\def\ExplFileDate{2017/03/11}
-\def\ExplFileVersion{6988}
+\def\ExplFileDate{2017/03/18}
+\def\ExplFileVersion{7019}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
@@ -782,8 +780,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
+\ProvidesExplPackage{xparse}{\ExplFileDate}{\ExplFileVersion}
+ {L3 Experimental document command parser}
% \end{macrocode}
%
% \subsection{Variables and constants}
@@ -844,9 +842,8 @@
%
% \begin{variable}{\l_@@_defaults_bool, \l_@@_defaults_tl}
% The boolean indicates whether there are any argument with default
-% value; the token list holds the code to determine these default
-% values in terms of other arguments, and dummy code for arguments
-% that do not need a default.
+% value other than |-NoValue-|; the token list holds the code to
+% determine these default values in terms of other arguments.
% \begin{macrocode}
\bool_new:N \l_@@_defaults_bool
\tl_new:N \l_@@_defaults_tl
@@ -1380,7 +1377,7 @@
\@@_if_no_value:nTF {#2}
{
\tl_put_right:Nx \l_@@_tmpa_tl
- { { \exp_not:N \exp_not:n { \exp_not:o { \use_none:n #3 } } } }
+ { { \exp_not:N \exp_not:n { \exp_not:o {#3} } } }
}
{
\tl_put_right:Nn \l_@@_tmpa_tl
@@ -1500,7 +1497,7 @@
}
{
\@@_if_no_value:nTF {#2}
- { \exp_args:No \@@_end_expandable_defaults:nw { \use_none:n #1 } }
+ { \exp_args:No \@@_end_expandable_defaults:nw {#1} }
{ \@@_end_expandable_defaults:nw {#2} }
}
}
@@ -2052,7 +2049,7 @@
\bool_set_true:N \l_@@_prefixed_bool
\bool_set_true:N \l_@@_process_some_bool
\int_decr:N \l_@@_current_arg_int
- \tl_put_right:Nn \l_@@_process_one_tl { {#1} }
+ \tl_put_left:Nn \l_@@_process_one_tl { {#1} }
\@@_prepare_signature_bypass:N
}
% \end{macrocode}
@@ -2262,40 +2259,40 @@
% \begin{macro}{\@@_add_default:n, \@@_add_default:, \@@_add_default_E:nn}
% \begin{macro}[aux]{\@@_add_default_E_aux:n}
% Store the default value of an argument, or rather code that gives
-% that default value (it may involve other arguments). Defaults are
-% always stored with a leading |.| except for \texttt{E}-type
-% arguments, to distinguish them. For \texttt{E}-type arguments, pad
-% the defaults |#2| with some |{-NoValue-}| until there are the same
-% numbers as embellishments~|#1|. Then for technical reasons make
-% sure the first default is wrapped in braces. These functions are
-% also used when defining expandable commands.
+% that default value (it may involve other arguments). This is
+% \cs{c_@@_no_value_tl} for arguments with no actual default or with
+% default |-NoValue-|; \cs{prg_do_nothing:} followed by a default
+% value for most others, and a token list of braced arguments for
+% \texttt{E}-type arguments. For \texttt{E}-type arguments, pad the
+% defaults |#2| with some |{-NoValue-}| until there are as many as
+% embellishments~|#1|. These functions are also used when defining
+% expandable commands.
% \begin{macrocode}
\cs_new_protected:Npn \@@_add_default:n #1
{
- \bool_set_true:N \l_@@_defaults_bool
- \tl_put_right:Nn \l_@@_defaults_tl { { . #1} }
+ \@@_if_no_value:nTF {#1}
+ { \@@_add_default: }
+ {
+ \bool_set_true:N \l_@@_defaults_bool
+ \tl_put_right:Nn \l_@@_defaults_tl { { \prg_do_nothing: #1 } }
+ }
}
\cs_new_protected:Npn \@@_add_default:
- { \tl_put_right:Nn \l_@@_defaults_tl { . } }
+ { \tl_put_right:Nn \l_@@_defaults_tl { \c_@@_no_value_tl } }
\cs_new_protected:Npn \@@_add_default_E:nn #1#2
{
\bool_set_true:N \l_@@_defaults_bool
- \tl_set:Nx \l_@@_tmpa_tl
- {
- \exp_not:n {#2}
- \prg_replicate:nn
- { \tl_count:n {#1} - \tl_count:n {#2} }
- { { \c_@@_no_value_tl } }
- }
\tl_put_right:Nx \l_@@_defaults_tl
{
{
- \exp_not:f
- { \exp_after:wN \@@_add_default_E_aux:n \l_@@_tmpa_tl }
+ \tl_map_function:nN {#2} \@@_add_default_E_aux:n
+ \prg_replicate:nn
+ { \tl_count:n {#1} - \tl_count:n {#2} }
+ { { \c_@@_no_value_tl } }
}
}
}
-\cs_new:Npn \@@_add_default_E_aux:n #1 { {#1} }
+\cs_new:Npn \@@_add_default_E_aux:n #1 { \exp_not:n { {#1} } }
% \end{macrocode}
% \end{macro}
% \end{macro}