while J <= Str'Last loop
Name_Len := Name_Len + 1;
- if J <= Max
- and then Str (J .. J + Pattern'Length - 1) = Pattern
- then
+ if J <= Max and then Str (J .. J + Pattern'Length - 1) = Pattern then
Name_Buffer (Name_Len) := Replacement;
J := J + Pattern'Length;
-
else
Name_Buffer (Name_Len) := GNAT.Case_Util.To_Lower (Str (J));
J := J + 1;
-- the same file name in unrelated projects.
elsif Is_Extending (Project, Source.Project) then
- if not Locally_Removed
- and then Naming_Exception /= Inherited
+ if not Locally_Removed and then Naming_Exception /= Inherited
then
Source_To_Replace := Source;
end if;
Lang_Index.Config.Toolchain_Version :=
Element.Value.Value;
- -- For Ada, set proper checksum computation mode
+ -- For Ada, set proper checksum computation mode,
+ -- which has changed from version to version.
if Lang_Index.Name = Name_Ada then
declare
then
Checksum_GNAT_5_03 := True;
- -- Version 5.02 or earlier
+ -- Version 5.02 or earlier (no checksums)
if Vers (6) /= '5'
or else Vers (Vers'Last) < '3'
Project.Library :=
Project.Library_Dir /= No_Path_Information
- and then Project.Library_Name /= No_Name;
+ and then Project.Library_Name /= No_Name;
if Project.Extends = No_Project then
case Project.Qualifier is
Error_Msg_Warn :=
Project.Symbol_Data.Symbol_Policy /= Controlled
- and then Project.Symbol_Data.Symbol_Policy /= Direct;
+ and then Project.Symbol_Data.Symbol_Policy /= Direct;
Error_Msg
(Data.Flags,
No_Sources : constant Boolean :=
((not Source_Files.Default
and then Source_Files.Values = Nil_String)
- or else
- (not Source_Dirs.Default
- and then Source_Dirs.Values = Nil_String)
- or else
- (not Languages.Default
- and then Languages.Values = Nil_String))
+ or else (not Source_Dirs.Default
+ and then Source_Dirs.Values = Nil_String)
+ or else (not Languages.Default
+ and then Languages.Values = Nil_String))
and then Project.Extends = No_Project;
-- Start of processing for Get_Directories
if not Dir_Exists and then not Project.Externally_Built then
if Opt.Directories_Must_Exist_In_Projects then
+
-- The object directory does not exist, report an error if
-- the project is not externally built.
pragma Assert (Source_Dirs.Kind = List, "Source_Dirs is not a list");
- if not Source_Files.Default
- and then Source_Files.Values = Nil_String
+ if not Source_Files.Default and then Source_Files.Values = Nil_String
then
Project.Source_Dirs := Nil_String;
-- A non empty, non comment line should contain a file name
- if Last /= 0
- and then (Last = 1 or else Line (1 .. 2) /= "--")
- then
+ if Last /= 0 and then (Last = 1 or else Line (1 .. 2) /= "--") then
Name_Len := Last;
Name_Buffer (1 .. Name_Len) := Line (1 .. Last);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
-- In the standard GNAT naming scheme, check for special cases: children
-- or separates of A, G, I or S, and run time sources.
- if Is_Standard_GNAT_Naming (Naming)
- and then Name_Len >= 3
- then
+ if Is_Standard_GNAT_Naming (Naming) and then Name_Len >= 3 then
declare
S1 : constant Character := Name_Buffer (1);
S2 : constant Character := Name_Buffer (2);
S3 : constant Character := Name_Buffer (3);
begin
- if S1 = 'a'
- or else S1 = 'g'
- or else S1 = 'i'
- or else S1 = 's'
- then
+ if S1 = 'a' or else S1 = 'g' or else S1 = 'i' or else S1 = 's' then
+
-- Children or separates of packages A, G, I or S. These names
-- are x__ ... or x~... (where x is a, g, i, or s). Both
-- versions (x__... and x~...) are allowed in all platforms,
end if;
end if;
- if Unit /= No_Name
- and then Current_Verbosity = High
- then
+ if Unit /= No_Name and then Current_Verbosity = High then
case Kind is
when Spec => Debug_Output ("spec of", Unit);
when Impl => Debug_Output ("body of", Unit);
if Project.Project.Extends = No_Project
and then
Project.Project.Object_Directory = Project.Project.Directory
- and then
- not (Project.Project.Qualifier = Aggregate_Library)
+ and then not (Project.Project.Qualifier = Aggregate_Library)
then
Project.Project.Object_Directory := No_Path_Information;
end if;
(Project.Source_Names, Source.File);
if NL /= No_Name_Location and then not NL.Listed then
+
-- Remove the exception
+
Source_Names_Htable.Set
(Project.Source_Names,
Source.File,
Source.Kind := Kind;
- if Current_Verbosity = High
- and then Source.File /= No_File
- then
+ if Current_Verbosity = High and then Source.File /= No_File then
Debug_Output ("override kind for "
& Get_Name_String (Source.File)
& " idx=" & Source.Index'Img
-- A file name in a list must be a source of a language
- if Data.Flags.Error_On_Unknown_Language
- and then Name_Loc.Found
+ if Data.Flags.Error_On_Unknown_Language and then Name_Loc.Found
then
Error_Msg_File_1 := File_Name;
Error_Msg
Read (Dir, Name, Last);
exit when Last = 0;
- if Name (1 .. Last) /= "."
- and then
- Name (1 .. Last) /= ".."
- then
+ if Name (1 .. Last) /= "." and then Name (1 .. Last) /= ".." then
declare
Path_Name : constant String :=
Normalize_Pathname
Directory => Path_Str,
Resolve_Links => Resolve_Links)
& Directory_Separator;
- Path2 : Path_Information;
- OK : Boolean := True;
+
+ Path2 : Path_Information;
+ OK : Boolean := True;
begin
if Is_Directory (Path_Name) then
Pattern_End - 1 >= Pattern'First
and then Pattern (Pattern_End - 1 .. Pattern_End) = "**"
and then (Pattern_End - 1 = Pattern'First
- or else Pattern (Pattern_End - 2) = '/'
- or else Pattern (Pattern_End - 2) = Directory_Separator);
+ or else Pattern (Pattern_End - 2) = '/'
+ or else Pattern (Pattern_End - 2) = Directory_Separator);
if Recursive then
Pattern_End := Pattern_End - 2;
Continuation : Boolean := False;
Iter : Source_Iterator;
begin
- if not Project.Project.Externally_Built
- and then not Extending
- then
+ if not Project.Project.Externally_Built and then not Extending then
Language := Project.Project.Languages;
while Language /= No_Language_Index loop
-- unit name is not null.
if Src.Kind /= Sep and then Src.Unit_Name /= No_Name then
-
declare
UData : Unit_Index :=
- Units_Htable.Get
- (Data.Tree.Units_HT, Src.Unit_Name);
+ Units_Htable.Get (Data.Tree.Units_HT, Src.Unit_Name);
begin
if UData = No_Unit_Index then
UData := new Unit_Data;
-- indentation level only affects output done through Debug_Output.
private
-
All_Packages : constant String_List_Access := null;
No_Project_Tree : constant Project_Tree_Ref := null;
Last : in out Natural);
-- Append a String to the Buffer
+ -- Table used to store the path name of all the created temporary files, so
+ -- that they can be deleted at the end, or when the program is interrupted.
+
package Temp_Files_Table is new GNAT.Dynamic_Tables
(Table_Component_Type => Path_Name_Type,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 10,
Table_Increment => 10);
- -- Table to store the path name of all the created temporary files, so that
- -- they can be deleted at the end, or when the program is interrupted.
+
+ -- The following type is used to represent the part of a project tree which
+ -- is private to the Project Manager.
type Private_Project_Tree_Data is record
Temp_Files : Temp_Files_Table.Instance;
-- Current value of project object path file env var. Used to avoid
-- setting the env var to the same value.
-- gnatmake only
-
end record;
- -- Type to represent the part of a project tree which is private to the
- -- Project Manager.
+
+ -- The following type is used to hold processing flags which show what
+ -- functions are required for the various tools that are handled.
type Processing_Flags is record
Require_Sources_Other_Lang : Boolean;