[latex3-commits] [l3svn] r6940 - Revert last commit

noreply at latex-project.org noreply at latex-project.org
Fri Feb 17 13:24:20 CET 2017


Author: bruno
Date: 2017-02-17 13:24:19 +0100 (Fri, 17 Feb 2017)
New Revision: 6940

Modified:
   trunk/l3packages/xparse/xparse.dtx
Log:
Revert last commit


Modified: trunk/l3packages/xparse/xparse.dtx
===================================================================
--- trunk/l3packages/xparse/xparse.dtx	2017-02-17 04:27:24 UTC (rev 6939)
+++ trunk/l3packages/xparse/xparse.dtx	2017-02-17 12:24:19 UTC (rev 6940)
@@ -4331,20 +4331,10 @@
 %   The user macros are pretty simple wrappers around the internal ones.
 %   There is however a check that the first argument is a single token,
 %   possibly surrounded by spaces (hence the strange \cs{use:nnn}), and
-%   is definable.  The only command that is not defined using
-%   \cs{NewDocumentCommand} is \cs{NewDocumentCommand} itself, so we
-%   have to test for its existence (another option would be to use
-%   \cs{cs_new_protected:Npn} but then \cs{NewDocumentCommand} would not
-%   be a document command).
+%   is definable.
 %    \begin{macrocode}
