diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-05-15 07:29:31 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-05-15 07:29:31 +0200 |
commit | 3d528d7ce6dc1848286c951dc7851f4361170a5b (patch) | |
tree | 2611cf4cdb52f95c5629bf2909b5e21eae83f0ea /src/vhdl | |
parent | f38a46391774535b60befc707b088b8dab43adcd (diff) | |
download | ghdl-3d528d7ce6dc1848286c951dc7851f4361170a5b.tar.gz ghdl-3d528d7ce6dc1848286c951dc7851f4361170a5b.tar.bz2 ghdl-3d528d7ce6dc1848286c951dc7851f4361170a5b.zip |
vhdl-parse: strenghten.
Diffstat (limited to 'src/vhdl')
-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); |