diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/vhdl-parse.adb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb index 993e0c9cd..f111d6cf8 100644 --- a/src/vhdl/vhdl-parse.adb +++ b/src/vhdl/vhdl-parse.adb @@ -7269,16 +7269,20 @@ package body Vhdl.Parse is Set_Start_Location (Subprg, Start_Loc); end if; - if Current_Token /= Tok_Is then - -- Skip ';'. - Expect_Scan (Tok_Semi_Colon); - - return Subprg; - end if; + case Current_Token is + when Tok_Is => + -- Skip 'is'. + Is_Loc := Get_Token_Location; + Scan; + when Tok_Begin => + Error_Msg_Parse ("missing 'is' before 'begin'"); + Is_Loc := Get_Token_Location; + when others => + -- Skip ';'. + Expect_Scan (Tok_Semi_Colon); - -- Skip 'is'. - Is_Loc := Get_Token_Location; - Scan; + return Subprg; + end case; -- The body. Set_Has_Body (Subprg, True); |