]> sourceware.org Git - automake.git/commitdiff
* automake.in (&macro_define, &read_am_file): More work for the
authorAkim Demaille <akim@epita.fr>
Fri, 23 Mar 2001 16:37:46 +0000 (16:37 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 23 Mar 2001 16:37:46 +0000 (16:37 +0000)
former from the latter.  Reorganize the latter.

ChangeLog
automake.in

index 6b8dc816510ed72051f2f79ddc73a205cbaac138..5b1fea6306c020c350681dd201f948c8fe986a59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-03-23  Akim Demaille  <akim@epita.fr>
+
+       * automake.in (&macro_define, &read_am_file): More work for the
+       former from the latter.  Reorganize the latter.
+
 2001-03-23  Akim Demaille  <akim@epita.fr>
 
        * automake.in (&macro_define): Extract from...
index a26c960a850d0f34d73d615ceefe13064ca6ba4f..c7362d61037b4be4207aa720eb4e093cea5c5977 100755 (executable)
@@ -5615,6 +5615,15 @@ sub macro_define ($$$$$$)
 {
   my ($var, $var_is_am, $type, $cond_string, $value, $where) = @_;
 
+  if (defined $contents{$1}
+      && ($cond_string
+         ? ! defined $conditional{$1}
+         : defined $conditional{$1}))
+    {
+      &am_line_error ($1,
+                     "$1 defined both conditionally and unconditionally");
+    }
+
   if (! defined $contents{$var})
     {
       # The first assignment to a macro sets the line
@@ -5670,6 +5679,11 @@ sub macro_define ($$$$$$)
          ${$conditional{$var}}{$cond_string} = $value;
         }
     }
+
+    # FIXME: I don't understand what's so special wrt `:', nor
+    # why we forget the `+' nature of a var.
+    $def_type{$var} = ($type eq ':') ? ':' : '';
+    push (@var_list, $var);
 }
 
 
@@ -6427,18 +6441,15 @@ sub read_am_file
        elsif (($is_ok_macro = /$MACRO_PATTERN/o)
               || /$BOGUS_MACRO_PATTERN/o)
        {
+           # Error if bogus.
+           &am_line_error ($., "bad macro name `$last_var_name'")
+               if ! $is_ok_macro;
+
            # Found a macro definition.
            $was_rule = 0;
            $last_var_name = $1;
-           if (defined $contents{$1}
-               && (@conditional_stack
-                   ? ! defined $conditional{$1}
-                   : defined $conditional{$1}))
-           {
-               &am_line_error ($1,
-                               "$1 defined both conditionally and unconditionally");
-           }
-           my $value;
+           my $type = $2;
+           my $value = $3;
            if ($3 ne '' && substr ($3, -1) eq "\\")
            {
                # We preserve the `\' because otherwise the long lines
@@ -6446,11 +6457,6 @@ sub read_am_file
                # `sed's.
                $value = $3 . "\n";
            }
-           else
-           {
-               $value = $3;
-           }
-           my $type = $2;
 
            macro_define ($last_var_name, 0, $type,
                             conditional_string (@conditional_stack),
@@ -6460,14 +6466,9 @@ sub read_am_file
            # all comments for a given variable, no matter where
            # defined.
            $am_vars{$last_var_name} = $comment . $spacing;
-           $def_type{$last_var_name} = ($type eq ':') ? ':' : '';
-           push (@var_list, $last_var_name);
+
            $comment = $spacing = '';
            $saw_bk = /\\$/;
-
-           # Error if bogus.
-           &am_line_error ($., "bad macro name `$last_var_name'")
-               if ! $is_ok_macro;
        }
         elsif (/$INCLUDE_PATTERN/o)
         {
This page took 0.036739 seconds and 5 git commands to generate.