This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change name of sub errors() to sub report_error_count()
authorJames E. Keenan <jkeenan@cpan.org>
Sat, 27 Mar 2010 02:05:49 +0000 (22:05 -0400)
committerSteffen Mueller <smueller@cpan.org>
Tue, 12 Jul 2011 18:53:52 +0000 (20:53 +0200)
... to distinguish it better from 'our' variable $errors.
Adjust t/002-more.t and lib/ExtUtils/xsubpp accordingly.

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
dist/ExtUtils-ParseXS/t/002-more.t

index 2faaeac..20efd57 100644 (file)
@@ -21,10 +21,12 @@ use ExtUtils::ParseXS::Utilities qw(
   map_type
 );
 
-our (@ISA, @EXPORT_OK, $VERSION);
-@ISA = qw(Exporter);
-@EXPORT_OK = qw(process_file);
-$VERSION = '3';
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(
+  process_file
+  report_error_count
+);
+our $VERSION = '3';
 $VERSION = eval $VERSION if $VERSION =~ /_/;
 
 # use strict;  # One of these days ...
@@ -1074,7 +1076,8 @@ EOF
   return 1;
 }
 
-sub errors { $errors }
+#sub errors { $errors }
+sub report_error_count { $errors }
 
 # Input:  ($_, @line) == unparsed input.
 # Output: ($_, @line) == (rest of line, following lines).
index e4e5b77..2dfe278 100644 (file)
@@ -1,7 +1,10 @@
 #!./miniperl
 
 require 5.002;
-use ExtUtils::ParseXS qw(process_file);
+use ExtUtils::ParseXS qw(
+  process_file
+  report_error_count
+);
 use Getopt::Long;
 
 my %args = ();
@@ -38,7 +41,7 @@ if ($args{v}) {
 $args{filename} = shift @ARGV;
 
 process_file(%args);
-exit( ExtUtils::ParseXS::errors() ? 1 : 0 );
+exit( report_error_count() ? 1 : 0 );
 
 __END__
 
index 4c2a39a..f8a7c2a 100644 (file)
@@ -58,7 +58,7 @@ SKIP: {
     sub new{ bless {}, shift }
   };
   is $@, '';
-  is ExtUtils::ParseXS::errors(), 0, 'ExtUtils::ParseXS::errors()';
+  is ExtUtils::ParseXS::report_error_count(), 0, 'ExtUtils::ParseXS::errors()';
 
   is $XSMore::boot_ok, 100, 'the BOOT keyword';