[latex3-commits] [git/LaTeX3-latex3-latex3] master: Remove unused integer variable in xparse (849fe75)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Mar 4 14:54:38 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/849fe753703ec3a4782cac667ab400ac9646e266

>---------------------------------------------------------------

commit 849fe753703ec3a4782cac667ab400ac9646e266
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Tue Feb 26 23:56:50 2019 +0100

    Remove unused integer variable in xparse


>---------------------------------------------------------------

849fe753703ec3a4782cac667ab400ac9646e266
 l3packages/xparse/testfiles/xparse000.tlg |    1 -
 l3packages/xparse/xparse.dtx              |   50 ++++++++---------------------
 2 files changed, 13 insertions(+), 38 deletions(-)

diff --git a/l3packages/xparse/testfiles/xparse000.tlg b/l3packages/xparse/testfiles/xparse000.tlg
index 4d4c34c..81f95f3 100644
--- a/l3packages/xparse/testfiles/xparse000.tlg
+++ b/l3packages/xparse/testfiles/xparse000.tlg
@@ -6,6 +6,5 @@ Package: xparse ....-..-.. L3 Experimental document command parser
 \l__xparse_current_arg_int=\count...
 \g__xparse_grabber_int=\count...
 \l__xparse_m_args_int=\count...
-\l__xparse_mandatory_args_int=\count...
 \l__xparse_v_nesting_int=\count...
 )
diff --git a/l3packages/xparse/xparse.dtx b/l3packages/xparse/xparse.dtx
index 754f8be..c5781c9 100644
--- a/l3packages/xparse/xparse.dtx
+++ b/l3packages/xparse/xparse.dtx
@@ -1037,15 +1037,6 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{variable}{\l_@@_mandatory_args_int}
-%   Holds the total number of mandatory arguments for a function, which is
-%   needed to tell whether further mandatory arguments follow an optional
-%   one.
-%    \begin{macrocode}
-\int_new:N \l_@@_mandatory_args_int
-%    \end{macrocode}
-% \end{variable}
-%
 % \begin{variable}{\l_@@_prefixed_bool}
 %   When preparing the signature of non-expandable commands, indicates
 %   that the current argument is affected by a processor or by |+|
@@ -1602,8 +1593,6 @@
 %     commands will be grabbed expandably and arguments of environments
 %     will not (because the list of arguments built by non-expandable
 %     grabbing is used to pass them to the end-environment code).
-%   \item Count mandatory arguments, used later to detect which optional
-%     arguments are trailing.
 % \end{itemize}
 % Further checks happen at the end of the loop:
 % \begin{itemize}
@@ -1622,7 +1611,6 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_normalize_arg_spec:n #1
   {
-    \int_zero:N \l_@@_mandatory_args_int
     \int_zero:N \l_@@_current_arg_int
     \tl_clear:N \l_@@_last_delimiters_tl
     \tl_clear:N \l_@@_arg_spec_tl
@@ -1922,7 +1910,6 @@
         \@@_bad_def:wn
       }
     \quark_if_recursion_tail_stop_do:nn {#1} { \@@_bad_arg_spec:wn }
-    \int_incr:N \l_@@_mandatory_args_int
     \tl_clear:N \l_@@_last_delimiters_tl
     \@@_add_arg_spec:n { b {#1} }
     \quark_if_recursion_tail_stop:n {#2}
@@ -2070,7 +2057,6 @@
           { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} }
         \@@_bad_def:wn
       }
-    \int_incr:N \l_@@_mandatory_args_int
     \tl_clear:N \l_@@_last_delimiters_tl
     \@@_add_arg_spec:n {#1}
   }
@@ -2195,7 +2181,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default:
-    \@@_add_grabber_mandatory:N b
+    \@@_add_grabber:N b
     \tl_put_right:Nn \l_@@_signature_tl { {#1} }
     \@@_prepare_signature:N
   }
@@ -2208,7 +2194,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default:n {#3}
-    \@@_add_grabber_optional:N D
+    \@@_add_grabber:N D
     \tl_put_right:Nn \l_@@_signature_tl { #1 #2 }
     \@@_prepare_signature:N
   }
@@ -2223,7 +2209,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default_E:nn {#1} {#2}
-    \@@_add_grabber_optional:N E
+    \@@_add_grabber:N E
     \tl_put_right:Nn \l_@@_signature_tl { {#1} }
     \@@_prepare_signature:N
   }
@@ -2238,7 +2224,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default:n {#1}
-    \@@_add_grabber_optional:N G
+    \@@_add_grabber:N G
     \@@_prepare_signature:N
   }
 %    \end{macrocode}
@@ -2252,7 +2238,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default:
-    \@@_add_grabber_mandatory:N l
+    \@@_add_grabber:N l
     \@@_prepare_signature:N
   }
 %    \end{macrocode}
@@ -2270,7 +2256,7 @@
   {
     \@@_add_default:
     \bool_if:NTF \l_@@_prefixed_bool
-      { \@@_add_grabber_mandatory:N m }
+      { \@@_add_grabber:N m }
       { \int_incr:N \l_@@_m_args_int }
     \@@_prepare_signature:N
   }
@@ -2284,7 +2270,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default:n {#3}
-    \@@_add_grabber_mandatory:N R
+    \@@_add_grabber:N R
     \tl_put_right:Nn \l_@@_signature_tl { #1 #2 }
     \@@_prepare_signature:N
   }
@@ -2299,7 +2285,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default:
-    \@@_add_grabber_optional:N t
+    \@@_add_grabber:N t
     \tl_put_right:Nn \l_@@_signature_tl {#1}
     \@@_prepare_signature:N
   }
@@ -2314,7 +2300,7 @@
   {
     \@@_flush_m_args:
     \@@_add_default:
-    \@@_add_grabber_mandatory:N u
+    \@@_add_grabber:N u
     \tl_put_right:Nn \l_@@_signature_tl { {#1} }
     \@@_prepare_signature:N
   }
@@ -2330,7 +2316,7 @@
   {
     \@@_flush_m_args:
     \exp_args:No \@@_add_default:n \c_novalue_tl
-    \@@_add_grabber_mandatory:N v
+    \@@_add_grabber:N v
     \@@_prepare_signature:N
   }
 %    \end{macrocode}
@@ -2340,9 +2326,7 @@
 %   As \texttt{m} arguments are simply counted, there is a need to add
 %   them to the token register in a block. As this function can only
 %   be called if something other than \texttt{m} turns up, the flag can
-%   be switched here. The total number of mandatory arguments which
-%   remain to be added to
-%   the signature is also decreased by the appropriate amount.
+%   be switched here.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_flush_m_args:
   {
@@ -2350,7 +2334,6 @@
       {
         \tl_put_right:Nx \l_@@_signature_tl
           { \exp_not:c { @@_grab_m_ \int_use:N \l_@@_m_args_int :w } }
-        \int_sub:Nn \l_@@_mandatory_args_int { \l_@@_m_args_int }
         \tl_put_right:Nx \l_@@_process_all_tl
           { \prg_replicate:nn { \l_@@_m_args_int } { { } } }
       }
@@ -2359,8 +2342,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_add_grabber_mandatory:N}
-% \begin{macro}{\@@_add_grabber_optional:N}
+% \begin{macro}{\@@_add_grabber:N}
 %   To keep the various checks needed in one place, adding the grabber
 %   to the signature is done here.  The only questions are whether the
 %   grabber should be long or not, and whether to obey spaces.  The
@@ -2368,12 +2350,7 @@
 %   trailing optional arguments.  In that case spaces will not be
 %   ignored when looking for that optional argument.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_add_grabber_mandatory:N #1
-  {
-    \@@_add_grabber_optional:N #1
-    \int_decr:N \l_@@_mandatory_args_int
-  }
-\cs_new_protected:Npn \@@_add_grabber_optional:N #1
+\cs_new_protected:Npn \@@_add_grabber:N #1
   {
     \tl_put_right:Nx \l_@@_signature_tl
       {
@@ -2393,7 +2370,6 @@
   }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\@@_add_default:n, \@@_add_default:, \@@_add_default_E:nn}
 %   Store the default value of an argument, or rather code that gives





More information about the latex3-commits mailing list