automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: 7/ Automake::Variable::output is a method


From: Alexandre Duret-Lutz
Subject: FYI: 7/ Automake::Variable::output is a method
Date: Thu, 29 May 2003 19:34:21 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3 (gnu/linux)

I'm installing this.

2003-05-29  Alexandre Duret-Lutz  <address@hidden>

        * lib/Automake/Variable.pm (output): Declare as a method, since it
        is only used this way.
        (define): Fix documentation of $cond.
        Suggested by Raja R. Harinath.

Index: lib/Automake/Variable.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Variable.pm,v
retrieving revision 1.1
diff -u -r1.1 Variable.pm
--- lib/Automake/Variable.pm    25 May 2003 20:05:50 -0000      1.1
+++ lib/Automake/Variable.pm    29 May 2003 17:30:38 -0000
@@ -552,6 +552,56 @@
     }
 }
 
+=item C<$str = $var->output (address@hidden)>
+
+Format all the definitions of C<$var> if C<@cond> is not specified,
+else only that corresponding to C<@cond>.
+
+=cut
+
+sub output ($@)
+{
+  my ($var, @conds) = @_;
+
+  @conds = $var->conditions->conds
+    unless @conds;
+
+  my $res = '';
+  my $name = $var->name;
+
+  foreach my $cond (@conds)
+    {
+      my $def = $var->def ($cond);
+      prog_error ("unknown condition `" . $cond->human . "' for `$var'")
+       unless $def;
+
+      next
+       if $def->pretty == VAR_SILENT;
+
+      $res .= $def->comment;
+
+      my $val = $def->value;
+      my $equals = $def->type eq ':' ? ':=' : '=';
+      my $str = $cond->subst_string;
+
+      if ($def->pretty == VAR_PRETTY)
+       {
+         # Suppress escaped new lines.  &makefile_wrap will
+         # add them back, maybe at other places.
+         $val =~ s/\\$//mg;
+         $res .= makefile_wrap ("$str$name $equals", "$str\t",
+                                split (' ' , $val));
+       }
+      else                     # VAR_ASIS
+       {
+         my $output_var = "$name $equals $val";
+         $output_var =~ s/^/$str/meg;
+         $res .= "$output_var\n";
+       }
+    }
+  return $res;
+}
+
 =back
 
 =head2 Utility functions
@@ -680,7 +730,7 @@
 C<$type>: the type of the assignment (C<''> for C<FOO = bar>,
 C<':'> for C<FOO := bar>, and C<'+'> for C<'FOO += bar'>).
 
-C<$cond>: the DisjConditions in which C<$var> is being defined.
+C<$cond>: the C<Condition> in which C<$var> is being defined.
 
 C<$value>: the value assigned to C<$var> in condition C<$cond>.
 
@@ -1245,58 +1295,6 @@
        }
     }
   return @result;
-}
-
-=item C<$str = output ($var, address@hidden)>
-
-Format all the definitions of C<$var> if C<@cond> is not specified,
-else only that corresponding to C<@cond>.
-
-=cut
-
-sub output ($@)
-{
-  my ($var, @conds) = @_;
-
-  $var = ref ($var) ? $var : rvar ($var);
-
-  @conds = $var->conditions->conds
-    unless @conds;
-
-  my $res = '';
-  my $name = $var->name;
-
-  foreach my $cond (@conds)
-    {
-      my $def = $var->def ($cond);
-      prog_error ("unknown condition `" . $cond->human . "' for `$var'")
-       unless $def;
-
-      next
-       if $def->pretty == VAR_SILENT;
-
-      $res .= $def->comment;
-
-      my $val = $def->value;
-      my $equals = $def->type eq ':' ? ':=' : '=';
-      my $str = $cond->subst_string;
-
-      if ($def->pretty == VAR_PRETTY)
-       {
-         # Suppress escaped new lines.  &makefile_wrap will
-         # add them back, maybe at other places.
-         $val =~ s/\\$//mg;
-         $res .= makefile_wrap ("$str$name $equals", "$str\t",
-                                split (' ' , $val));
-       }
-      else                     # VAR_ASIS
-       {
-         my $output_var = "$name $equals $val";
-         $output_var =~ s/^/$str/meg;
-         $res .= "$output_var\n";
-       }
-    }
-  return $res;
 }
 
 

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]