This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv_find() returning false, followed by sv_magic() to add the magic,
[perl5.git] / regen_perly.pl
index da917e0..af92aa8 100644 (file)
@@ -2,7 +2,7 @@
 #
 # regen_perly.pl, DAPM 12-Feb-04
 #
-# Copyright (c) 2004 Larry Wall
+# Copyright (c) 2004, 2005 Larry Wall
 #
 # Given an input file perly.y, run bison on it and produce
 # the following output files:
@@ -65,11 +65,11 @@ die "$0: must be run on an ASCII system\n" unless ord 'A' == 65;
 # the test below to allow that version too. DAPM Feb 04.
 
 my $version = `$bison -V`;
-unless ($version =~ /\b1\.875\b/) { die <<EOF; }
+unless ($version =~ /\b(1\.875[a-z]?|2\.[01])\b/) { die <<EOF; }
 
-You have the wrong version of bison in your path; currently 1.875 is
-required.  Try installing
-    http://ftp.gnu.org/gnu/bison/bison-1.875.tar.bz2
+You have the wrong version of bison in your path; currently 1.875
+2.0 or 2.1 is required.  Try installing
+    http://ftp.gnu.org/gnu/bison/bison-2.1.tar.gz
 or similar.  Your bison identifies itself as:
 
 $version
@@ -114,7 +114,7 @@ while (<TMPH_FILE>) {
        print H_FILE "#endif /* PERL_CORE */\n";
        $endcore_done = 1;
     }
-    s/"perlytmp.h"/"perly.h"/;
+    s/"$tmph_file"/"$h_file"/;
     print H_FILE $_;
 }
 close TMPH_FILE;
@@ -150,7 +150,7 @@ sub extract {
        switch \s* \( \s* \w+ \s* \) \s* { \s*
        (
            case \s* \d+ \s* : \s*
-           \#line [^\n]+"perly\.y"
+           \#line [^\n]+"\Q$y_file\E"
            .*?
        )
        }
@@ -169,10 +169,6 @@ sub extract {
     return $actlines. "\n", $tablines. "\n";
 }
 
-       
-           
-
-
 sub my_system {
     system(@_);
     if ($? == -1) {