automake
[Top][All Lists]
Advanced

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

50-use-strict.patch


From: Akim Demaille
Subject: 50-use-strict.patch
Date: Mon, 19 Mar 2001 10:20:53 +0100

I don't know how to fix the `use strict refs' part.  In particular, it
dies on computed sub names:

        & $my_sub ();

fails, and I don't know how to rewrite it the way strict refs wants it.

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * automake.in: Use strict vars and subs.
        Declare `%require_file_found'.
        (&handle_source_transform, &make_paragraphs): Declare my variables.

Index: automake.in
--- automake.in Sun, 11 Mar 2001 19:01:49 +0100 akim (am/f/39_automake.i 1.168 
755)
+++ automake.in Sun, 11 Mar 2001 19:21:51 +0100 akim (am/f/39_automake.i 1.168 
755)
@@ -28,7 +28,7 @@
 # Perl reimplementation by Tom Tromey <address@hidden>.

 require 5.005;
-# FIXME: use strict;
+use strict 'vars', 'subs';
 use File::Basename;
 use IO::File;

@@ -847,7 +847,7 @@ sub initialize_per_input ()
 exit $exit_status;

 # FIXME: This should be `my'ed next to its subs.
-# use vars '%require_file_found';
+use vars '%require_file_found';

 ################################################################

@@ -1924,7 +1924,7 @@ sub handle_source_transform
        push (@dist_sources, $unxformed . '.c');
        push (@objects, $unxformed . $obj);

-       ($temp, @result) =
+       my ($temp, @result) =
          &handle_single_transform_list ($one_file . '_SOURCES',
                                         $one_file, $obj,
                                         "$unxformed.c");
@@ -6746,10 +6746,10 @@ sub make_paragraphs ($%)

     while (defined ($_ = shift @lines))
       {
+       my $paragraph = "$_";
        # If we are a rule, eat as long as we start with a tab.
        if (/$RULE_PATTERN/smo)
          {
-           $paragraph = "$_";
            while (defined ($_ = shift @lines) && $_ =~ /^\t/)
              {
                $paragraph .= "\n$_";
@@ -6760,18 +6760,12 @@ sub make_paragraphs ($%)
        # If we are a comments, eat as much comments as you can.
        elsif (/$COMMENT_PATTERN/smo)
          {
-           $paragraph = "$_";
            while (defined ($_ = shift @lines)
                   && $_ =~ /$COMMENT_PATTERN/smo)
              {
                $paragraph .= "\n$_";
              }
            unshift (@lines, $_);
-         }
-       # Otherwise, consider it as a lone content.
-       else
-         {
-           $paragraph .= "$_";
          }

        push @res, $paragraph;



reply via email to

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