-\cs_if_exist:NT \NewDocumentCommand
+\cs_new_protected:Npn \NewDocumentCommand #1#2#3
   {
-    \__msg_kernel_error:nnxx { xparse } { command-already-defined }
-      { \use:nnn \token_to_str:N \NewDocumentCommand { } }
-      { \token_to_str:N \NewDocumentCommand }
-  }
-\@@_declare_cmd:Nnn \NewDocumentCommand { +m +m +m }
-  {
     \@@_check_definable:nNT {#1} \NewDocumentCommand
       {
         \cs_if_exist:NTF #1
@@ -4356,7 +4346,7 @@
           { \@@_declare_cmd:Nnn #1 {#2} {#3} }
       }
   }
-\NewDocumentCommand { \RenewDocumentCommand } { +m +m +m }
+\cs_new_protected:Npn \RenewDocumentCommand #1#2#3
   {
     \@@_check_definable:nNT {#1} \RenewDocumentCommand
       {
@@ -4369,12 +4359,12 @@
           }
       }
   }
-\NewDocumentCommand { \ProvideDocumentCommand } { +m +m +m }
+\cs_new_protected:Npn \ProvideDocumentCommand #1#2#3
   {
     \@@_check_definable:nNT {#1} \ProvideDocumentCommand
       { \cs_if_exist:NF #1 { \@@_declare_cmd:Nnn #1 {#2} {#3} } }
  }
-\NewDocumentCommand { \DeclareDocumentCommand } { +m +m +m }
+\cs_new_protected:Npn \DeclareDocumentCommand #1#2#3
   {
     \@@_check_definable:nNT {#1} \DeclareDocumentCommand
       { \@@_declare_cmd:Nnn #1 {#2} {#3} }
@@ -4391,21 +4381,21 @@
 % \begin{macro}{\DeclareDocumentEnvironment}
 %   Very similar for environments.
 %    \begin{macrocode}
-\NewDocumentCommand { \NewDocumentEnvironment } { +m +m +m +m }
+\cs_new_protected:Npn \NewDocumentEnvironment #1#2#3#4
   {
     \cs_if_exist:cTF {#1}
       { \__msg_kernel_error:nnx { xparse } { environment-already-defined } {#1} }
       { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
 }
-\NewDocumentCommand { \RenewDocumentEnvironment } { +m +m +m +m }
+\cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4
   {
     \cs_if_exist:cTF {#1}
       { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
       { \__msg_kernel_error:nnx { xparse } { environment-not-yet-defined } {#1} }
   }
-\NewDocumentCommand { \ProvideDocumentEnvironment } { +m +m +m +m }
+\cs_new_protected:Npn \ProvideDocumentEnvironment #1#2#3#4
   { \cs_if_exist:cF {#1} { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } }
-\NewDocumentCommand { \DeclareDocumentEnvironment } { +m +m +m +m }
+\cs_new_protected:Npn \DeclareDocumentEnvironment #1#2#3#4
   { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} }
 %    \end{macrocode}
 % \end{macro}
@@ -4419,7 +4409,7 @@
 % \begin{macro}{\DeclareExpandableDocumentCommand}
 %   The expandable versions are essentially the same as the basic functions.
 %    \begin{macrocode}
-\NewDocumentCommand { \NewExpandableDocumentCommand } { +m +m +m }
+\cs_new_protected:Npn \NewExpandableDocumentCommand #1#2#3
   {
     \@@_check_definable:nNT {#1} \NewExpandableDocumentCommand
       {
@@ -4432,7 +4422,7 @@
           { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} }
       }
   }
-\NewDocumentCommand { \RenewExpandableDocumentCommand } { +m +m +m }
+\cs_new_protected:Npn \RenewExpandableDocumentCommand #1#2#3
   {
     \@@_check_definable:nNT {#1} \RenewExpandableDocumentCommand
       {
@@ -4445,7 +4435,7 @@
           }
       }
   }
-\NewDocumentCommand { \ProvideExpandableDocumentCommand } { +m +m +m }
+\cs_new_protected:Npn \ProvideExpandableDocumentCommand #1#2#3
   {
     \@@_check_definable:nNT {#1} \ProvideExpandableDocumentCommand
       {
@@ -4453,7 +4443,7 @@
           { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} }
       }
  }
-\NewDocumentCommand { \DeclareExpandableDocumentCommand } { +m +m +m }
+\cs_new_protected:Npn \DeclareExpandableDocumentCommand #1#2#3
   {
     \@@_check_definable:nNT {#1} \DeclareExpandableDocumentCommand
       { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} }
@@ -4469,36 +4459,26 @@
 %   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}
-\NewExpandableDocumentCommand { \IfBooleanTF } { +m +m +m }
-  { \bool_if:NTF {#1} {#2} {#3} }
-\NewExpandableDocumentCommand { \IfBooleanT } { +m +m }
-  { \bool_if:NT {#1} {#2} }
-\NewExpandableDocumentCommand { \IfBooleanF } { +m +m }
-  { \bool_if:NF {#1} {#2} }
+\cs_new_eq:NN \IfBooleanTF \bool_if:NTF
+\cs_new_eq:NN \IfBooleanT  \bool_if:NT
+\cs_new_eq:NN \IfBooleanF  \bool_if:NF
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\IfNoValueT, \IfNoValueF, \IfNoValueTF}
 %   Simple re-naming.
 %    \begin{macrocode}
-\NewExpandableDocumentCommand { \IfNoValueF } { +m +m }
-  { \@@_if_no_value:nF {#1} {#2} }
-\NewExpandableDocumentCommand { \IfNoValueT } { +m +m }
-  { \@@_if_no_value:nT {#1} {#2} }
-\NewExpandableDocumentCommand { \IfNoValueTF } { +m +m +m }
-  { \@@_if_no_value:nTF {#1} {#2} {#3} }
+\cs_new_eq:NN \IfNoValueF  \@@_if_no_value:nF
+\cs_new_eq:NN \IfNoValueT  \@@_if_no_value:nT
+\cs_new_eq:NN \IfNoValueTF \@@_if_no_value:nTF
 %    \end{macrocode}
 % \end{macro}
-%
 % \begin{macro}{\IfValueT, \IfValueF, \IfValueTF}
 %   Inverted logic.
 %    \begin{macrocode}
-\NewExpandableDocumentCommand { \IfValueF } { +m +m }
-  { \@@_if_no_value:nT {#1} {#2} }
-\NewExpandableDocumentCommand { \IfValueT } { +m +m }
-  { \@@_if_no_value:nF {#1} {#2} }
-\NewExpandableDocumentCommand { \IfValueTF } { +m +m +m }
-  { \@@_if_no_value:nTF {#1} {#3} {#2} }
+\cs_new:Npn \IfValueF { \@@_if_no_value:nT }
+\cs_new:Npn \IfValueT { \@@_if_no_value:nF }
+\cs_new:Npn \IfValueTF #1#2#3 { \@@_if_no_value:nTF {#1} {#3} {#2} }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -4513,22 +4493,17 @@
 % \begin{macro}{\ReverseBoolean, \SplitArgument, \SplitList, \TrimSpaces}
 %   Simple copies.
 %    \begin{macrocode}
-\NewDocumentCommand { \ReverseBoolean } { +m }
-  { \@@_bool_reverse:N {#1} }
-\NewDocumentCommand { \SplitArgument } { +m +m +m }
-  { \@@_split_argument:nnn {#1} {#2} {#3} }
-\NewDocumentCommand { \SplitList } { +m +m }
-  { \@@_split_list:nn {#1} {#2} }
-\NewDocumentCommand { \TrimSpaces } { +m }
-  { \@@_trim_spaces:n {#1} }
+\cs_new_eq:NN \ReverseBoolean \@@_bool_reverse:N
+\cs_new_eq:NN \SplitArgument  \@@_split_argument:nnn
+\cs_new_eq:NN \SplitList      \@@_split_list:nn
+\cs_new_eq:NN \TrimSpaces     \@@_trim_spaces:n
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\ProcessList}
 %   To support \cs{SplitList}.
 %    \begin{macrocode}
-\NewExpandableDocumentCommand { \ProcessList } { +m +m }
-  { \tl_map_function:nN {#1} {#2} }
+\cs_new_eq:NN \ProcessList \tl_map_function:nN
 %    \end{macrocode}
 % \end{macro}
 %
@@ -4539,20 +4514,18 @@
 %   More simple mappings, with a check that the argument is a single
 %   control sequence or active character.
 %    \begin{macrocode}
-\NewDocumentCommand { \GetDocumentCommandArgSpec } { +m }
+\cs_new_protected:Npn \GetDocumentCommandArgSpec #1
   {
     \@@_check_definable:nNT {#1} \GetDocumentCommandArgSpec
       { \@@_get_arg_spec:N #1 }
   }
-\NewDocumentCommand { \GetDocumentEnvironmentArgSpec } { +m }
-  { \@@_get_arg_spec:n {#1} }
-\NewDocumentCommand { \ShowDocumentCommandArgSpec } { +m }
+\cs_new_eq:NN \GetDocumentEnvironmentArgSpec \@@_get_arg_spec:n
+\cs_new_protected:Npn \ShowDocumentCommandArgSpec #1
   {
     \@@_check_definable:nNT {#1} \ShowDocumentCommandArgSpec
       { \@@_show_arg_spec:N #1 }
   }
-\NewDocumentCommand { \ShowDocumentEnvironmentArgSpec } { +m }
-  { \@@_show_arg_spec:n {#1} }
+\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \@@_show_arg_spec:n
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}



More information about the latex3-commits mailing list