Check of platform dependencies
This commit is contained in:
@@ -77,7 +77,7 @@ package body Alire.Boolean_Trees is
|
||||
-- Check --
|
||||
-----------
|
||||
|
||||
function Check (T : Tree; V : Value) return Boolean is
|
||||
function Check (T : Tree; V : Value; If_Empty : Boolean := True) return Boolean is
|
||||
|
||||
function Check (C : Trees.Cursor) return Boolean is
|
||||
N : constant Node := Trees.Element (C);
|
||||
@@ -95,7 +95,11 @@ package body Alire.Boolean_Trees is
|
||||
end Check;
|
||||
|
||||
begin
|
||||
return Check (Trees.First_Child (T.Root));
|
||||
if T.Is_Empty then
|
||||
return If_Empty;
|
||||
else
|
||||
return Check (Trees.First_Child (T.Root));
|
||||
end if;
|
||||
end Check;
|
||||
|
||||
---------------------
|
||||
|
||||
@@ -37,7 +37,7 @@ package Alire.Boolean_Trees with Preelaborate is
|
||||
|
||||
-- Tree evaluation
|
||||
|
||||
function Check (T : Tree; V : Value) return Boolean;
|
||||
function Check (T : Tree; V : Value; If_Empty : Boolean := True) return Boolean;
|
||||
|
||||
-- Access
|
||||
|
||||
|
||||
@@ -2,6 +2,14 @@ with Alire.Platforms;
|
||||
|
||||
package Alire.Properties.Platform with Preelaborate is
|
||||
|
||||
function Compiler_Is (C : Platforms.Compilers) return Vector;
|
||||
|
||||
function Distribution_Is (D : Platforms.Distributions) return Vector;
|
||||
|
||||
function System_Is (V : Platforms.Operating_Systems) return Vector;
|
||||
|
||||
-- The following packages declare types used elsewhere so they have to be public --
|
||||
|
||||
package Compilers is new Values (Platforms.Compilers,
|
||||
Platforms.Compilers'IMage);
|
||||
|
||||
@@ -9,21 +17,17 @@ package Alire.Properties.Platform with Preelaborate is
|
||||
Platforms.Distributions'Image);
|
||||
|
||||
package Operating_Systems is new Values (Platforms.Operating_Systems,
|
||||
Platforms.Operating_Systems'Image);
|
||||
|
||||
-- function Current return Vector;
|
||||
-- FIXME this will eventually have to go into Alr
|
||||
Platforms.Operating_Systems'Image);
|
||||
|
||||
private
|
||||
|
||||
function System_Is (V : Platforms.Operating_Systems) return Vector is
|
||||
(+Operating_Systems.New_Property (V));
|
||||
|
||||
function Compiler_Is (C : Platforms.Compilers) return Vector is
|
||||
(+Compilers.New_Property (C));
|
||||
|
||||
-- function Current return Vector is
|
||||
-- (Compiler_Is (Alire.Compilers.Compiler) and
|
||||
-- System_Is (Alire.Operating_Systems.Current));
|
||||
function Distribution_Is (D : Platforms.Distributions) return Vector is
|
||||
(+Distributions.New_Property (D));
|
||||
|
||||
function System_Is (V : Platforms.Operating_Systems) return Vector is
|
||||
(+Operating_Systems.New_Property (V));
|
||||
|
||||
end Alire.Properties.Platform;
|
||||
|
||||
Reference in New Issue
Block a user