Commit f17fd02e authored by yoogx's avatar yoogx

* If the user provides a Type_Source_Name property, and the

          corresponding value refers to entities from Standard, simply
          use the type as subtype.
parent 9755f9b6
...@@ -316,28 +316,31 @@ package body Ocarina.Backends.PO_HI_Ada.Types is ...@@ -316,28 +316,31 @@ package body Ocarina.Backends.PO_HI_Ada.Types is
L : constant Name_Id := Local_Name (Name); L : constant Name_Id := Local_Name (Name);
P : Node_Id; P : Node_Id;
begin begin
if U = No_Name then if U /= No_Name then
Display_Located_Error -- The user provided a fully qualified name that
(Loc (E), -- is not prefixed by Standard, add this fully
"'Type_Source_Name' property value must be a fully" -- qualified name in the package
& " qualified name", Fatal => True);
end if; P := Make_Designator (U);
P := Make_Designator (U); (ADN.Defining_Identifier (P),
ADN.Set_Corresponding_Node New_Node (ADN.K_Package_Specification));
(ADN.Defining_Identifier (P), Add_With_Package (P);
New_Node (ADN.K_Package_Specification));
Add_With_Package (P); N := Make_Designator (L);
Set_Homogeneous_Parent_Unit_Name (N, P);
-- Get the full name else
-- Otherwise, simply refer to Standard package
N := Make_Designator (L); N := Make_Designator (L);
Set_Homogeneous_Parent_Unit_Name (N, P); Set_Homogeneous_Parent_Unit_Name (N, RU (RU_Standard));
end if;
N := Make_Full_Type_Declaration N := Make_Full_Type_Declaration
(Defining_Identifier => Map_Ada_Defining_Identifier (E), (Defining_Identifier => Map_Ada_Defining_Identifier (E),
Type_Definition => Make_Derived_Type_Definition Type_Definition => Make_Derived_Type_Definition
(N)); (N, Is_Subtype => True),
Is_Subtype => True);
end; end;
else else
-- Otherwise, we extract from the Data_Model specific -- Otherwise, we extract from the Data_Model specific
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment