aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-parse.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl/vhdl-parse.adb')
-rw-r--r--src/vhdl/vhdl-parse.adb12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb
index d227d9b9f..36750870f 100644
--- a/src/vhdl/vhdl-parse.adb
+++ b/src/vhdl/vhdl-parse.adb
@@ -3711,6 +3711,18 @@ package body Vhdl.Parse is
-- Skip ':'.
Expect_Scan (Tok_Colon);
+ -- Skip unexpected mode, this could happen when the interface is
+ -- copied.
+ case Current_Token is
+ when Tok_In | Tok_Out | Tok_Inout | Tok_Buffer | Tok_Linkage =>
+ Error_Msg_Parse ("mode not allowed in object declaration");
+
+ -- Skip mode.
+ Scan;
+ when others =>
+ null;
+ end case;
+
Object_Type := Parse_Subtype_Indication;
if Kind = Iir_Kind_Signal_Declaration then