From 140eb0a6e579097f5936360d55b35d89c61bf3a7 Mon Sep 17 00:00:00 2001 From: Arkadiusz Kozdra Date: Wed, 11 Sep 2024 14:10:29 +0200 Subject: [PATCH] Re-sync parser on endclass Signed-off-by: Arkadiusz Kozdra --- src/verilog.y | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index b254bf3388..e20da03870 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -7030,14 +7030,14 @@ class_declaration: // ==IEEE: part of class_declaration /*mid*/ { // Allow resolving types declared in base extends class if ($3) SYMP->importExtends($3); } - /*cont*/ class_itemListE yENDCLASS endLabelE + /*cont*/ class_itemListEnd endLabelE { $$ = $1; $1->addMembersp($2); if ($2) $1->isParameterized(true); $1->addExtendsp($3); $1->addExtendsp($4); $1->addMembersp($7); SYMP->popScope($$); - GRAMMARP->endLabel($9, $1, $9); } + GRAMMARP->endLabel($8, $1, $8); } ; classFront: // IEEE: part of class_declaration @@ -7216,9 +7216,11 @@ localNextId: // local //^^^========= -class_itemListE: - /* empty */ { $$ = nullptr; } - | class_itemList { $$ = $1; } +class_itemListEnd: + yENDCLASS { $$ = nullptr; } + | class_itemList yENDCLASS { $$ = $1; } + | error yENDCLASS { $$ = nullptr; } + | class_itemList error yENDCLASS { $$ = $1; } ; class_itemList: