aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-05-15 07:29:31 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-15 07:29:31 +0200
commit3d528d7ce6dc1848286c951dc7851f4361170a5b (patch)
tree2611cf4cdb52f95c5629bf2909b5e21eae83f0ea
parentf38a46391774535b60befc707b088b8dab43adcd (diff)
downloadghdl-3d528d7ce6dc1848286c951dc7851f4361170a5b.tar.gz
ghdl-3d528d7ce6dc1848286c951dc7851f4361170a5b.tar.bz2
ghdl-3d528d7ce6dc1848286c951dc7851f4361170a5b.zip
vhdl-parse: strenghten.
-rw-r--r--src/vhdl/vhdl-parse.adb22
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);