From 1d623a67d104737cb5743808dea7253ef8fbff1b Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 10 Jul 2026 07:50:06 -0700 Subject: [PATCH] Support discipline and nature names shadowing type identifiers Verilog-AMS nature and discipline declarations can use names that are also visible as type identifiers. The `potential` and `flow` discipline items can likewise reference a nature whose name is returned as `TYPE_IDENTIFIER` by the lexer. These grammar positions currently only accept `IDENTIFIER`. Use `identifier_name` for nature and discipline declaration names and for the `potential` and `flow` nature references. Signed-off-by: Lars-Peter Clausen --- parse.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.y b/parse.y index 4329c7c3f..dffeb9104 100644 --- a/parse.y +++ b/parse.y @@ -3614,7 +3614,7 @@ delay_value_simple optional_semicolon : ';' | ; discipline_declaration - : K_discipline IDENTIFIER optional_semicolon + : K_discipline identifier_name optional_semicolon { pform_start_discipline($2); } discipline_items K_enddiscipline { pform_end_discipline(@1); delete[] $2; } @@ -3630,14 +3630,14 @@ discipline_item { pform_discipline_domain(@1, IVL_DIS_DISCRETE); } | K_domain K_continuous ';' { pform_discipline_domain(@1, IVL_DIS_CONTINUOUS); } - | K_potential IDENTIFIER ';' + | K_potential identifier_name ';' { pform_discipline_potential(@1, $2); delete[] $2; } - | K_flow IDENTIFIER ';' + | K_flow identifier_name ';' { pform_discipline_flow(@1, $2); delete[] $2; } ; nature_declaration - : K_nature IDENTIFIER optional_semicolon + : K_nature identifier_name optional_semicolon { pform_start_nature($2); } nature_items K_endnature