summaryrefslogtreecommitdiff
path: root/regen_perly.pl
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-07-28 14:06:34 +0100
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-08-06 14:55:10 +0100
commit0a2b3d8846bc5c68e42def5b83d657754b4d07ce (patch)
tree7390a273af73b7e68802aa755c4c029985b7ba72 /regen_perly.pl
parent68932db140076f5a7aa243f78fc4fc963acc09b5 (diff)
downloadperl-0a2b3d8846bc5c68e42def5b83d657754b4d07ce.tar.gz
Bump minimum required Bison version to 2.4
This lets us replace the deprecated `%pure-parser` directive with `%define api.pure`, and get rid of some other conditional code. Bison is only required for developers hacking on the grammar, since we check in the generated code. Bison 2.4 was released in 2008, and is included in operating systems as old as Red Hat Enterprise Linux 6.
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";