[latex3-commits] [l3svn] r6850 - Document e/E forbidden in expandable commands, improve error (see #331)

noreply at latex-project.org noreply at latex-project.org
Wed Feb 8 14:28:59 CET 2017


Author: bruno
Date: 2017-02-08 14:28:59 +0100 (Wed, 08 Feb 2017)
New Revision: 6850

Modified:
   trunk/l3packages/xparse/xparse.dtx
Log:
Document e/E forbidden in expandable commands, improve error (see #331)


Modified: trunk/l3packages/xparse/xparse.dtx
===================================================================
--- trunk/l3packages/xparse/xparse.dtx	2017-02-08 04:14:04 UTC (rev 6849)
+++ trunk/l3packages/xparse/xparse.dtx	2017-02-08 13:28:59 UTC (rev 6850)
@@ -184,10 +184,10 @@
 %   \item[e] An optional set of \emph{embellishments}, each of which requires a
 %     \emph{value}. If a key is not present, |-NoValue-| is returned.
 %     The returned data is a token list comprising one braced entry per key,
-%     ordered as for the key list in the signature.
+%     ordered as for the key list in the signature.  Given as \texttt{e}\marg{tokens}.
 %     \emph{This is an experimental type}.
 %   \item[E] As for \texttt{e} but returns one or more \meta{defaults}
-%     if values are not given: \texttt{E}\marg{defaults}. See
+%     if values are not given: \texttt{E}\marg{tokens}\marg{defaults}. See
 %     Section~\ref{sec:embellishment} for more details.
 % \end{itemize}
 %
@@ -683,8 +683,8 @@
 %       to mix short and long argument types.
 %     \item The mandatory argument types \texttt{l} and \texttt{u} are
 %       not available.
-%     \item The \enquote{optional group} argument types \texttt{g} and
-%       \texttt{G} are not available.
+%     \item The optional argument types \texttt{e}, \texttt{E}, \texttt{g}
+%       and \texttt{G} are not available.
 %     \item The \enquote{verbatim} argument type \texttt{v} is not available.
 %     \item Argument processors (using \texttt{>}) are not available.
 %     \item It is not possible to differentiate between, for example
@@ -1943,6 +1943,26 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\@@_add_expandable_type_e:w}
+% \begin{macro}{\@@_add_expandable_type_E:w}
+%   Invalid in an expandable context but it could be implemented.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_add_expandable_type_e:w #1
+  {
+    \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+      { e }
+    \@@_add_expandable_type_m:w
+  }
+\cs_new_protected:Npn \@@_add_expandable_type_E:w #1#2
+  {
+    \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+      { E }
+    \@@_add_expandable_type_m:w
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}{\@@_add_expandable_type_g:w}
 % \begin{macro}{\@@_add_expandable_type_G:w}
 %   These are not allowed at all, so there is a complaint and a fall-back.



More information about the latex3-commits mailing list