prj-dect.adb (Parse_Attribute_Declaration): Do not issue warning for unknown attribute in unknown package or in package...
2006-10-31 Vincent Celier <celier@adacore.com> * prj-dect.adb (Parse_Attribute_Declaration): Do not issue warning for unknown attribute in unknown package or in package that does not need to be checked. (Parse_Package_Declaration): Do not issue warning for unknown package in quiet output. From-SVN: r118291
This commit is contained in:
parent
529c27463f
commit
aa1c3df226
|
@ -6,7 +6,7 @@
|
||||||
-- --
|
-- --
|
||||||
-- B o d y --
|
-- B o d y --
|
||||||
-- --
|
-- --
|
||||||
-- Copyright (C) 2001-2005, Free Software Foundation, Inc --
|
-- Copyright (C) 2001-2006, 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- --
|
||||||
|
@ -142,7 +142,7 @@ package body Prj.Dect is
|
||||||
Attribute_Name : Name_Id := No_Name;
|
Attribute_Name : Name_Id := No_Name;
|
||||||
Optional_Index : Boolean := False;
|
Optional_Index : Boolean := False;
|
||||||
Pkg_Id : Package_Node_Id := Empty_Package;
|
Pkg_Id : Package_Node_Id := Empty_Package;
|
||||||
Warning : Boolean := False;
|
Ignore : Boolean := False;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Attribute :=
|
Attribute :=
|
||||||
|
@ -183,17 +183,15 @@ package body Prj.Dect is
|
||||||
then
|
then
|
||||||
Pkg_Id := Package_Id_Of (Current_Package, In_Tree);
|
Pkg_Id := Package_Id_Of (Current_Package, In_Tree);
|
||||||
Add_Attribute (Pkg_Id, Token_Name, Current_Attribute);
|
Add_Attribute (Pkg_Id, Token_Name, Current_Attribute);
|
||||||
Error_Msg_Name_1 := Token_Name;
|
|
||||||
Error_Msg ("?unknown attribute {", Token_Ptr);
|
|
||||||
|
|
||||||
else
|
else
|
||||||
-- If not a valid attribute name, issue an error, or a warning
|
-- If not a valid attribute name, issue an error if inside
|
||||||
-- if inside a package that does not need to be checked.
|
-- a package that need to be checked.
|
||||||
|
|
||||||
Warning := Current_Package /= Empty_Node and then
|
Ignore := Current_Package /= Empty_Node and then
|
||||||
Packages_To_Check /= All_Packages;
|
Packages_To_Check /= All_Packages;
|
||||||
|
|
||||||
if Warning then
|
if Ignore then
|
||||||
|
|
||||||
-- Check that we are not in a package to check
|
-- Check that we are not in a package to check
|
||||||
|
|
||||||
|
@ -203,15 +201,16 @@ package body Prj.Dect is
|
||||||
if Name_Buffer (1 .. Name_Len) =
|
if Name_Buffer (1 .. Name_Len) =
|
||||||
Packages_To_Check (Index).all
|
Packages_To_Check (Index).all
|
||||||
then
|
then
|
||||||
Warning := False;
|
Ignore := False;
|
||||||
exit;
|
exit;
|
||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
Error_Msg_Name_1 := Token_Name;
|
if not Ignore then
|
||||||
Error_Msg_Warn := Warning;
|
Error_Msg_Name_1 := Token_Name;
|
||||||
Error_Msg ("<undefined attribute {", Token_Ptr);
|
Error_Msg ("undefined attribute {", Token_Ptr);
|
||||||
|
end if;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Set, if appropriate the index case insensitivity flag
|
-- Set, if appropriate the index case insensitivity flag
|
||||||
|
@ -920,11 +919,13 @@ package body Prj.Dect is
|
||||||
Current_Package : Package_Node_Id := Empty_Package;
|
Current_Package : Package_Node_Id := Empty_Package;
|
||||||
First_Declarative_Item : Project_Node_Id := Empty_Node;
|
First_Declarative_Item : Project_Node_Id := Empty_Node;
|
||||||
|
|
||||||
|
Package_Location : constant Source_Ptr := Token_Ptr;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Package_Declaration :=
|
Package_Declaration :=
|
||||||
Default_Project_Node
|
Default_Project_Node
|
||||||
(Of_Kind => N_Package_Declaration, In_Tree => In_Tree);
|
(Of_Kind => N_Package_Declaration, In_Tree => In_Tree);
|
||||||
Set_Location_Of (Package_Declaration, In_Tree, To => Token_Ptr);
|
Set_Location_Of (Package_Declaration, In_Tree, To => Package_Location);
|
||||||
|
|
||||||
-- Scan past "package"
|
-- Scan past "package"
|
||||||
|
|
||||||
|
@ -940,11 +941,13 @@ package body Prj.Dect is
|
||||||
First_Attribute := First_Attribute_Of (Current_Package);
|
First_Attribute := First_Attribute_Of (Current_Package);
|
||||||
|
|
||||||
else
|
else
|
||||||
Error_Msg ("?""" &
|
if not Quiet_Output then
|
||||||
Get_Name_String
|
Error_Msg ("?""" &
|
||||||
(Name_Of (Package_Declaration, In_Tree)) &
|
Get_Name_String
|
||||||
""" is not a known package name",
|
(Name_Of (Package_Declaration, In_Tree)) &
|
||||||
Token_Ptr);
|
""" is not a known package name",
|
||||||
|
Token_Ptr);
|
||||||
|
end if;
|
||||||
|
|
||||||
-- Set the package declaration to "ignored" so that it is not
|
-- Set the package declaration to "ignored" so that it is not
|
||||||
-- processed by Prj.Proc.Process.
|
-- processed by Prj.Proc.Process.
|
||||||
|
@ -1004,6 +1007,7 @@ package body Prj.Dect is
|
||||||
if Token = Tok_Identifier then
|
if Token = Tok_Identifier then
|
||||||
declare
|
declare
|
||||||
Project_Name : constant Name_Id := Token_Name;
|
Project_Name : constant Name_Id := Token_Name;
|
||||||
|
|
||||||
Clause : Project_Node_Id :=
|
Clause : Project_Node_Id :=
|
||||||
First_With_Clause_Of (Current_Project, In_Tree);
|
First_With_Clause_Of (Current_Project, In_Tree);
|
||||||
The_Project : Project_Node_Id := Empty_Node;
|
The_Project : Project_Node_Id := Empty_Node;
|
||||||
|
|
Loading…
Reference in New Issue