From 0a2b3d8846bc5c68e42def5b83d657754b4d07ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Tue, 28 Jul 2020 14:06:34 +0100 Subject: 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. --- regen_perly.pl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'regen_perly.pl') 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 <= 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"; -- cgit v1.2.1