From 17ca0948f409adcb4aeda621877086a27cadd8a1 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 5 Jul 2026 14:39:43 -0700 Subject: [PATCH] Support event names shadowing type identifiers SystemVerilog allows a declaration in an inner scope to use the same name as a type identifier from an outer scope. This also applies to named event declarations. The lexer reports such names as `TYPE_IDENTIFIER` before the event has been installed, which made constructs such as: typedef int T; module test; event T; endmodule fail in the event declaration grammar. Event declarations do not have the local type/name ambiguity that exists for variable, net, or parameter declarations. The name in `event_variable` is always the event name. Use `identifier_name` so a `TYPE_IDENTIFIER` token can be accepted as the event name. Signed-off-by: Lars-Peter Clausen --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.y b/parse.y index 3c1daeb31..6f9edcf15 100644 --- a/parse.y +++ b/parse.y @@ -6368,7 +6368,7 @@ dimensions ; event_variable - : IDENTIFIER dimensions_opt + : identifier_name dimensions_opt { if ($2) { yyerror(@2, "sorry: event arrays are not supported."); delete $2;