]> sourceware.org Git - automake.git/commitdiff
* automake.in (&read_am_file): Define the variables in a single
authorAkim Demaille <akim@epita.fr>
Fri, 23 Mar 2001 17:12:43 +0000 (17:12 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 23 Mar 2001 17:12:43 +0000 (17:12 +0000)
shot.
Factor the $saw_bk code.

ChangeLog
automake.in

index 3be49224af0012c0c0343d98d5a72e3db505edff..fe50880c47d2d328facc8e79a56a757c15cd1c73 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-03-23  Akim Demaille  <akim@epita.fr>
+
+       * automake.in (&read_am_file): Define the variables in a single
+       shot.
+       Factor the $saw_bk code.
+
+       
 2001-03-23  Akim Demaille  <akim@epita.fr>
 
        * automake.in (&read_am_file): Keep $cond_string up to date.
index c1dc0def64622e8ca851b2ad3048f47b4a959e1a..33381189fb5e8241710c171fedda5b977ecc0899 100755 (executable)
@@ -6380,6 +6380,8 @@ sub read_am_file
     my $was_rule = 0;
     my $is_ok_macro;
     my $last_var_name = '';
+    my $last_var_type = '';
+    my $last_var_value = '';
     while ($_)
     {
        $_ .= "\n"
@@ -6415,18 +6417,19 @@ sub read_am_file
            {
                $output_trailer .= &make_condition (@conditional_stack);
                $output_trailer .= $_;
-               $saw_bk = /\\$/;
            }
            else
            {
-               $saw_bk = /\\$/;
-               $contents{$last_var_name} .= ' '
-                   unless $contents{$last_var_name} =~ /\s$/;
-               $contents{$last_var_name} .= $_;
-               if (@conditional_stack)
+             $last_var_value .= ' '
+               unless $last_var_value =~ /\s$/;
+             $last_var_value .= $_;
+
+             if (!/\\$/)
                {
-                   my $cond_string = conditional_string (@conditional_stack);
-                   ${conditional{$last_var_name}}{$cond_string} .= $_;
+                 macro_define ($last_var_name, 0,
+                                  $last_var_type, $cond_string,
+                                  $last_var_value, $.);
+                 push (@var_list, $last_var_name);
                }
            }
        }
@@ -6480,7 +6483,6 @@ sub read_am_file
             $output_trailer .= &make_condition (@conditional_stack);
             $output_trailer .= $_;
            $comment = $spacing = '';
-           $saw_bk = /\\$/;
        }
        elsif (($is_ok_macro = /$MACRO_PATTERN/o)
               || /$BOGUS_MACRO_PATTERN/o)
@@ -6492,27 +6494,29 @@ sub read_am_file
            # Found a macro definition.
            $was_rule = 0;
            $last_var_name = $1;
-           my $type = $2;
-           my $value = $3;
+           $last_var_type = $2;
+           $last_var_value = $3;
            if ($3 ne '' && substr ($3, -1) eq "\\")
            {
                # We preserve the `\' because otherwise the long lines
                # that are generated will be truncated by broken
                # `sed's.
-               $value = $3 . "\n";
+               $last_var_value = $3 . "\n";
            }
 
-           macro_define ($last_var_name, 0, $type, $cond_string,
-                            $value, $.);
-           push (@var_list, $last_var_name);
-
            # FIXME: this doesn't always work correctly; it will group
            # all comments for a given variable, no matter where
            # defined.
            $am_vars{$last_var_name} = $comment . $spacing;
-
            $comment = $spacing = '';
-           $saw_bk = /\\$/;
+
+           if (!/\\$/)
+             {
+               macro_define ($last_var_name, 0,
+                                $last_var_type, $cond_string,
+                                $last_var_value, $.);
+               push (@var_list, $last_var_name);
+             }
        }
         elsif (/$INCLUDE_PATTERN/o)
         {
@@ -6539,9 +6543,9 @@ sub read_am_file
            $output_trailer .= &make_condition  (@conditional_stack);
            $output_trailer .= $_;
            $comment = $spacing = '';
-           $saw_bk = /\\$/;
        }
 
+       $saw_bk = /\\$/;
         $_ = $am_file->getline;
     }
 
This page took 0.04899 seconds and 5 git commands to generate.