summaryrefslogtreecommitdiff
path: root/regen_perly.pl
diff options
context:
space:
mode:
Diffstat (limited to 'regen_perly.pl')
-rw-r--r--regen_perly.pl13
1 files changed, 6 insertions, 7 deletions
diff --git a/regen_perly.pl b/regen_perly.pl
index ac5f13a4ee..c8df5a3d15 100644
--- a/regen_perly.pl
+++ b/regen_perly.pl
@@ -76,11 +76,11 @@ EOF
# Don't change this to add new bison versions without testing that the generated
# files actually work :-) Win32 in particular may not like them. :-(
-unless ($version =~ /\b(1\.875[a-z]?|2\.[0134567]|3\.[0-4])\b/) { die <<EOF; }
+unless ($version =~ /\b(2\.[4567]|3\.[0-4])\b/) { die <<EOF; }
You have the wrong version of bison in your path; currently versions
-1.875, 2.0-2.7 or 3.0-3.4 are known to work. Try installing
- http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
+2.4-2.7 or 3.0-3.4 are known to work. Try installing
+ http://ftp.gnu.org/gnu/bison/bison-3.3.tar.gz
or similar. Your bison identifies itself as:
$version
@@ -133,8 +133,7 @@ open my $tmph_fh, '<', $tmph_file or die "Can't open $tmph_file: $!\n";
}
my $endcore_done = 0;
-# Token macros need to be generated manually from bison 2.4 on
-my $gather_tokens = $version >= 2.4 ? undef : 0;
+my $gather_tokens = 0;
my $tokens;
while (<$tmph_fh>) {
# bison 2.6 adds header guards, which break things because of where we
@@ -163,10 +162,10 @@ j
$endcore_done = 1;
}
next if /^#line \d+ ".*"/;
- if (not defined $gather_tokens) {
+ if (!$gather_tokens) {
$gather_tokens = 1 if /^\s* enum \s* yytokentype \s* \{/x;
}
- elsif ($gather_tokens) {
+ else {
if (/^\# \s* endif/x) { # The #endif just after the end of the token enum
$gather_tokens = 0;
$_ .= "\n/* Tokens. */\n$tokens";