diff --git a/src/alire-boolean_trees.adb b/src/alire-boolean_trees.adb index 7499f5a8..d918c88d 100644 --- a/src/alire-boolean_trees.adb +++ b/src/alire-boolean_trees.adb @@ -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; --------------------- diff --git a/src/alire-boolean_trees.ads b/src/alire-boolean_trees.ads index b79bfe64..8526f009 100644 --- a/src/alire-boolean_trees.ads +++ b/src/alire-boolean_trees.ads @@ -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 diff --git a/src/alire-properties-platform.ads b/src/alire-properties-platform.ads index 01a32ee8..771ed70c 100644 --- a/src/alire-properties-platform.ads +++ b/src/alire-properties-platform.ads @@ -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;