summaryrefslogtreecommitdiff
path: root/src/vhdl/parse.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/parse.adb')
-rw-r--r--src/vhdl/parse.adb23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index 2991e07..d456131 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -6140,6 +6140,26 @@ package body Parse is
return Res;
end Parse_Process_Statement;
+ procedure Check_Formal_Form (Formal : Iir) is
+ begin
+ if Formal = Null_Iir then
+ return;
+ end if;
+
+ case Get_Kind (Formal) is
+ when Iir_Kind_Simple_Name
+ | Iir_Kind_Slice_Name
+ | Iir_Kind_Selected_Name =>
+ null;
+ when Iir_Kind_Parenthesis_Name =>
+ -- Could be an indexed name, so nothing to check within the
+ -- parenthesis.
+ null;
+ when others =>
+ Error_Msg_Parse ("incorrect formal name", Formal);
+ end case;
+ end Check_Formal_Form;
+
-- precond : NEXT_TOKEN
-- postcond: NEXT_TOKEN
--
@@ -6216,6 +6236,9 @@ package body Parse is
when Tok_Double_Arrow =>
Formal := Actual;
+ -- Check that FORMAL is a name and not an expression.
+ Check_Formal_Form (Formal);
+
-- Skip '=>'
Scan;
Loc := Get_Token_Location;