From 18fc3e608989f4aacfe6817f7db2fc9173bc3d3c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 7 Aug 2024 18:40:53 -0400 Subject: [PATCH] Internals: Favor idAny in typedefs. --- src/verilog.y | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index 70ed8cf30..e835012c2 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -2591,15 +2591,10 @@ type_declaration: // ==IEEE: type_declaration AstNodeDType* const dtp = GRAMMARP->createArray(refp, $4, true); $$ = GRAMMARP->createTypedef($5, *$5, $7, dtp, $6); } // // - | yTYPEDEF id/*interface*/ '.' idAny/*type*/ idAny/*type*/ dtypeAttrListE ';' + | yTYPEDEF idAny/*interface*/ '.' idAny/*type*/ idAny/*type*/ dtypeAttrListE ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: SystemVerilog 2005 typedef in this context"); } - // // Allow redeclaring same typedef again - // // Alternative is use of idAny below, but this will cause conflicts with ablve - | yTYPEDEF idType ';' { $$ = GRAMMARP->createTypedefFwd($2, *$2); } - // // Combines into above "data_type id" rule - // // Verilator: Not important what it is in the AST, just need - // // to make sure the yaID__aTYPE gets returned - | yTYPEDEF id ';' { $$ = GRAMMARP->createTypedefFwd($2, *$2); } + // // idAny as also allows redeclaring same typedef again + | yTYPEDEF idAny ';' { $$ = GRAMMARP->createTypedefFwd($2, *$2); } // // IEEE: expanded forward_type to prevent conflict | yTYPEDEF yENUM idAny ';' { $$ = GRAMMARP->createTypedefFwd($3, *$3); } | yTYPEDEF ySTRUCT idAny ';' { $$ = GRAMMARP->createTypedefFwd($3, *$3); }