towards printing of conditional values

This commit is contained in:
Alejandro R Mosteo
2018-03-02 19:58:47 +01:00
parent dab6d196c9
commit 388bb23dd3
2 changed files with 22 additions and 11 deletions
+17 -1
View File
@@ -5,6 +5,7 @@ package body Alire.Conditional_Values is
-----------
function "and" (L, R : Conditional_Value) return Conditional_Value is
-- FIXME: we could do an effort to flatten this binary tree that's forming here in longer vectors
begin
return Result : Conditional_Value do
if L.Is_Empty and then R.Is_Empty then
@@ -57,7 +58,8 @@ package body Alire.Conditional_Values is
end case;
end Evaluate;
Empty_Value : Values;
Empty_Value : Values with Warnings => Off;
-- Default value should made sense; in our case it will be an empty vector...
begin
if This.Is_Empty then
return Empty_Value;
@@ -73,5 +75,19 @@ package body Alire.Conditional_Values is
function Evaluate (This : Conditional_Value; Against : Properties.Vector) return Conditional_Value is
(New_Value (This.Evaluate (Against)));
-------------
-- Iterate --
-------------
procedure Iterate_Children (This : Conditional_Value;
Visitor : access procedure (CV : Conditional_Value))
is
begin
for Inner of Vector_Inner (This.Constant_Reference.Element.all).Values loop
case Inner.Kind is
when others => BANG
end case;
end loop;
end Iterate_Children;
end Alire.Conditional_Values;