[latex3-commits] [l3svn] r6313 - Remove unused code, fix minor things

noreply at latex-project.org noreply at latex-project.org
Sun Nov 22 18:26:31 CET 2015


Author: bruno
Date: 2015-11-22 18:26:31 +0100 (Sun, 22 Nov 2015)
New Revision: 6313

Modified:
   trunk/l3packages/xparse/xparse.dtx
Log:
Remove unused code, fix minor things

- Some \cs_set to \cs_new.
- Instead of having an argument common to two branches
of a conditional outside it, put it in both branches, since
that's the style elsewhere in xparse.
- Fix one EXP->rEXP


Modified: trunk/l3packages/xparse/xparse.dtx
===================================================================
--- trunk/l3packages/xparse/xparse.dtx	2015-11-22 17:11:59 UTC (rev 6312)
+++ trunk/l3packages/xparse/xparse.dtx	2015-11-22 17:26:31 UTC (rev 6313)
@@ -3041,14 +3041,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_process_to_str:n}
-%   A basic argument processor: as much an example as anything else.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_process_to_str:n #1
-  { \tl_set:Nx \ProcessedArgument { \tl_to_str:n {#1} } }
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{macro}{\@@_bool_reverse:N}
 %   A simple reversal.
 %    \begin{macrocode}
@@ -3081,7 +3073,7 @@
       }
       { \@@_split_list_multi:nn {#1} {#2} }
   }
-\cs_set_protected:Npn \@@_split_list_multi:nn #1#2
+\cs_new_protected:Npn \@@_split_list_multi:nn #1#2
   {
     \seq_set_split:Nnn \l_@@_split_list_seq {#1} {#2}
     \tl_clear:N \ProcessedArgument
@@ -3113,7 +3105,7 @@
 % \begin{macro}{\@@_split_argument:nnn}
 % \begin{macro}[aux]{\@@_split_argument_aux:nnnn}
 % \begin{macro}[aux, EXP]{\@@_split_argument_aux:n}
-% \begin{macro}[aux, EXP]{\@@_split_argument_aux:wn}
+% \begin{macro}[aux, rEXP]{\@@_split_argument_aux:wn}
 %   Splitting to a known number of items is a special version of splitting
 %   a list, in which the limit is hard-coded and where there will always be
 %   exactly the correct number of output items. An auxiliary function is
@@ -3189,23 +3181,33 @@
 \cs_new_protected:Npn \@@_get_arg_spec_error:N #1
   {
     \cs_if_exist:NTF #1
-      { \__msg_kernel_error:nnx { xparse } { non-xparse-command } }
-      { \__msg_kernel_error:nnx { xparse } { unknown-command } }
+      {
+        \__msg_kernel_error:nnx { xparse } { non-xparse-command }
           { \token_to_str:N #1 }
+      }
+      {
+        \__msg_kernel_error:nnx { xparse } { unknown-command }
+          { \token_to_str:N #1 }
+      }
   }
 \cs_new_protected:Npn \@@_get_arg_spec_error:n #1
   {
     \cs_if_exist:cTF {#1}
-      { \__msg_kernel_error:nnx { xparse } { non-xparse-environment } }
-      { \__msg_kernel_error:nnx { xparse } { unknown-environment } }
+      {
+        \__msg_kernel_error:nnx { xparse } { non-xparse-environment }
           { \tl_to_str:n {#1} }
+      }
+      {
+        \__msg_kernel_error:nnx { xparse } { unknown-environment }
+          { \tl_to_str:n {#1} }
+      }
   }
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@@_get_arg_spec:N}
 % \begin{macro}{\@@_get_arg_spec:n}
-% \begin{macro}{\ArgumentSpecification}
+% \begin{variable}{\ArgumentSpecification}
 %   Recovering the argument specification is trivial, using the
 %   branching \cs{prop_get:NnN} function.
 %    \begin{macrocode}
@@ -3223,9 +3225,9 @@
   }
 \tl_new:N \ArgumentSpecification
 %    \end{macrocode}
+% \end{variable}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\@@_show_arg_spec:N}
 % \begin{macro}{\@@_show_arg_spec:n}
@@ -3254,8 +3256,8 @@
 %
 % \begin{macro}[TF]{\@@_if_no_value:n}
 %   Tests for |-NoValue-|: this is similar to \cs{tl_if_in:nn} but set
-%   up to be expandable.  The question mark prevents the auxiliary from
-%   losing braces.
+%   up to be expandable and to check the value exactly.  The question
+%   mark prevents the auxiliary from losing braces.
 %    \begin{macrocode}
 \use:x
   {
@@ -3362,12 +3364,6 @@
     with~an~environment~that~already~has~a~definition. \\
     The~existing~definition~of~'#1'~will~be~overwritten.
   }
-\__msg_kernel_new:nnnn { xparse } { environment-mismatch }
-  { Mismatch~between~start~and~end~of~environment. }
-  {
-    The~current~environment~is~called~'#1',~but~you~have~tried~to~
-    end~one~called~'#2'.~Environments~have~to~be~properly~nested.
-  }
 \__msg_kernel_new:nnnn { xparse } { environment-not-yet-defined }
   { Environment~'#1'~not~yet~defined! }
   {
@@ -3652,9 +3648,9 @@
 % \begin{macro}[TF]{\IfValue}
 %   Inverted logic.
 %    \begin{macrocode}
-\cs_set:Npn \IfValueF { \@@_if_no_value:nT }
-\cs_set:Npn \IfValueT { \@@_if_no_value:nF }
-\cs_set:Npn \IfValueTF #1#2#3 { \@@_if_no_value:nTF {#1} {#3} {#2} }
+\cs_new_nopar:Npn \IfValueF { \@@_if_no_value:nT }
+\cs_new_nopar:Npn \IfValueT { \@@_if_no_value:nF }
+\cs_new:Npn \IfValueTF #1#2#3 { \@@_if_no_value:nTF {#1} {#3} {#2} }
 %    \end{macrocode}
 % \end{macro}
 %



More information about the latex3-commits mailing list