+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
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
-- --
-- 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- --
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;
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;
-- --
-- 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- --
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;
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;
-- --
-- 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- --
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;
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;
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;
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
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
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;
("ambiguous expression "
& "(cannot resolve indirect call)!", N);
else
- Error_Msg_NE
+ Error_Msg_NE -- CODEFIX
("ambiguous expression (cannot resolve&)!",
N, It.Nam);
end if;
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;
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);
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;
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;
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;
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;
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;
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 =>
-- --
-- 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- --
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;
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;
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;
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;
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;