]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Remove extraneous optimization of extract_all.
authorBruno Haible <bruno@clisp.org>
Thu, 9 Oct 2003 10:04:26 +0000 (10:04 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:03 +0000 (12:11 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/x-awk.c
gettext-tools/src/x-c.c
gettext-tools/src/x-elisp.c
gettext-tools/src/x-librep.c
gettext-tools/src/x-lisp.c
gettext-tools/src/x-perl.c
gettext-tools/src/x-php.c
gettext-tools/src/x-python.c
gettext-tools/src/x-sh.c

index c7bf9a60e721b4c3fff14e74ac74384e7da80792..2217514ec65fbedfc0061f2ae052c05bf80a07db 100644 (file)
@@ -1,3 +1,16 @@
+2003-09-23  Bruno Haible  <bruno@clisp.org>
+
+       * x-awk.c (extract_parenthesized): Remove optimization of the
+       extract_all case.
+       * x-c.c (extract_parenthesized): Likewise.
+       * x-elisp.c (read_object): Likewise.
+       * x-librep.c (read_object): Likewise.
+       * x-lisp.c (read_object): Likewise.
+       * x-perl.c (x_perl_prelex, extract_balanced): Likewise.
+       * x-php.c (extract_parenthesized): Likewise.
+       * x-python.c (extract_parenthesized): Likewise.
+       * x-sh.c (read_command): Likewise.
+
 2003-10-08  Bruno Haible  <bruno@clisp.org>
 
        * msgmerge.c (main): Make option -N work.
index 40d1194eab6d61673fa8250e53f37fdabc5d469c..5d5dfefa419fc586c2d2fe4733eae67821ffa885 100644 (file)
@@ -689,32 +689,27 @@ extract_parenthesized (message_list_ty *mlp,
       switch (token.type)
        {
        case token_type_symbol:
-         /* No need to bother if we extract all strings anyway.  */
-         if (!extract_all)
-           {
-             void *keyword_value;
+         {
+           void *keyword_value;
 
-             if (find_entry (&keywords, token.string, strlen (token.string),
-                             &keyword_value)
-                 == 0)
-               {
-                 int argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
-                 int argnum2 = (int) (long) keyword_value >> 10;
+           if (find_entry (&keywords, token.string, strlen (token.string),
+                           &keyword_value)
+               == 0)
+             {
+               int argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
+               int argnum2 = (int) (long) keyword_value >> 10;
 
-                 next_commas_to_skip = argnum1 - 1;
-                 next_plural_commas = (argnum2 > argnum1 ? argnum2 - argnum1 : 0);
-                 state = 1;
-               }
-             else
-               state = 0;
-           }
+               next_commas_to_skip = argnum1 - 1;
+               next_plural_commas = (argnum2 > argnum1 ? argnum2 - argnum1 : 0);
+               state = 1;
+             }
+           else
+             state = 0;
+         }
          free (token.string);
          continue;
 
        case token_type_lparen:
-         /* No need to recurse if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (state
              ? extract_parenthesized (mlp, next_commas_to_skip,
                                       next_plural_commas)
@@ -724,15 +719,9 @@ extract_parenthesized (message_list_ty *mlp,
          continue;
 
        case token_type_rparen:
-         /* No need to return if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          return false;
 
        case token_type_comma:
-         /* No need to bother if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (commas_to_skip >= 0)
            {
              if (commas_to_skip > 0)
@@ -779,10 +768,10 @@ extract_parenthesized (message_list_ty *mlp,
                  }
                else
                  free (token.string);
-               state = 0;
              }
-           continue;
          }
+         state = 0;
+         continue;
 
        case token_type_i18nstring:
          {
index 05797fb51bd7ee58e379e55ab6da765a0e2cece3..cb0d548d9163a3b4d9f98671955b8ec5a9bd2eea 100644 (file)
@@ -1373,9 +1373,6 @@ extract_parenthesized (message_list_ty *mlp,
       switch (token.type)
        {
        case xgettext_token_type_keyword:
-         /* No need to bother if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          next_commas_to_skip = token.argnum1 - 1;
          next_plural_commas = (token.argnum2 > token.argnum1
                                ? token.argnum2 - token.argnum1 : 0);
@@ -1383,9 +1380,6 @@ extract_parenthesized (message_list_ty *mlp,
          continue;
 
        case xgettext_token_type_lparen:
-         /* No need to recurse if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (state
              ? extract_parenthesized (mlp, next_commas_to_skip,
                                       next_plural_commas)
@@ -1395,15 +1389,9 @@ extract_parenthesized (message_list_ty *mlp,
          continue;
 
        case xgettext_token_type_rparen:
-         /* No need to return if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          return false;
 
        case xgettext_token_type_comma:
-         /* No need to bother if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (commas_to_skip >= 0)
            {
              if (commas_to_skip > 0)
@@ -1445,8 +1433,8 @@ extract_parenthesized (message_list_ty *mlp,
                }
              else
                free (token.string);
-             state = 0;
            }
+         state = 0;
          continue;
 
        case xgettext_token_type_symbol:
index 9c0fb9403e92d62baa40c37ab2c9ebc4736a3d56..7bd7b3e10a0410af21b7274b808744cf80d8ced6 100644 (file)
@@ -660,58 +660,54 @@ read_object (struct object *op, bool first_in_list, bool new_backquote_flag)
                if (inner.type == t_eof)
                  break;
 
-               /* No need to bother if we extract all strings anyway.  */
-               if (!extract_all)
+               if (arg == 0)
                  {
-                   if (arg == 0)
+                   /* This is the function position.  */
+                   if (inner.type == t_symbol)
                      {
-                       /* This is the function position.  */
-                       if (inner.type == t_symbol)
+                       char *symbol_name = string_of_object (&inner);
+                       void *keyword_value;
+
+                       if (find_entry (&keywords,
+                                       symbol_name, strlen (symbol_name),
+                                       &keyword_value)
+                           == 0)
                          {
-                           char *symbol_name = string_of_object (&inner);
-                           void *keyword_value;
-
-                           if (find_entry (&keywords,
-                                           symbol_name, strlen (symbol_name),
-                                           &keyword_value)
-                               == 0)
-                             {
-                               argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
-                               argnum2 = (int) (long) keyword_value >> 10;
-                             }
-
-                           free (symbol_name);
+                           argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
+                           argnum2 = (int) (long) keyword_value >> 10;
                          }
+
+                       free (symbol_name);
                      }
-                   else
+                 }
+               else
+                 {
+                   /* These are the argument positions.
+                      Extract a string if we have reached the right
+                      argument position.  */
+                   if (arg == argnum1)
                      {
-                       /* These are the argument positions.
-                          Extract a string if we have reached the right
-                          argument position.  */
-                       if (arg == argnum1)
+                       if (inner.type == t_string)
                          {
-                           if (inner.type == t_string)
-                             {
-                               lex_pos_ty pos;
-                               message_ty *mp;
-
-                               pos.file_name = logical_file_name;
-                               pos.line_number = inner.line_number_at_start;
-                               mp = remember_a_message (mlp, string_of_object (&inner), &pos);
-                               if (argnum2 > 0)
-                                 plural_mp = mp;
-                             }
+                           lex_pos_ty pos;
+                           message_ty *mp;
+
+                           pos.file_name = logical_file_name;
+                           pos.line_number = inner.line_number_at_start;
+                           mp = remember_a_message (mlp, string_of_object (&inner), &pos);
+                           if (argnum2 > 0)
+                             plural_mp = mp;
                          }
-                       else if (arg == argnum2)
+                     }
+                   else if (arg == argnum2)
+                     {
+                       if (inner.type == t_string && plural_mp != NULL)
                          {
-                           if (inner.type == t_string && plural_mp != NULL)
-                             {
-                               lex_pos_ty pos;
-
-                               pos.file_name = logical_file_name;
-                               pos.line_number = inner.line_number_at_start;
-                               remember_a_message_plural (plural_mp, string_of_object (&inner), &pos);
-                             }
+                           lex_pos_ty pos;
+
+                           pos.file_name = logical_file_name;
+                           pos.line_number = inner.line_number_at_start;
+                           remember_a_message_plural (plural_mp, string_of_object (&inner), &pos);
                          }
                      }
                  }
index 82d5bf28ecaf5b611f954e0e2c69bf78b2347503..036c3686f11a0e1b5758ec18347e3ab9929c0138 100644 (file)
@@ -636,58 +636,54 @@ read_object (struct object *op)
                if (inner.type == t_eof)
                  break;
 
-               /* No need to bother if we extract all strings anyway.  */
-               if (!extract_all)
+               if (arg == 0)
                  {
-                   if (arg == 0)
+                   /* This is the function position.  */
+                   if (inner.type == t_symbol)
                      {
-                       /* This is the function position.  */
-                       if (inner.type == t_symbol)
-                         {
-                           char *symbol_name = string_of_object (&inner);
-                           void *keyword_value;
-
-                           if (find_entry (&keywords,
-                                           symbol_name, strlen (symbol_name),
-                                           &keyword_value)
-                               == 0)
-                             {
-                               argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
-                               argnum2 = (int) (long) keyword_value >> 10;
-                             }
+                       char *symbol_name = string_of_object (&inner);
+                       void *keyword_value;
 
-                           free (symbol_name);
+                       if (find_entry (&keywords,
+                                       symbol_name, strlen (symbol_name),
+                                       &keyword_value)
+                           == 0)
+                         {
+                           argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
+                           argnum2 = (int) (long) keyword_value >> 10;
                          }
+
+                       free (symbol_name);
                      }
-                   else
+                 }
+               else
+                 {
+                   /* These are the argument positions.
+                      Extract a string if we have reached the right
+                      argument position.  */
+                   if (arg == argnum1)
                      {
-                       /* These are the argument positions.
-                          Extract a string if we have reached the right
-                          argument position.  */
-                       if (arg == argnum1)
+                       if (inner.type == t_string)
                          {
-                           if (inner.type == t_string)
-                             {
-                               lex_pos_ty pos;
-                               message_ty *mp;
-
-                               pos.file_name = logical_file_name;
-                               pos.line_number = inner.line_number_at_start;
-                               mp = remember_a_message (mlp, string_of_object (&inner), &pos);
-                               if (argnum2 > 0)
-                                 plural_mp = mp;
-                             }
+                           lex_pos_ty pos;
+                           message_ty *mp;
+
+                           pos.file_name = logical_file_name;
+                           pos.line_number = inner.line_number_at_start;
+                           mp = remember_a_message (mlp, string_of_object (&inner), &pos);
+                           if (argnum2 > 0)
+                             plural_mp = mp;
                          }
-                       else if (arg == argnum2)
+                     }
+                   else if (arg == argnum2)
+                     {
+                       if (inner.type == t_string && plural_mp != NULL)
                          {
-                           if (inner.type == t_string && plural_mp != NULL)
-                             {
-                               lex_pos_ty pos;
+                           lex_pos_ty pos;
 
-                               pos.file_name = logical_file_name;
-                               pos.line_number = inner.line_number_at_start;
-                               remember_a_message_plural (plural_mp, string_of_object (&inner), &pos);
-                             }
+                           pos.file_name = logical_file_name;
+                           pos.line_number = inner.line_number_at_start;
+                           remember_a_message_plural (plural_mp, string_of_object (&inner), &pos);
                          }
                      }
                  }
index 4828b8ef06e4092dd53f76c54849bce275146b28..14cf7db463bfeee9a7e1f9e74c43d474ccd43d28 100644 (file)
@@ -1025,68 +1025,64 @@ read_object (struct object *op)
                    if (inner.type == t_eof)
                      break;
 
-                   /* No need to bother if we extract all strings anyway.  */
-                   if (!extract_all)
+                   if (arg == 0)
                      {
-                       if (arg == 0)
+                       /* This is the function position.  */
+                       if (inner.type == t_symbol)
                          {
-                           /* This is the function position.  */
-                           if (inner.type == t_symbol)
+                           char *symbol_name = string_of_object (&inner);
+                           int i;
+                           int prefix_len;
+                           void *keyword_value;
+
+                           /* Omit any package name.  */
+                           i = inner.token->charcount;
+                           while (i > 0
+                                  && inner.token->chars[i-1].attribute != a_pack_m)
+                             i--;
+                           prefix_len = i;
+
+                           if (find_entry (&keywords,
+                                           symbol_name + prefix_len,
+                                           strlen (symbol_name + prefix_len),
+                                           &keyword_value)
+                               == 0)
                              {
-                               char *symbol_name = string_of_object (&inner);
-                               int i;
-                               int prefix_len;
-                               void *keyword_value;
-
-                               /* Omit any package name.  */
-                               i = inner.token->charcount;
-                               while (i > 0
-                                      && inner.token->chars[i-1].attribute != a_pack_m)
-                                 i--;
-                               prefix_len = i;
-
-                               if (find_entry (&keywords,
-                                               symbol_name + prefix_len,
-                                               strlen (symbol_name + prefix_len),
-                                               &keyword_value)
-                                   == 0)
-                                 {
-                                   argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
-                                   argnum2 = (int) (long) keyword_value >> 10;
-                                 }
-
-                               free (symbol_name);
+                               argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
+                               argnum2 = (int) (long) keyword_value >> 10;
                              }
+
+                           free (symbol_name);
                          }
-                       else
+                     }
+                   else
+                     {
+                       /* These are the argument positions.
+                          Extract a string if we have reached the right
+                          argument position.  */
+                       if (arg == argnum1)
                          {
-                           /* These are the argument positions.
-                              Extract a string if we have reached the right
-                              argument position.  */
-                           if (arg == argnum1)
+                           if (inner.type == t_string)
                              {
-                               if (inner.type == t_string)
-                                 {
-                                   lex_pos_ty pos;
-                                   message_ty *mp;
-
-                                   pos.file_name = logical_file_name;
-                                   pos.line_number = inner.line_number_at_start;
-                                   mp = remember_a_message (mlp, string_of_object (&inner), &pos);
-                                   if (argnum2 > 0)
-                                     plural_mp = mp;
-                                 }
+                               lex_pos_ty pos;
+                               message_ty *mp;
+
+                               pos.file_name = logical_file_name;
+                               pos.line_number = inner.line_number_at_start;
+                               mp = remember_a_message (mlp, string_of_object (&inner), &pos);
+                               if (argnum2 > 0)
+                                 plural_mp = mp;
                              }
-                           else if (arg == argnum2)
+                         }
+                       else if (arg == argnum2)
+                         {
+                           if (inner.type == t_string && plural_mp != NULL)
                              {
-                               if (inner.type == t_string && plural_mp != NULL)
-                                 {
-                                   lex_pos_ty pos;
-
-                                   pos.file_name = logical_file_name;
-                                   pos.line_number = inner.line_number_at_start;
-                                   remember_a_message_plural (plural_mp, string_of_object (&inner), &pos);
-                                 }
+                               lex_pos_ty pos;
+
+                               pos.file_name = logical_file_name;
+                               pos.line_number = inner.line_number_at_start;
+                               remember_a_message_plural (plural_mp, string_of_object (&inner), &pos);
                              }
                          }
                      }
index 4af37e5d42c682568dd59b4bca2c9a566d949e02..03a8b1cfe778b9c267b063fe253488b760f4ab43 100644 (file)
@@ -2024,8 +2024,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
                  return;
                }
              extract_triple_quotelike (mlp, tp, delim,
-                                       buffer[0] == 's' && !extract_all
-                                       && delim != '\'');
+                                       buffer[0] == 's' && delim != '\'');
 
              /* Eat the following modifiers.  */
              do
@@ -2059,7 +2058,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
                  return;
                }
              extract_quotelike (tp, delim);
-             if (!extract_all && delim != '\'')
+             if (delim != '\'')
                interpolate_keywords (mlp, tp->string, line_number);
              free (tp->string);
              tp->type = token_type_regex_op;
@@ -2116,8 +2115,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
                case 'x':
                  tp->type = token_type_string;
                  tp->sub_type = string_type_qq;
-                 if (!extract_all)
-                   interpolate_keywords (mlp, tp->string, line_number);
+                 interpolate_keywords (mlp, tp->string, line_number);
                  break;
                case 'r':
                  tp->type = token_type_regex_op;
@@ -2151,16 +2149,14 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
          prefer_division_over_regexp = true;
          extract_quotelike (tp, c);
          tp->sub_type = string_type_qq;
-         if (!extract_all)
-           interpolate_keywords (mlp, tp->string, line_number);
+         interpolate_keywords (mlp, tp->string, line_number);
          return;
 
        case '`':
          prefer_division_over_regexp = true;
          extract_quotelike (tp, c);
          tp->sub_type = string_type_qq;
-         if (!extract_all)
-           interpolate_keywords (mlp, tp->string, line_number);
+         interpolate_keywords (mlp, tp->string, line_number);
          return;
 
        case '\'':
@@ -2274,8 +2270,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
                  tp->type = token_type_string;
                  tp->sub_type = string_type_qq;
                  tp->line_number = line_number + 1;
-                 if (!extract_all)
-                   interpolate_keywords (mlp, tp->string, line_number + 1);
+                 interpolate_keywords (mlp, tp->string, line_number + 1);
                  return;
                }
              else if ((c >= 'A' && c <= 'Z')
@@ -2316,8 +2311,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
                      tp->type = token_type_string;
                      tp->sub_type = string_type_qq;
                      tp->line_number = line_number + 1;
-                     if (!extract_all)
-                       interpolate_keywords (mlp, tp->string, line_number + 1);
+                     interpolate_keywords (mlp, tp->string, line_number + 1);
                      return;
                    }
                }
@@ -2352,8 +2346,7 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
          if (!prefer_division_over_regexp)
            {
              extract_quotelike (tp, c);
-             if (!extract_all)
-               interpolate_keywords (mlp, tp->string, line_number);
+             interpolate_keywords (mlp, tp->string, line_number);
              free (tp->string);
              tp->type = token_type_other;
              prefer_division_over_regexp = true;
@@ -2731,23 +2724,21 @@ extract_balanced (message_list_ty *mlp, int arg_sg, int arg_pl, int state,
                   tp->string);
 #endif
 
-         /* No need to bother if we extract all strings anyway.  */
-         if (!extract_all)
-           {
-             void *keyword_value;
+         {
+           void *keyword_value;
 
-             if (find_entry (&keywords, tp->string, strlen (tp->string),
-                             &keyword_value) == 0)
-               {
-                 last_token = token_type_keyword_symbol;
+           if (find_entry (&keywords, tp->string, strlen (tp->string),
+                           &keyword_value) == 0)
+             {
+               last_token = token_type_keyword_symbol;
 
-                 arg_sg = (int) (long) keyword_value & ((1 << 10) - 1);
-                 arg_pl = (int) (long) keyword_value >> 10;
-                 arg_count = 1;
+               arg_sg = (int) (long) keyword_value & ((1 << 10) - 1);
+               arg_pl = (int) (long) keyword_value >> 10;
+               arg_count = 1;
 
-                 state = 2;
-               }
-           }
+               state = 2;
+             }
+         }
          break;
 
        case token_type_variable:
@@ -2765,21 +2756,15 @@ extract_balanced (message_list_ty *mlp, int arg_sg, int arg_pl, int state,
 #endif
          ++paren_seen;
 
-         /* No need to recurse if we extract all strings anyway.  */
-         if (extract_all)
-           ;
-         else
+         if (extract_balanced (mlp, arg_sg - arg_count + 1,
+                               arg_pl - arg_count + 1, state,
+                               token_type_rparen))
            {
-             if (extract_balanced (mlp, arg_sg - arg_count + 1,
-                                   arg_pl - arg_count + 1, state,
-                                   token_type_rparen))
-               {
-                 free_token (tp);
-                 return true;
-               }
-             if (my_last_token == token_type_keyword_symbol)
-               arg_sg = arg_pl = -1;
+             free_token (tp);
+             return true;
            }
+         if (my_last_token == token_type_keyword_symbol)
+           arg_sg = arg_pl = -1;
          break;
 
        case token_type_rparen:
@@ -2788,11 +2773,6 @@ extract_balanced (message_list_ty *mlp, int arg_sg, int arg_pl, int state,
                   logical_file_name, tp->line_number, nesting_level);
 #endif
          --paren_seen;
-
-         /* No need to return if we extract all strings anyway.  */
-         if (extract_all)
-           ;
-
          break;
 
        case token_type_comma:
@@ -2801,25 +2781,18 @@ extract_balanced (message_list_ty *mlp, int arg_sg, int arg_pl, int state,
          fprintf (stderr, "%s:%d: type comma (%d)\n",
                   logical_file_name, tp->line_number, nesting_level);
 #endif
-         /* No need to bother if we extract all strings anyway.  */
-         if (extract_all)
-           ;
-         else
+         ++arg_count;
+         if (arg_count > arg_sg && arg_count > arg_pl)
            {
-             ++arg_count;
-
-             if (arg_count > arg_sg && arg_count > arg_pl)
-               {
-                 /* We have missed the argument.  */
-                 arg_sg = arg_pl = -1;
-                 arg_count = 0;
-               }
+             /* We have missed the argument.  */
+             arg_sg = arg_pl = -1;
+             arg_count = 0;
+           }
 #if DEBUG_PERL
-             fprintf (stderr, "%s:%d: arg_count: %d, arg_sg: %d, arg_pl: %d\n",
-                      real_file_name, tp->line_number,
-                      arg_count, arg_sg, arg_pl);
+          fprintf (stderr, "%s:%d: arg_count: %d, arg_sg: %d, arg_pl: %d\n",
+                   real_file_name, tp->line_number,
+                   arg_count, arg_sg, arg_pl);
 #endif
-           }
          break;
 
        case token_type_string:
@@ -2895,16 +2868,10 @@ extract_balanced (message_list_ty *mlp, int arg_sg, int arg_pl, int state,
          fprintf (stderr, "%s:%d: type lbrace (%d)\n",
                   logical_file_name, tp->line_number, nesting_level);
 #endif
-         /* No need to recurse if we extract all strings anyway.  */
-         if (extract_all)
-           ;
-         else
+         if (extract_balanced (mlp, -1, -1, 0, token_type_rbrace))
            {
-             if (extract_balanced (mlp, -1, -1, 0, token_type_rbrace))
-               {
-                 free_token (tp);
-                 return true;
-               }
+             free_token (tp);
+             return true;
            }
          break;
 
@@ -2921,16 +2888,10 @@ extract_balanced (message_list_ty *mlp, int arg_sg, int arg_pl, int state,
          fprintf (stderr, "%s:%d: type lbracket (%d)\n",
                   logical_file_name, tp->line_number, nesting_level);
 #endif
-         /* No need to recurse if we extract all strings anyway.  */
-         if (extract_all)
-           ;
-         else
+         if (extract_balanced (mlp, -1, -1, 0, token_type_rbracket))
            {
-             if (extract_balanced (mlp, -1, -1, 0, token_type_rbracket))
-               {
-                 free_token (tp);
-                 return true;
-               }
+             free_token (tp);
+             return true;
            }
          break;
 
index fc7bd2456b1e1e6885e96ce3dd700a461bb8fa39..027b74e1c85c2cc830a03433ce99245b7414b813 100644 (file)
@@ -1211,32 +1211,27 @@ extract_parenthesized (message_list_ty *mlp,
       switch (token.type)
        {
        case token_type_symbol:
-         /* No need to bother if we extract all strings anyway.  */
-         if (!extract_all)
-           {
-             void *keyword_value;
+         {
+           void *keyword_value;
 
-             if (find_entry (&keywords, token.string, strlen (token.string),
-                             &keyword_value)
-                 == 0)
-               {
-                 int argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
-                 int argnum2 = (int) (long) keyword_value >> 10;
+           if (find_entry (&keywords, token.string, strlen (token.string),
+                           &keyword_value)
+               == 0)
+             {
+               int argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
+               int argnum2 = (int) (long) keyword_value >> 10;
 
-                 next_commas_to_skip = argnum1 - 1;
-                 next_plural_commas = (argnum2 > argnum1 ? argnum2 - argnum1 : 0);
-                 state = 1;
-               }
-             else
-               state = 0;
-           }
+               next_commas_to_skip = argnum1 - 1;
+               next_plural_commas = (argnum2 > argnum1 ? argnum2 - argnum1 : 0);
+               state = 1;
+             }
+           else
+             state = 0;
+         }
          free (token.string);
          continue;
 
        case token_type_lparen:
-         /* No need to recurse if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (state
              ? extract_parenthesized (mlp, next_commas_to_skip,
                                       next_plural_commas)
@@ -1246,15 +1241,9 @@ extract_parenthesized (message_list_ty *mlp,
          continue;
 
        case token_type_rparen:
-         /* No need to return if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          return false;
 
        case token_type_comma:
-         /* No need to bother if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (commas_to_skip >= 0)
            {
              if (commas_to_skip > 0)
@@ -1301,10 +1290,10 @@ extract_parenthesized (message_list_ty *mlp,
                  }
                else
                  free (token.string);
-               state = 0;
              }
-           continue;
          }
+         state = 0;
+         continue;
 
        case token_type_other:
          state = 0;
index 6f1a8d53f26ebc3a73f7a1027750e046658153e3..e59ee750c38aeffc62a7bd581f9909f4f155abef 100644 (file)
@@ -1014,32 +1014,27 @@ extract_parenthesized (message_list_ty *mlp,
       switch (token.type)
        {
        case token_type_symbol:
-         /* No need to bother if we extract all strings anyway.  */
-         if (!extract_all)
-           {
-             void *keyword_value;
+         {
+           void *keyword_value;
 
-             if (find_entry (&keywords, token.string, strlen (token.string),
-                             &keyword_value)
-                 == 0)
-               {
-                 int argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
-                 int argnum2 = (int) (long) keyword_value >> 10;
+           if (find_entry (&keywords, token.string, strlen (token.string),
+                           &keyword_value)
+               == 0)
+             {
+               int argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
+               int argnum2 = (int) (long) keyword_value >> 10;
 
-                 next_commas_to_skip = argnum1 - 1;
-                 next_plural_commas = (argnum2 > argnum1 ? argnum2 - argnum1 : 0);
-                 state = 1;
-               }
-             else
-               state = 0;
-           }
+               next_commas_to_skip = argnum1 - 1;
+               next_plural_commas = (argnum2 > argnum1 ? argnum2 - argnum1 : 0);
+               state = 1;
+             }
+           else
+             state = 0;
+         }
          free (token.string);
          continue;
 
        case token_type_lparen:
-         /* No need to recurse if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (state
              ? extract_parenthesized (mlp, next_commas_to_skip,
                                       next_plural_commas)
@@ -1049,15 +1044,9 @@ extract_parenthesized (message_list_ty *mlp,
          continue;
 
        case token_type_rparen:
-         /* No need to return if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          return false;
 
        case token_type_comma:
-         /* No need to bother if we extract all strings anyway.  */
-         if (extract_all)
-           continue;
          if (commas_to_skip >= 0)
            {
              if (commas_to_skip > 0)
@@ -1104,10 +1093,10 @@ extract_parenthesized (message_list_ty *mlp,
                  }
                else
                  free (token.string);
-               state = 0;
              }
-           continue;
          }
+         state = 0;
+         continue;
 
        case token_type_eof:
          return true;
index 16d26ab7d4ad40516854b384042fa56b9416df9b..3cef49f95e808ea466bac8695778e498f341aa90 100644 (file)
@@ -1114,83 +1114,81 @@ read_command (int looking_for)
              remember_a_message (mlp, string_of_word (&inner), &pos);
            }
        }
+
+      if (arg_of_redirect)
+       {
+         /* Ignore arguments of redirection operators.  */
+         arg_of_redirect = false;
+       }
+      else if (inner.type == t_redirect)
+       {
+         /* Ignore this word and the following one.  */
+         arg_of_redirect = true;
+       }
       else
        {
-         if (arg_of_redirect)
-           {
-             /* Ignore arguments of redirection operators.  */
-             arg_of_redirect = false;
-           }
-         else if (inner.type == t_redirect)
+         if (argnum1 < 0 && argnum2 < 0)
            {
-             /* Ignore this word and the following one.  */
-             arg_of_redirect = true;
+             /* This is the function position.  */
+             arg = 0;
+             if (inner.type == t_string)
+               {
+                 char *function_name = string_of_word (&inner);
+                 void *keyword_value;
+
+                 if (find_entry (&keywords,
+                                 function_name, strlen (function_name),
+                                 &keyword_value)
+                     == 0)
+                   {
+                     argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
+                     argnum2 = (int) (long) keyword_value >> 10;
+                   }
+
+                 free (function_name);
+               }
            }
          else
            {
-             if (argnum1 < 0 && argnum2 < 0)
+             /* These are the argument positions.
+                Extract a string if we have reached the right
+                argument position.  */
+             if (arg == argnum1)
                {
-                 /* This is the function position.  */
-                 arg = 0;
                  if (inner.type == t_string)
                    {
-                     char *function_name = string_of_word (&inner);
-                     void *keyword_value;
-
-                     if (find_entry (&keywords,
-                                     function_name, strlen (function_name),
-                                     &keyword_value)
-                         == 0)
-                       {
-                         argnum1 = (int) (long) keyword_value & ((1 << 10) - 1);
-                         argnum2 = (int) (long) keyword_value >> 10;
-                       }
-
-                     free (function_name);
+                     lex_pos_ty pos;
+                     message_ty *mp;
+
+                     pos.file_name = logical_file_name;
+                     pos.line_number = inner.line_number_at_start;
+                     mp = remember_a_message (mlp, string_of_word (&inner), &pos);
+                     if (argnum2 > 0)
+                       plural_mp = mp;
                    }
                }
-             else
+             else if (arg == argnum2)
                {
-                 /* These are the argument positions.
-                    Extract a string if we have reached the right
-                    argument position.  */
-                 if (arg == argnum1)
-                   {
-                     if (inner.type == t_string)
-                       {
-                         lex_pos_ty pos;
-                         message_ty *mp;
-
-                         pos.file_name = logical_file_name;
-                         pos.line_number = inner.line_number_at_start;
-                         mp = remember_a_message (mlp, string_of_word (&inner), &pos);
-                         if (argnum2 > 0)
-                           plural_mp = mp;
-                       }
-                   }
-                 else if (arg == argnum2)
+                 if (inner.type == t_string && plural_mp != NULL)
                    {
-                     if (inner.type == t_string && plural_mp != NULL)
-                       {
-                         lex_pos_ty pos;
+                     lex_pos_ty pos;
 
-                         pos.file_name = logical_file_name;
-                         pos.line_number = inner.line_number_at_start;
-                         remember_a_message_plural (plural_mp, string_of_word (&inner), &pos);
-                       }
-                   }
-
-                 if (arg >= argnum1 && arg >= argnum2)
-                   {
-                     /* Stop looking for arguments of the last function_name.  */
-                     argnum1 = -1;
-                     argnum2 = -1;
-                     plural_mp = NULL;
+                     pos.file_name = logical_file_name;
+                     pos.line_number = inner.line_number_at_start;
+                     remember_a_message_plural (plural_mp, string_of_word (&inner), &pos);
                    }
                }
 
-             arg++;
+             if (arg >= argnum1 && arg >= argnum2)
+               {
+                 /* Stop looking for arguments of the last function_name.  */
+                 argnum1 = -1;
+                 argnum2 = -1;
+                 plural_mp = NULL;
+               }
            }
+
+         arg++;
        }
 
       free_word (&inner);