This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Project parser improvements


Tested on i686-linux, committed on trunk

Firstly, add a warning for misspelled package names in project files:
When a package name in a project file is unknown, in non verbose mode,
there is no longer a warning, except when the name is a possible
misspelling of a known package. In verbose mode, ther is always a
warning, icluding for a possible misspelling.

The test for this is to invoke gnatmake on a project file with packages
Make and Conpiler. When gnatmake is incoked without -q or -v, there
should not be any warning for package Make, but there should be one for
package Conpiler, indicating a possible misspelling of "compiler". When
gnatmake is invoked with -v, there should be also a warning for package
Make.

Then, allow limited withs in all configuration:
In some configurations, the Project Manager was not behaving correctly
when limited withs were used. This patch ensures that all legitimate
uses of limited work as expected.

The test for this is to have a main project A that imports a project B
with a limited with. Project B imports project A with a simple with and
makes reference to a variable in project A.

Finally: allow variable references in indirectly extended project:
The Project Manager is enhanced: declarations in a project being extended
indirectly may be referenced.

The following project tree should be accepted:

project Grandfather is
   Foo := "Something";
   for Source_Dirs use ();
end Grandfather;

project Father extends "grandfather" is
   Bar := Grandfather.Foo;
   for Source_Dirs use ();
end Father;

project Child extends "father" is
   Baz := Father.Bar;
   Bar := Grandfather.Foo;
end Child;

2008-03-26  Vincent Celier  <celier@adacore.com>

	* prj-dect.adb (Parse_Package_Declaration): When a package name is not
	known, check if it may be a missspelling of a known package name. In
	not verbose, not mode, issue warnings only if the package name is a
	possible misspelling.
	In verbose mode, always issue a warning for a not known package name,
	plus a warning if the name is a misspelling of a known package name.

	* prj-part.adb (Post_Parse_Context_Clause): Modify so that only non
	limited withs or limited withs are parse during one call.
	(Parse_Single_Project): Post parse context clause in two passes: non
	limited withs before current project and limited withs after current
	project.

	* prj-proc.adb (Imported_Or_Extended_Project_From): Returns an extended
	project with the name With_Name, even if it is only extended indirectly.
	(Recursive_Process): Process projects in order: first single withs, then
	current project, then limited withs.

	* prj-tree.adb (Imported_Or_Extended_Project_Of): Returns an extended
	project with the name With_Name, even if it is only extended indirectly.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]