aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/sem_assocs.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-12-08 05:19:55 +0100
committerTristan Gingold <tgingold@free.fr>2016-12-08 05:19:55 +0100
commit7b556be5180c421a13e93e24393f3ab77df8f864 (patch)
tree7b93e2ea57484d461021f3992582f136a75b79ed /src/vhdl/sem_assocs.adb
parent7f6e03839738cb5a57d6d9cbcd6109dd262f7977 (diff)
downloadghdl-7b556be5180c421a13e93e24393f3ab77df8f864.tar.gz
ghdl-7b556be5180c421a13e93e24393f3ab77df8f864.tar.bz2
ghdl-7b556be5180c421a13e93e24393f3ab77df8f864.zip
Allow operator symbol as formal name.
For #205
Diffstat (limited to 'src/vhdl/sem_assocs.adb')
-rw-r--r--src/vhdl/sem_assocs.adb9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vhdl/sem_assocs.adb b/src/vhdl/sem_assocs.adb
index 968ad8a28..b85050ff3 100644
--- a/src/vhdl/sem_assocs.adb
+++ b/src/vhdl/sem_assocs.adb
@@ -141,7 +141,8 @@ package body Sem_Assocs is
Assoc := Rewrite_Non_Object_Association (Assoc, Inter);
end if;
else
- if Get_Kind (Formal) = Iir_Kind_Simple_Name then
+ if Kind_In (Formal, Iir_Kind_Simple_Name, Iir_Kind_Operator_Symbol)
+ then
-- A candidate. Search the corresponding interface.
Inter := Find_Name_In_Chain
(Inter_Chain, Get_Identifier (Formal));
@@ -1335,7 +1336,8 @@ package body Sem_Assocs is
Formal_Type : Iir;
begin
case Get_Kind (Formal) is
- when Iir_Kind_Simple_Name =>
+ when Iir_Kind_Simple_Name
+ | Iir_Kind_Operator_Symbol =>
-- Certainly the most common case: FORMAL_NAME => VAL.
-- It is also the easiest. So, handle it completly now.
if Get_Identifier (Formal) = Get_Identifier (Inter) then
@@ -1569,7 +1571,7 @@ package body Sem_Assocs is
-- Can be associated only once
Match := Fully_Compatible;
else
- if Get_Kind (Formal) = Iir_Kind_Simple_Name
+ if Kind_In (Formal, Iir_Kind_Simple_Name, Iir_Kind_Operator_Symbol)
and then Get_Identifier (Formal) = Get_Identifier (Inter)
then
Match := Fully_Compatible;
@@ -1584,7 +1586,6 @@ package body Sem_Assocs is
Formal : constant Iir := Get_Formal (Assoc);
begin
if Formal /= Null_Iir then
- pragma Assert (Get_Kind (Formal) = Iir_Kind_Simple_Name);
pragma Assert (Get_Identifier (Formal) = Get_Identifier (Inter));
Set_Named_Entity (Formal, Inter);
Set_Base_Name (Formal, Inter);