diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-09-18 07:18:30 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-09-18 07:18:30 +0200 |
commit | 1bff7434e2d2ace4da920b721ef989ad54974898 (patch) | |
tree | 572b91fbcd5afb94187bac600c476ca921993564 /src/vhdl/vhdl-sem_names.adb | |
parent | ecb84e353efaf3628a8d20407f7c336dc315793c (diff) | |
download | ghdl-1bff7434e2d2ace4da920b721ef989ad54974898.tar.gz ghdl-1bff7434e2d2ace4da920b721ef989ad54974898.tar.bz2 ghdl-1bff7434e2d2ace4da920b721ef989ad54974898.zip |
vhdl-sem_names(sem_parenthesis_name): minor refactoring
Diffstat (limited to 'src/vhdl/vhdl-sem_names.adb')
-rw-r--r-- | src/vhdl/vhdl-sem_names.adb | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb index cabef121b..fb935be34 100644 --- a/src/vhdl/vhdl-sem_names.adb +++ b/src/vhdl/vhdl-sem_names.adb @@ -3066,6 +3066,11 @@ package body Vhdl.Sem_Names is end if; return; + when Iir_Kind_Type_Declaration + | Iir_Kind_Subtype_Declaration => + Error_Msg_Sem + (+Name, "subprogram name is a type mark (missing apostrophe)"); + when Iir_Kinds_Scalar_Type_Attribute | Iir_Kind_Image_Attribute | Iir_Kind_Value_Attribute => @@ -3076,19 +3081,12 @@ package body Vhdl.Sem_Names is (Res, Sem_As_Indexed_Or_Slice_Name (Prefix, True)); elsif Actual /= Null_Iir then Finish_Sem_Scalar_Type_Attribute (Prefix_Name, Prefix, Actual); - Set_Named_Entity (Name, Prefix); - return; + Res := Prefix; else Error_Msg_Sem (+Name, "bad attribute parameter"); - Set_Named_Entity (Name, Error_Mark); - return; + Res := Error_Mark; end if; - when Iir_Kind_Type_Declaration - | Iir_Kind_Subtype_Declaration => - Error_Msg_Sem - (+Name, "subprogram name is a type mark (missing apostrophe)"); - when Iir_Kind_Stable_Attribute | Iir_Kind_Quiet_Attribute | Iir_Kind_Delayed_Attribute => @@ -3097,12 +3095,10 @@ package body Vhdl.Sem_Names is Add_Result (Res, Sem_As_Indexed_Or_Slice_Name (Prefix, True)); elsif Actual /= Null_Iir then Finish_Sem_Signal_Attribute_Signal (Prefix, Actual); - Set_Named_Entity (Name, Prefix); - return; + Res := Prefix; else Error_Msg_Sem (+Name, "bad attribute parameter"); - Set_Named_Entity (Name, Error_Mark); - return; + Res := Error_Mark; end if; when Iir_Kind_Ramp_Attribute |