Commit 483c78cb by Robert Dewar Committed by Arnaud Charlet

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
parent 4e7a4f6e
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> 2009-05-06 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: For Misnamed_Identifiers rule all description of the * gnat_ugn.texi: For Misnamed_Identifiers rule all description of the
......
...@@ -53,9 +53,9 @@ with Uname; use Uname; ...@@ -53,9 +53,9 @@ with Uname; use Uname;
package body Errout is package body Errout is
Errors_Must_Be_Ignored : Boolean := False; Errors_Must_Be_Ignored : Boolean := False;
-- Set to True by procedure Set_Ignore_Errors (True), when calls to -- Set to True by procedure Set_Ignore_Errors (True), when calls to error
-- error message procedures should be ignored (when parsing irrelevant -- message procedures should be ignored (when parsing irrelevant text in
-- text in sources being preprocessed). -- sources being preprocessed).
Finalize_Called : Boolean := False; Finalize_Called : Boolean := False;
-- Set True if the Finalize routine has been called -- Set True if the Finalize routine has been called
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -607,7 +607,8 @@ package body Ch4 is ...@@ -607,7 +607,8 @@ package body Ch4 is
elsif Token = Tok_Range then elsif Token = Tok_Range then
if Expr_Form /= EF_Simple_Name 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; raise Error_Resync;
end if; end if;
......
...@@ -1302,7 +1302,8 @@ package body Ch6 is ...@@ -1302,7 +1302,8 @@ package body Ch6 is
end if; end if;
if Token = Tok_In then 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 Scan; -- past IN
Set_In_Present (Node, True); Set_In_Present (Node, True);
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -818,7 +818,7 @@ begin ...@@ -818,7 +818,7 @@ begin
and then Num_SRef_Pragmas (Current_Source_File) = 0 and then Num_SRef_Pragmas (Current_Source_File) = 0
and then Operating_Mode /= Check_Syntax and then Operating_Mode /= Check_Syntax
then then
Error_Msg Error_Msg -- CODEFIX
("first % pragma must be first line of file", Pragma_Sloc); ("first % pragma must be first line of file", Pragma_Sloc);
raise Error_Resync; raise Error_Resync;
end if; end if;
......
...@@ -163,7 +163,8 @@ package body Util is ...@@ -163,7 +163,8 @@ package body Util is
if RM_Column_Check and then Token_Is_At_Start_Of_Line if RM_Column_Check and then Token_Is_At_Start_Of_Line
and then Start_Column <= Scope.Table (Scope.Last).Ecol and then Start_Column <= Scope.Table (Scope.Last).Ecol
then then
Error_Msg_BC ("(style) incorrect layout"); Error_Msg_BC -- CODEFIX
("(style) incorrect layout");
end if; end if;
end Check_Bad_Layout; end Check_Bad_Layout;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -377,19 +377,19 @@ package body Scng is ...@@ -377,19 +377,19 @@ package body Scng is
if Source (Scan_Ptr) = '_' then if Source (Scan_Ptr) = '_' then
if Source (Scan_Ptr - 1) = '_' then if Source (Scan_Ptr - 1) = '_' then
Error_Msg_S Error_Msg_S -- CODEFIX
("two consecutive underlines not permitted"); ("two consecutive underlines not permitted");
else else
Error_Msg_S Error_Msg_S -- CODEFIX???
("underline cannot follow punctuation character"); ("underline cannot follow punctuation character");
end if; end if;
else else
if Source (Scan_Ptr - 1) = '_' then if Source (Scan_Ptr - 1) = '_' then
Error_Msg_S Error_Msg_S -- CODEFIX???
("punctuation character cannot follow underline"); ("punctuation character cannot follow underline");
else else
Error_Msg_S Error_Msg_S -- CODEFIX???
("two consecutive punctuation characters not permitted"); ("two consecutive punctuation characters not permitted");
end if; end if;
end if; end if;
......
...@@ -3480,36 +3480,36 @@ package body Sem_Ch6 is ...@@ -3480,36 +3480,36 @@ package body Sem_Ch6 is
case Ctype is case Ctype is
when Type_Conformant => when Type_Conformant =>
Error_Msg_N Error_Msg_N -- CODEFIX
("not type conformant with declaration#!", Enode); ("not type conformant with declaration#!", Enode);
when Mode_Conformant => when Mode_Conformant =>
if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then
Error_Msg_N Error_Msg_N -- CODEFIX???
("not mode conformant with operation inherited#!", ("not mode conformant with operation inherited#!",
Enode); Enode);
else else
Error_Msg_N Error_Msg_N -- CODEFIX???
("not mode conformant with declaration#!", Enode); ("not mode conformant with declaration#!", Enode);
end if; end if;
when Subtype_Conformant => when Subtype_Conformant =>
if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then
Error_Msg_N Error_Msg_N -- CODEFIX???
("not subtype conformant with operation inherited#!", ("not subtype conformant with operation inherited#!",
Enode); Enode);
else else
Error_Msg_N Error_Msg_N -- CODEFIX???
("not subtype conformant with declaration#!", Enode); ("not subtype conformant with declaration#!", Enode);
end if; end if;
when Fully_Conformant => when Fully_Conformant =>
if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then if Nkind (Parent (Old_Id)) = N_Full_Type_Declaration then
Error_Msg_N Error_Msg_N -- CODEFIX
("not fully conformant with operation inherited#!", ("not fully conformant with operation inherited#!",
Enode); Enode);
else else
Error_Msg_N Error_Msg_N -- CODEFIX
("not fully conformant with declaration#!", Enode); ("not fully conformant with declaration#!", Enode);
end if; end if;
end case; end case;
...@@ -4157,7 +4157,8 @@ package body Sem_Ch6 is ...@@ -4157,7 +4157,8 @@ package body Sem_Ch6 is
procedure Conformance_Error (Msg : String; N : Node_Id) is procedure Conformance_Error (Msg : String; N : Node_Id) is
begin begin
Error_Msg_Sloc := Sloc (Prev_Loc); 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); Error_Msg_NE (Msg, N, N);
end Conformance_Error; end Conformance_Error;
......
...@@ -2581,11 +2581,12 @@ package body Sem_Ch8 is ...@@ -2581,11 +2581,12 @@ package body Sem_Ch8 is
and then Etype (Pack) /= Any_Type and then Etype (Pack) /= Any_Type
then then
if Ekind (Pack) = E_Generic_Package 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", ("a generic package is not allowed in a use clause",
Pack_Name); Pack_Name);
else else
Error_Msg_N ("& is not a usable package", Pack_Name); Error_Msg_N -- CODEFIX???
("& is not a usable package", Pack_Name);
end if; end if;
else else
...@@ -3781,7 +3782,8 @@ package body Sem_Ch8 is ...@@ -3781,7 +3782,8 @@ package body Sem_Ch8 is
if Is_Hidden (Ent) then if Is_Hidden (Ent) then
Error_Msg_N ("non-visible (private) declaration#!", N); Error_Msg_N ("non-visible (private) declaration#!", N);
else else
Error_Msg_N ("non-visible declaration#!", N); Error_Msg_N -- CODEFIX
("non-visible declaration#!", N);
if Is_Compilation_Unit (Ent) if Is_Compilation_Unit (Ent)
and then and then
......
...@@ -3106,7 +3106,7 @@ package body Sem_Prag is ...@@ -3106,7 +3106,7 @@ package body Sem_Prag is
Prag_Id = Pragma_Import_Valued_Procedure Prag_Id = Pragma_Import_Valued_Procedure
then then
if not Is_Imported (Ent) then if not Is_Imported (Ent) then
Error_Pragma Error_Pragma -- CODEFIX???
("pragma Import or Interface must precede pragma%"); ("pragma Import or Interface must precede pragma%");
end if; end if;
......
...@@ -1996,7 +1996,7 @@ package body Sem_Res is ...@@ -1996,7 +1996,7 @@ package body Sem_Res is
("ambiguous expression " ("ambiguous expression "
& "(cannot resolve indirect call)!", N); & "(cannot resolve indirect call)!", N);
else else
Error_Msg_NE Error_Msg_NE -- CODEFIX
("ambiguous expression (cannot resolve&)!", ("ambiguous expression (cannot resolve&)!",
N, It.Nam); N, It.Nam);
end if; end if;
...@@ -8288,7 +8288,7 @@ package body Sem_Res is ...@@ -8288,7 +8288,7 @@ package body Sem_Res is
and then Covers (Orig_T, Etype (Entity (Orig_N))))) and then Covers (Orig_T, Etype (Entity (Orig_N)))))
then then
Error_Msg_Node_2 := Orig_T; Error_Msg_Node_2 := Orig_T;
Error_Msg_NE Error_Msg_NE -- CODEFIX
("?redundant conversion, & is of type &!", N, Entity (Orig_N)); ("?redundant conversion, & is of type &!", N, Entity (Orig_N));
end if; end if;
end if; end if;
......
...@@ -1005,7 +1005,7 @@ package body Sem_Warn is ...@@ -1005,7 +1005,7 @@ package body Sem_Warn is
and then not Has_Pragma_Unmodified_Check_Spec (E1) and then not Has_Pragma_Unmodified_Check_Spec (E1)
then then
if not Warnings_Off_E1 then if not Warnings_Off_E1 then
Error_Msg_N Error_Msg_N -- CODEFIX
("?& is not modified, " ("?& is not modified, "
& "could be declared constant!", & "could be declared constant!",
E1); E1);
...@@ -1155,7 +1155,7 @@ package body Sem_Warn is ...@@ -1155,7 +1155,7 @@ package body Sem_Warn is
elsif not Has_Unreferenced (E1) elsif not Has_Unreferenced (E1)
and then not Warnings_Off_E1 and then not Warnings_Off_E1
then then
Output_Reference_Error Output_Reference_Error -- CODEFIX
("?variable& is never read and never assigned!"); ("?variable& is never read and never assigned!");
end if; end if;
...@@ -2342,7 +2342,7 @@ package body Sem_Warn is ...@@ -2342,7 +2342,7 @@ package body Sem_Warn is
end if; end if;
if not Is_Visible_Renaming then if not Is_Visible_Renaming then
Error_Msg_N Error_Msg_N -- CODEFIX
("\?with clause might be moved to body!", ("\?with clause might be moved to body!",
Name (Item)); Name (Item));
end if; end if;
...@@ -2370,7 +2370,7 @@ package body Sem_Warn is ...@@ -2370,7 +2370,7 @@ package body Sem_Warn is
if Unit = Spec_Unit then if Unit = Spec_Unit then
Set_Unreferenced_In_Spec (Item); Set_Unreferenced_In_Spec (Item);
else else
Error_Msg_N Error_Msg_N -- CODEFIX
("?unit& is never instantiated!", Name (Item)); ("?unit& is never instantiated!", Name (Item));
end if; end if;
...@@ -2381,7 +2381,7 @@ package body Sem_Warn is ...@@ -2381,7 +2381,7 @@ package body Sem_Warn is
elsif Unreferenced_In_Spec (Item) then elsif Unreferenced_In_Spec (Item) then
Error_Msg_N Error_Msg_N
("?unit& is not instantiated in spec!", Name (Item)); ("?unit& is not instantiated in spec!", Name (Item));
Error_Msg_N Error_Msg_N -- CODEFIX
("\?with clause can be moved to body!", Name (Item)); ("\?with clause can be moved to body!", Name (Item));
end if; end if;
end if; end if;
...@@ -3782,7 +3782,7 @@ package body Sem_Warn is ...@@ -3782,7 +3782,7 @@ package body Sem_Warn is
and then No (Renamed_Object (E)) and then No (Renamed_Object (E))
then then
if not Has_Pragma_Unmodified_Check_Spec (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); ("?variable & is assigned but never read!", E);
end if; end if;
...@@ -3871,11 +3871,11 @@ package body Sem_Warn is ...@@ -3871,11 +3871,11 @@ package body Sem_Warn is
Error_Msg_N ("?procedure & is not referenced!", E); Error_Msg_N ("?procedure & is not referenced!", E);
when E_Generic_Procedure => when E_Generic_Procedure =>
Error_Msg_N Error_Msg_N -- CODEFIX
("?generic procedure & is never instantiated!", E); ("?generic procedure & is never instantiated!", E);
when E_Generic_Function => when E_Generic_Function =>
Error_Msg_N Error_Msg_N -- CODEFIX
("?generic function & is never instantiated!", E); ("?generic function & is never instantiated!", E);
when Type_Kind => when Type_Kind =>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -145,7 +145,8 @@ package body Styleg is ...@@ -145,7 +145,8 @@ package body Styleg is
begin begin
if Style_Check_Attribute_Casing then if Style_Check_Attribute_Casing then
if Determine_Token_Casing /= Mixed_Case 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 if; end if;
end Check_Attribute_Name; end Check_Attribute_Name;
...@@ -379,7 +380,8 @@ package body Styleg is ...@@ -379,7 +380,8 @@ package body Styleg is
if Style_Check_Indentation /= 0 then if Style_Check_Indentation /= 0 then
if Start_Column rem Style_Check_Indentation /= 0 then if Start_Column rem Style_Check_Indentation /= 0 then
if not Same_Column_As_Next_Non_Blank_Line 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; end if;
return; return;
...@@ -656,7 +658,7 @@ package body Styleg is ...@@ -656,7 +658,7 @@ package body Styleg is
else else
if Style_Check_Blank_Lines and then Blank_Lines > 1 then if Style_Check_Blank_Lines and then Blank_Lines > 1 then
Error_Msg Error_Msg -- CODEFIX
("(style) multiple blank lines", Blank_Line_Location); ("(style) multiple blank lines", Blank_Line_Location);
end if; end if;
...@@ -720,7 +722,8 @@ package body Styleg is ...@@ -720,7 +722,8 @@ package body Styleg is
begin begin
if Style_Check_Pragma_Casing then if Style_Check_Pragma_Casing then
if Determine_Token_Casing /= Mixed_Case 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 if; end if;
end Check_Pragma_Name; end Check_Pragma_Name;
...@@ -978,7 +981,8 @@ package body Styleg is ...@@ -978,7 +981,8 @@ package body Styleg is
procedure Non_Lower_Case_Keyword is procedure Non_Lower_Case_Keyword is
begin begin
if Style_Check_Keyword_Casing then 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 if;
end Non_Lower_Case_Keyword; end Non_Lower_Case_Keyword;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment