Support type identifier names in attributes

Standard attribute names and target names in both forms of the Icarus
`$attribute` extension are unambiguous identifier positions. When such a name
matches a visible typedef the lexer returns `TYPE_IDENTIFIER`, while the
grammar only accepts `IDENTIFIER`.

Use `identifier_name` for all of these positions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2026-07-09 22:31:31 -07:00
parent 0723d9a477
commit ee14022127
1 changed files with 3 additions and 3 deletions

View File

@ -1748,7 +1748,7 @@ description /* IEEE1800-2005: A.1.2 */
| package_declaration | package_declaration
| discipline_declaration | discipline_declaration
| package_item | package_item
| KK_attribute '(' IDENTIFIER ',' STRING ',' STRING ')' | KK_attribute '(' identifier_name ',' STRING ',' STRING ')'
{ perm_string tmp3 = lex_strings.make($3); { perm_string tmp3 = lex_strings.make($3);
pform_set_type_attrib(tmp3, $5, $7); pform_set_type_attrib(tmp3, $5, $7);
delete[] $3; delete[] $3;
@ -3109,7 +3109,7 @@ attribute_list
attribute attribute
: IDENTIFIER initializer_opt : identifier_name initializer_opt
{ named_pexpr_t*tmp = new named_pexpr_t; { named_pexpr_t*tmp = new named_pexpr_t;
FILE_NAME(tmp, @$); FILE_NAME(tmp, @$);
tmp->name = lex_strings.make($1); tmp->name = lex_strings.make($1);
@ -5715,7 +5715,7 @@ module_item
/* These rules are for the Icarus Verilog specific $attribute /* These rules are for the Icarus Verilog specific $attribute
extensions. Then catch the parameters of the $attribute keyword. */ extensions. Then catch the parameters of the $attribute keyword. */
| KK_attribute '(' IDENTIFIER ',' STRING ',' STRING ')' ';' | KK_attribute '(' identifier_name ',' STRING ',' STRING ')' ';'
{ perm_string tmp3 = lex_strings.make($3); { perm_string tmp3 = lex_strings.make($3);
perm_string tmp5 = lex_strings.make($5); perm_string tmp5 = lex_strings.make($5);
pform_set_attrib(tmp3, tmp5, $7); pform_set_attrib(tmp3, tmp5, $7);