From 3ee55b46109e5b9198205f64f54e2a00f06a51cc Mon Sep 17 00:00:00 2001 From: zhangruifang2020 Date: Wed, 31 Jul 2024 10:07:41 +0800 Subject: [PATCH] Backport patch from upstream --- backport-d-fix-interface-syntax-error.patch | 56 +++++++++++++++++++++ bison.spec | 6 ++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 backport-d-fix-interface-syntax-error.patch diff --git a/backport-d-fix-interface-syntax-error.patch b/backport-d-fix-interface-syntax-error.patch new file mode 100644 index 0000000..98cbbc3 --- /dev/null +++ b/backport-d-fix-interface-syntax-error.patch @@ -0,0 +1,56 @@ +From be4528096ec05f0d58bd9ff53a293e1ec3193a85 Mon Sep 17 00:00:00 2001 +From: Adela Vais +Date: Mon, 19 Sep 2022 15:12:39 +0200 +Subject: [PATCH] d: fix interface syntax error + +Fix syntax error regarding interface inheritance of the Lexer. It +appeared when the `%code lexer` option was used. + +Reported by ledaniel2. + + +* data/skeletons/lalr1.d: Fix syntax. +* tests/d.at: Test it. +--- + data/skeletons/lalr1.d | 5 +++-- + tests/d.at | 7 +++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/data/skeletons/lalr1.d b/data/skeletons/lalr1.d +index 3195dbf8..01175325 100644 +--- a/data/skeletons/lalr1.d ++++ b/data/skeletons/lalr1.d +@@ -269,9 +269,10 @@ b4_user_union_members + } + }]])[ + +-]b4_lexer_if([[ private class YYLexer implements Lexer { ++]b4_lexer_if([[private class YYLexer: Lexer ++{ + ]b4_percent_code_get([[lexer]])[ +- } ++} + ]])[ + /** The object doing lexical analysis for us. */ + private Lexer yylexer; +diff --git a/tests/d.at b/tests/d.at +index 6be53eef..347e868c 100644 +--- a/tests/d.at ++++ b/tests/d.at +@@ -112,6 +112,13 @@ AT_CHECK_D_GREP([[class YYParser : BaseClass]]) + AT_CHECK_D_MINIMAL([%define api.parser.extends {Interface}], [], [], [interface Interface {}]) + AT_CHECK_D_GREP([[class YYParser : Interface]]) + ++AT_CHECK_D_MINIMAL([%code lexer ++{ ++ Symbol yylex () {return Symbol();} ++ void yyerror (string s) {import std.stdio;writeln(s);} ++}], [], [], []) ++AT_CHECK_D_GREP([[private class YYLexer: Lexer]]) ++ + AT_CHECK_D_MINIMAL( + [%define api.parser.extends {BaseClass} + %define api.parser.implements {Interface}], [], [], +-- +2.33.0 + diff --git a/bison.spec b/bison.spec index 27be889..1b46e1e 100644 --- a/bison.spec +++ b/bison.spec @@ -1,12 +1,13 @@ Name: bison Version: 3.8.2 -Release: 2 +Release: 3 Summary: A GNU general-purpose parser generator License: GPLv3+ URL: http://www.gnu.org/software/bison/ Source0: https://ftp.gnu.org/gnu/bison/bison-%{version}.tar.xz Patch1: backport-tests-make-it-easier-to-spot-failures.patch +Patch2: backport-d-fix-interface-syntax-error.patch BuildRequires: gcc-c++ autoconf automake m4 flex Requires(post): info @@ -91,6 +92,9 @@ fi %{_datadir}/locale/*/LC_MESSAGES/bison-gnulib.mo %changelog +* Wed Jul 31 2024 zhangruifang - 3.8.2-3 +- Backport patch from upstream + * Sat Oct 22 2022 yixiangzhike - 3.8.2-2 - Type:bugfix - ID:NA -- Gitee