-- --
-- B o d y --
-- --
--- $Revision: 1.37 $
--- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 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- --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- A little recovery helper, accept then in place of =>
elsif Token = Tok_Then then
- Error_Msg_BC ("missing ""=>""");
+ Error_Msg_BC ("missing ""='>""");
Scan; -- past THEN used in place of =>
elsif Token = Tok_Colon_Equal then
- Error_Msg_SC (""":="" should be ""=>""");
+ Error_Msg_SC (""":="" should be ""='>""");
Scan; -- past := used in place of =>
else
- Error_Msg_AP ("missing ""=>""");
+ Error_Msg_AP ("missing ""='>""");
end if;
end T_Arrow;
if Token = Tok_Box then
Scan;
else
- Error_Msg_AP ("missing ""<>""");
+ Error_Msg_AP ("missing ""'<'>""");
end if;
end T_Box;
if Token = Tok_Greater_Greater then
Scan;
else
- Error_Msg_AP ("missing "">>""");
+ Error_Msg_AP ("missing ""'>'>""");
end if;
end T_Greater_Greater;
Scan;
end if;
+ return;
+
elsif Token = Tok_Colon then
Error_Msg_SC (""":"" should be "";""");
Scan;
+ return;
elsif Token = Tok_Comma then
Error_Msg_SC (""","" should be "";""");
Scan;
+ return;
elsif Token = Tok_Dot then
Error_Msg_SC ("""."" should be "";""");
Scan;
+ return;
-- An interesting little kludge here. If the previous token is a
-- semicolon, then there is no way that we can legitimately need
-- place to suggest the possibility of a "C" confusion :-)
elsif Token = Tok_Vertical_Bar then
- Error_Msg_SC ("unexpected occurrence of ""|"", did you mean OR'?");
+ Error_Msg_SC ("unexpected occurrence of ""'|"", did you mean OR'?");
Resync_Past_Semicolon;
+ return;
- -- Otherwise we really do have a missing semicolon
+ -- Deal with pragma. If pragma is not at start of line, it is
+ -- considered misplaced otherwise we treat it as a normal
+ -- missing semicolong case.
- else
- Error_Msg_AP ("missing "";""");
- return;
+ elsif Token = Tok_Pragma
+ and then not Token_Is_At_Start_Of_Line
+ then
+ P_Pragmas_Misplaced;
+
+ if Token = Tok_Semicolon then
+ Scan;
+ return;
+ end if;
end if;
+ -- If none of those tests return, we really have a missing semicolon
+
+ Error_Msg_AP ("|missing "";""");
+ return;
end T_Semicolon;
------------
return;
else
- if Token = Tok_Pragma then
+ -- Deal with pragma. If pragma is not at start of line, it is
+ -- considered misplaced otherwise we treat it as a normal
+ -- missing semicolong case.
+
+ if Token = Tok_Pragma
+ and then not Token_Is_At_Start_Of_Line
+ then
P_Pragmas_Misplaced;
if Token = Tok_Semicolon then
end if;
end if;
- T_Semicolon; -- give missing semicolon message
+ -- Here we definitely have a missing semicolon, so give message
+
+ T_Semicolon;
+
+ -- Scan out junk on rest of line
+
Save_Scan_State (Scan_State); -- at start of junk tokens
loop