summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch6.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/par-ch6.adb')
-rw-r--r--gcc/ada/par-ch6.adb16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb
index 52ccea85d22..e5dc9ffff68 100644
--- a/gcc/ada/par-ch6.adb
+++ b/gcc/ada/par-ch6.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -206,7 +206,7 @@ package body Ch6 is
if Token = Tok_New then
if not Pf_Flags.Gins then
- Error_Msg_SC ("generic instantiation not allowed here!");
+ Error_Msg_SC ("generic instantation not allowed here!");
end if;
Scan; -- past NEW
@@ -1007,6 +1007,7 @@ package body Ch6 is
end;
if Token = Tok_Semicolon then
+ Save_Scan_State (Scan_State);
Scan; -- past semicolon
-- If we have RETURN or IS after the semicolon, then assume
@@ -1017,6 +1018,15 @@ package body Ch6 is
exit Specification_Loop;
end if;
+ -- If we have a declaration keyword after the semicolon, then
+ -- assume we had a missing right parenthesis and terminate list
+
+ if Token in Token_Class_Declk then
+ Error_Msg_AP ("missing "")""");
+ Restore_Scan_State (Scan_State);
+ exit Specification_Loop;
+ end if;
+
elsif Token = Tok_Right_Paren then
Scan; -- past right paren
exit Specification_Loop;
@@ -1081,7 +1091,7 @@ package body Ch6 is
end if;
if Token = Tok_In then
- Error_Msg_SC ("IN must precede OUT in parameter mode");
+ Error_Msg_SC ("IN must preceed OUT in parameter mode");
Scan; -- past IN
Set_In_Present (Node, True);
end if;