Skip to content

Commit

Permalink
* Resolve unit iff unit identifier present
Browse files Browse the repository at this point in the history
      Add corresponding test case

    For issue #177
  • Loading branch information
yoogx committed Nov 23, 2018
1 parent e75f4d6 commit a73afec
Show file tree
Hide file tree
Showing 5 changed files with 1,022 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/core/model/ocarina-analyzer-aadl-links.adb
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions tests/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions tests/github/issue_177/MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AADL_VERSION=-aadlv2
OCARINA_FLAGS= -f -g aadl

17 changes: 17 additions & 0 deletions tests/github/issue_177/test.aadl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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;
Loading

0 comments on commit a73afec

Please sign in to comment.