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 <lars@metafoo.de>
This commit is contained in:
parent
f6848300b7
commit
17ca0948f4
2
parse.y
2
parse.y
|
|
@ -6368,7 +6368,7 @@ dimensions
|
||||||
;
|
;
|
||||||
|
|
||||||
event_variable
|
event_variable
|
||||||
: IDENTIFIER dimensions_opt
|
: identifier_name dimensions_opt
|
||||||
{ if ($2) {
|
{ if ($2) {
|
||||||
yyerror(@2, "sorry: event arrays are not supported.");
|
yyerror(@2, "sorry: event arrays are not supported.");
|
||||||
delete $2;
|
delete $2;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue