From 3ca1c129ce73c288b6ee7811963f2e0be9febf31 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 15 Jan 2022 14:16:28 +0100 Subject: [PATCH] Allow packed arrays of scoped types identifiers Allow scoped identifiers to be used as the base type for packed array types. Scoped type identifiers can be used the same way as unscoped type identifiers. E.g. ``` package p; typedef logic [1:0] vector; endpackage module test; p::vector [1:0] pa; endmodule ``` is a valid construct. Signed-off-by: Lars-Peter Clausen --- parse.y | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parse.y b/parse.y index 355f09797..7491fcbeb 100644 --- a/parse.y +++ b/parse.y @@ -1186,6 +1186,13 @@ packed_array_data_type /* IEEE1800-2005: A.2.2.1 */ delete[]$1.text; $$ = $1.type; } + | PACKAGE_IDENTIFIER K_SCOPE_RES + { lex_in_package_scope($1); } + TYPE_IDENTIFIER + { lex_in_package_scope(0); + $$ = $4.type; + delete[]$4.text; + } ; data_type /* IEEE1800-2005: A.2.2.1 */ @@ -1233,13 +1240,6 @@ data_type /* IEEE1800-2005: A.2.2.1 */ $$ = $1; } } - | PACKAGE_IDENTIFIER K_SCOPE_RES - { lex_in_package_scope($1); } - TYPE_IDENTIFIER - { lex_in_package_scope(0); - $$ = $4.type; - delete[]$4.text; - } | K_string { string_type_t*tmp = new string_type_t; FILE_NAME(tmp, @1);