errout.adb: Minor reformatting

2009-05-06  Robert Dewar  <dewar@adacore.com>

	* errout.adb: Minor reformatting

	* scng.adb, sem_prag.adb, par-ch4.adb, sem_res.adb, par-ch6.adb,
	sem_ch6.adb, par-prag.adb, sem_ch8.adb, sem_warn.adb, par-util.adb,
	styleg.adb: Add stylized comments to error messages that are included
	in the codefix circuitry of IDE's such as GPS.

From-SVN: r147173
This commit is contained in:
Robert Dewar 2009-05-06 12:53:27 +00:00 committed by Arnaud Charlet
parent 4e7a4f6e8a
commit 483c78cb8e
13 changed files with 61 additions and 42 deletions

View File

@ -1,3 +1,12 @@
2009-05-06 Robert Dewar <dewar@adacore.com>
* errout.adb: Minor reformatting
* scng.adb, sem_prag.adb, par-ch4.adb, sem_res.adb, par-ch6.adb,
sem_ch6.adb, par-prag.adb, sem_ch8.adb, sem_warn.adb, par-util.adb,
styleg.adb: Add stylized comments to error messages that are included
in the codefix circuitry of IDE's such as GPS.
2009-05-06 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: For Misnamed_Identifiers rule all description of the

View File

@ -53,9 +53,9 @@ with Uname; use Uname;
package body Errout is
Errors_Must_Be_Ignored : Boolean := False;
-- Set to True by procedure Set_Ignore_Errors (True), when calls to
-- error message procedures should be ignored (when parsing irrelevant
-- text in sources being preprocessed).
-- Set to True by procedure Set_Ignore_Errors (True), when calls to error
-- message procedures should be ignored (when parsing irrelevant text in
-- sources being preprocessed).
Finalize_Called : Boolean := False;
-- Set True if the Finalize routine has been called

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, 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- --
@ -607,7 +607,8 @@ package body Ch4 is
elsif Token = Tok_Range then
if Expr_Form /= EF_Simple_Name then
Error_Msg_SC ("subtype mark must precede RANGE");
Error_Msg_SC -- CODEFIX???
("subtype mark must precede RANGE");
raise Error_Resync;
end if;

View File

@ -1302,7 +1302,8 @@ package body Ch6 is
end if;
if Token = Tok_In then
Error_Msg_SC ("IN must precede OUT in parameter mode");
Error_Msg_SC -- CODEFIX ???
("IN must precede OUT in parameter mode");
Scan; -- past IN
Set_In_Present (Node, True);
end if;

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, 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- --
@ -818,7 +818,7 @@ begin
and then Num_SRef_Pragmas (Current_Source_File) = 0
and then Operating_Mode /= Check_Syntax
then
Error_Msg
Error_Msg -- CODEFIX
("first % pragma must be first line of file", Pragma_Sloc);
raise Error_Resync;
end if;

View File

@ -163,7 +163,8 @@ package body Util is
if RM_Column_Check and then Token_Is_At_Start_Of_Line
and then Start_Column <= Scope.Table (Scope.Last).Ecol
then
Error_Msg_BC ("(style) incorrect layout");
Error_Msg_BC -- CODEFIX
("(style) incorrect layout");
end if;
end Check_Bad_Layout;

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, 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- --
@ -377,19 +377,19 @@ package body Scng is
if Source (Scan_Ptr) = '_' then
if Source (Scan_Ptr - 1) = '_' then
Error_Msg_S
Error_Msg_S -- CODEFIX
("two consecutive underlines not permitted");
else
Error_Msg_S
Error_Msg_S -- CODEFIX???
("underline cannot follow punctuation character");
end if;
else
if Source (Scan_Ptr - 1) = '_' then
Error_Msg_S
Error_Msg_S -- CODEFIX???
("punctuation character cannot follow underline");
else
Error_Msg_S
Error_Msg_S -- CODEFIX???
("two consecutive punctuation characters not permitted");
end if;
end if;

View File

@ -3480,36 +3480,36 @@ package body Sem_Ch6 is
case Ctype is
when Type_Conformant =>
Error_Msg_N
Error_Msg_N -- CODEFIX
("not type conformant with declaration#!", Enode);
when Mode_Conformant =>
if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then
Error_Msg_N
Error_Msg_N -- CODEFIX???
("not mode conformant with operation inherited#!",
Enode);
else
Error_Msg_N
Error_Msg_N -- CODEFIX???
("not mode conformant with declaration#!", Enode);
end if;
when Subtype_Conformant =>
if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then
Error_Msg_N
Error_Msg_N -- CODEFIX???
("not subtype conformant with operation inherited#!",
Enode);
else
Error_Msg_N
Error_Msg_N -- CODEFIX???
("not subtype conformant with declaration#!", Enode);
end if;
when Fully_Conformant =>
if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then
Error_Msg_N
Error_Msg_N -- CODEFIX
("not fully conformant with operation inherited#!",
Enode);
else
Error_Msg_N
Error_Msg_N -- CODEFIX
("not fully conformant with declaration#!", Enode);
end if;
end case;
@ -4157,7 +4157,8 @@ package body Sem_Ch6 is
procedure Conformance_Error (Msg : String; N : Node_Id) is
begin
Error_Msg_Sloc := Sloc (Prev_Loc);
Error_Msg_N ("not fully conformant with declaration#!", N);
Error_Msg_N -- CODEFIX
("not fully conformant with declaration#!", N);
Error_Msg_NE (Msg, N, N);
end Conformance_Error;

View File

