Skip to content

Commit 3be1402

Browse files
authored
Merge pull request #1419 from diffblue/named-port-connection-fix
SystemVerilog: allow typedefs as port names in named port connections
2 parents 20c2a2d + 53933a4 commit 3be1402

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
KNOWNBUG
1+
CORE
22
port_connection1.sv
33

44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
^warning: ignoring
88
--
9-
This does not parse.

src/verilog/parser.y

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,10 +3218,12 @@ named_port_connection_brace:
32183218
;
32193219

32203220
named_port_connection:
3221-
'.' port_identifier '(' expression_opt ')'
3221+
// This needs to be 'any_identifier' to allow identifiers that
3222+
// are typedefs in the local scope.
3223+
'.' any_identifier '(' expression_opt ')'
32223224
{ init($$, ID_named_port_connection);
3223-
mto($$, $2);
3224-
mto($$, $4); }
3225+
mto($$, $2);
3226+
mto($$, $4); }
32253227
;
32263228

32273229
// System Verilog standard 1800-2017
@@ -4644,7 +4646,8 @@ attr_name: identifier
46444646
// even if they are already used for a different kind of identifier
46454647
// in a higher scope.
46464648
any_identifier:
4647-
type_identifier
4649+
TOK_TYPE_IDENTIFIER
4650+
{ new_symbol($$, $1); }
46484651
| non_type_identifier
46494652
;
46504653

0 commit comments

Comments
 (0)