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.dtx35
1 files changed, 26 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
index 7dfc3d4d0eb..1cf07be68d5 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/12/05]
-%<package>\@ifpackagelater{expl3}{2017/12/05}
+\RequirePackage{expl3}[2017/12/16]
+%<package>\@ifpackagelater{expl3}{2017/12/16}
%<package> {}
%<package> {%
%<package> \PackageError{xparse}{Support package l3kernel too old}
@@ -67,7 +67,7 @@
% }^^A
% }
%
-% \date{Released 2017/12/05}
+% \date{Released 2017/12/16}
%
% \maketitle
%
@@ -520,14 +520,14 @@
%
% \begin{function}[EXP]{\IfBooleanT, \IfBooleanF, \IfBooleanTF}
% \begin{syntax}
-% \cs{IfBooleanTF} \meta{argument} \Arg{true code} \Arg{false code}
+% \cs{IfBooleanTF} \Arg{argument} \Arg{true code} \Arg{false code}
% \end{syntax}
% Used to test if \meta{argument} (|#1|, |#2|, \emph{etc.}) is
% \cs{BooleanTrue} or \cs{BooleanFalse}. For example
% \begin{verbatim}
% \NewDocumentCommand \foo { s m }
% {
-% \IfBooleanTF #1
+% \IfBooleanTF {#1}
% { \DoSomethingWithStar {#2} }
% { \DoSomethingWithoutStar {#2} }
% }
@@ -776,7 +776,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xparse}{2017/12/05}{}
+\ProvidesExplPackage{xparse}{2017/12/16}{}
{L3 Experimental document command parser}
% \end{macrocode}
%
@@ -4042,6 +4042,13 @@
(or~no~arguments~at~all).~You~cannot~have~a~terminal~optional~
argument~with~expandable~commands.
}
+\__msg_kernel_new:nnnn { xparse } { if-boolean }
+ { Invalid~use~\iow_char:N\\IfBooleanTF~{#1} }
+ {
+ \c__msg_coding_error_text_tl
+ The~first~argument~of~\iow_char:N\\IfBoolean(TF/T/F)~must~be~
+ a~boolean~argument~obtained~from~parsing~'s'~or~'t'~arguments.
+ }
\__msg_kernel_new:nnnn { xparse } { inconsistent-long }
{ Inconsistent~long~arguments~for~expandable~command~'#1'. }
{
@@ -4377,9 +4384,19 @@
% normal \cs{c_true_bool} and \cs{c_false_bool}, so testing for them is
% done with the \cs{bool_if:NTF} functions from \textsf{l3prg}.
% \begin{macrocode}
-\cs_new_eq:NN \IfBooleanTF \bool_if:NTF
-\cs_new_eq:NN \IfBooleanT \bool_if:NT
-\cs_new_eq:NN \IfBooleanF \bool_if:NF
+\cs_new:Npn \IfBooleanTF #1
+ {
+ \bool_lazy_and:nnTF
+ { \tl_if_single_p:n {#1} }
+ { \tl_if_single_token_p:n #1 }
+ { \bool_if:NTF #1 }
+ {
+ \__msg_kernel_error:nnn { xparse } { if-boolean } {#1}
+ \use_ii:nn
+ }
+ }
+\cs_new:Npn \IfBooleanT #1#2 { \IfBooleanTF {#1} {#2} { } }
+\cs_new:Npn \IfBooleanF #1 { \IfBooleanTF {#1} { } }
% \end{macrocode}
% \end{macro}
%