develooper Front page | perl.perl5.porters | Postings from January 2001

Re: [PATCH: perl@8342] comp/proto..........FAILED tests 112-123

Thread Previous | Thread Next
From:
Andy Dougherty
Date:
January 9, 2001 09:10
Subject:
Re: [PATCH: perl@8342] comp/proto..........FAILED tests 112-123
Message ID:
Pine.SOL.4.10.10101091144440.13124-100000@maxwell.phys.lafayette.edu
On Tue, 9 Jan 2001, Roca, Ignasi wrote:

> Using Bison parser generator, the parser produces the message "parse error"
> instead of "syntax error"
> 
> Following is a diff file of test script proto.t to avoid the test failures.

[patch that uses Config and then looks at $Config{ccflags} to see if
-DUSE_PURE_BISON is present ]

I think the version below is better:  it doesn't rely on having built
Config (which means it won't throw an error on 'make minitest') and it
also doesn't assume that the only way to use BISON will always be via
$Config{ccflags}.  I could easily see a user hand-editing perl.h or
someone someday adding a new Configure variable to accomplish the same
thing.  This patch just changes the regex to /(parse|syntax)/.

--- t/comp/proto.t.old	Thu Dec 28 17:19:59 2000
+++ t/comp/proto.t	Tue Jan  9 12:06:22 2001
@@ -491,12 +491,14 @@
 }
 
 # test prototypes when they are evaled and there is a syntax error
+# Byacc generates the string "syntax error".  Bison gives the
+# string "parse error".
 #
 for my $p ( "", qw{ () ($) ($@) ($%) ($;$) (&) (&\@) (&@) (%) (\%) (\@) } ) {
   no warnings 'redefine';
   my $eval = "sub evaled_subroutine $p { &void *; }";
   eval $eval;
-  print "# eval[$eval]\nnot " unless $@ && $@ =~ /syntax error/;
+  print "# eval[$eval]\nnot " unless $@ && $@ =~ /(parse|syntax) error/;
   print "ok ", $i++, "\n";
 }
 
-- 
    Andy Dougherty		doughera@lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About