Commit a73afec4 authored by Jerome Hugues's avatar Jerome Hugues
Browse files

* Resolve unit iff unit identifier present

      Add corresponding test case

    For issue #177
parent e75f4d62
......@@ -3206,7 +3206,7 @@ package body Ocarina.Analyzer.AADL.Links is
if Present (Property_Type) then
declare
Unit_Type : Node_Id;
Unit_Type : Node_Id := No_Node;
V_Unit_Id : constant Node_Id := Unit_Identifier (Node);
Unit_Id : Node_Id;
......@@ -3217,10 +3217,11 @@ package body Ocarina.Analyzer.AADL.Links is
-- iterate over the property designator until we
-- find the corresponding entity to operate on.
if Kind (Property_Type_Designator
(Entity
(Property_Type_Designator
(Property_Type)))) = K_Record_Type
if Present (V_Unit_Id) and then
Kind (Property_Type_Designator
(Entity
(Property_Type_Designator
(Property_Type)))) = K_Record_Type
then
List_Node := First_Node
(List_Items
......@@ -3242,11 +3243,13 @@ package body Ocarina.Analyzer.AADL.Links is
List_Node := Next_Node (List_Node);
end loop;
else
Unit_Type := Unwind_Units_Type
(Root, Property_Type_Designator
if Present (V_Unit_Id) then
Unit_Type := Unwind_Units_Type
(Root, Property_Type_Designator
(Entity
(Property_Type_Designator
(Property_Type))));
end if;
end if;
else
Unit_Type := Unwind_Units_Type (Root, Property_Type);
......
......@@ -326,6 +326,7 @@ tests/github/issue_56/testFeatureGroup.aadl
tests/github/issue_66/test.aadl
tests/github/issue_87/test.aadl
tests/github/issue_174/test.aadl
tests/github/issue_177/test.aadl
tests/root_system/test.aadl
......
AADL_VERSION=-aadlv2
OCARINA_FLAGS= -f -g aadl
property set ps is
Position_In_File: record ( line : aadlinteger ; column: aadlinteger;)
applies to (data);
end ps;
package foo
public
with PS;
DATA T_Int8
PROPERTIES
PS::Position_In_File => [ line => 10 ; column => 1 ; ];
end T_Int8;
end foo;
This diff is collapsed.
Supports Markdown
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