@ -2581,11 +2581,12 @@ package body Sem_Ch8 is
and then Etype (Pack) /= Any_Type
then
if Ekind (Pack) = E_Generic_Package then
Error_Msg_N
Error_Msg_N -- CODEFIX
("a generic package is not allowed in a use clause",
Pack_Name);
else
Error_Msg_N ("& is not a usable package", Pack_Name);
Error_Msg_N -- CODEFIX???
("& is not a usable package", Pack_Name);
end if;
else
@ -3781,7 +3782,8 @@ package body Sem_Ch8 is
if Is_Hidden (Ent) then
Error_Msg_N ("non-visible (private) declaration#!", N);
else
Error_Msg_N ("non-visible declaration#!", N);
Error_Msg_N -- CODEFIX
("non-visible declaration#!", N);
if Is_Compilation_Unit (Ent)
and then

View File

@ -3106,7 +3106,7 @@ package body Sem_Prag is
Prag_Id = Pragma_Import_Valued_Procedure
then
if not Is_Imported (Ent) then
Error_Pragma
Error_Pragma -- CODEFIX???
("pragma Import or Interface must precede pragma%");
end if;

View File

@ -1996,7 +1996,7 @@ package body Sem_Res is
("ambiguous expression "
& "(cannot resolve indirect call)!", N);
else
Error_Msg_NE
Error_Msg_NE -- CODEFIX
("ambiguous expression (cannot resolve&)!",
N, It.Nam);
end if;
@ -8288,7 +8288,7 @@ package body Sem_Res is
and then Covers (Orig_T, Etype (Entity (Orig_N)))))
then
Error_Msg_Node_2 := Orig_T;
Error_Msg_NE
Error_Msg_NE -- CODEFIX
("?redundant conversion, & is of type &!", N, Entity (Orig_N));
end if;
end if;

View File

@ -1005,7 +1005,7 @@ package body Sem_Warn is
and then not Has_Pragma_Unmodified_Check_Spec (E1)
then
if not Warnings_Off_E1 then
Error_Msg_N
Error_Msg_N -- CODEFIX
("?& is not modified, "
& "could be declared constant!",
E1);
@ -1155,7 +1155,7 @@ package body Sem_Warn is
elsif not Has_Unreferenced (E1)
and then not Warnings_Off_E1
then
Output_Reference_Error
Output_Reference_Error -- CODEFIX
("?variable& is never read and never assigned!");
end if;
@ -2342,7 +2342,7 @@ package body Sem_Warn is
end if;
if not Is_Visible_Renaming then
Error_Msg_N
Error_Msg_N -- CODEFIX
("\?with clause might be moved to body!",
Name (Item));
end if;
@ -2370,7 +2370,7 @@ package body Sem_Warn is
if Unit = Spec_Unit then
Set_Unreferenced_In_Spec (Item);
else
Error_Msg_N
Error_Msg_N -- CODEFIX
("?unit& is never instantiated!", Name (Item));
end if;
@ -2381,7 +2381,7 @@ package body Sem_Warn is
elsif Unreferenced_In_Spec (Item) then
Error_Msg_N
("?unit& is not instantiated in spec!", Name (Item));
Error_Msg_N
Error_Msg_N -- CODEFIX
("\?with clause can be moved to body!", Name (Item));
end if;
end if;
@ -3782,7 +3782,7 @@ package body Sem_Warn is
and then No (Renamed_Object (E))
then
if not Has_Pragma_Unmodified_Check_Spec (E) then
Error_Msg_N
Error_Msg_N -- CODEFIX
("?variable & is assigned but never read!", E);
end if;
@ -3871,11 +3871,11 @@ package body Sem_Warn is
Error_Msg_N ("?procedure & is not referenced!", E);
when E_Generic_Procedure =>
Error_Msg_N
Error_Msg_N -- CODEFIX
("?generic procedure & is never instantiated!", E);
when E_Generic_Function =>
Error_Msg_N
Error_Msg_N -- CODEFIX
("?generic function & is never instantiated!", E);
when Type_Kind =>

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, 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- --
@ -145,7 +145,8 @@ package body Styleg is
begin
if Style_Check_Attribute_Casing then
if Determine_Token_Casing /= Mixed_Case then
Error_Msg_SC ("(style) bad capitalization, mixed case required");
Error_Msg_SC -- CODEFIX
("(style) bad capitalization, mixed case required");
end if;
end if;
end Check_Attribute_Name;
@ -379,7 +380,8 @@ package body Styleg is
if Style_Check_Indentation /= 0 then
if Start_Column rem Style_Check_Indentation /= 0 then
if not Same_Column_As_Next_Non_Blank_Line then
Error_Msg_S ("(style) bad column");
Error_Msg_S -- CODEFIX
("(style) bad column");
end if;
return;
@ -656,7 +658,7 @@ package body Styleg is
else
if Style_Check_Blank_Lines and then Blank_Lines > 1 then
Error_Msg
Error_Msg -- CODEFIX
("(style) multiple blank lines", Blank_Line_Location);
end if;
@ -720,7 +722,8 @@ package body Styleg is
begin
if Style_Check_Pragma_Casing then
if Determine_Token_Casing /= Mixed_Case then
Error_Msg_SC ("(style) bad capitalization, mixed case required");
Error_Msg_SC -- CODEFIX
("(style) bad capitalization, mixed case required");
end if;
end if;
end Check_Pragma_Name;
@ -978,7 +981,8 @@ package body Styleg is
procedure Non_Lower_Case_Keyword is
begin
if Style_Check_Keyword_Casing then
Error_Msg_SC ("(style) reserved words must be all lower case");
Error_Msg_SC -- CODEIX
("(style) reserved words must be all lower case");
end if;
end Non_Lower_Case_Keyword;