aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/parse.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/parse.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/parse.adb')
-rw-r--r--src/vhdl/parse.adb18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index 52bd5a34d..31af2556d 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -6642,23 +6642,27 @@ package body Parse is
return Res;
end Parse_Process_Statement;
- procedure Check_Formal_Form (Formal : Iir) is
+ function Check_Formal_Form (Formal : Iir) return Iir is
begin
if Formal = Null_Iir then
- return;
+ return Formal;
end if;
case Get_Kind (Formal) is
when Iir_Kind_Simple_Name
| Iir_Kind_Slice_Name
| Iir_Kind_Selected_Name =>
- null;
+ return Formal;
when Iir_Kind_Parenthesis_Name =>
-- Could be an indexed name, so nothing to check within the
-- parenthesis.
- null;
+ return Formal;
+ when Iir_Kind_String_Literal8 =>
+ -- Operator designator
+ return String_To_Operator_Symbol (Formal);
when others =>
- Error_Msg_Parse (+Formal, "incorrect formal name");
+ Error_Msg_Parse (+Formal, "incorrect formal name ignored");
+ return Null_Iir;
end case;
end Check_Formal_Form;
@@ -6736,10 +6740,8 @@ package body Parse is
end if;
when Tok_Double_Arrow =>
- Formal := Actual;
-
-- Check that FORMAL is a name and not an expression.
- Check_Formal_Form (Formal);
+ Formal := Check_Formal_Form (Actual);
-- Skip '=>'
Scan;