-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/1274' into 'master'
Consider all parts of entity when looking for an aspect Closes #1274 See merge request eng/libadalang/libadalang!1546
- Loading branch information
Showing
4 changed files
with
149 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
procedure Test is | ||
package P is | ||
type T1 is private; | ||
--% node.p_get_aspect('String_Literal') | ||
--% node.p_get_aspect('String_Literal', True) | ||
|
||
type T2 is private with String_Literal => SLT2; | ||
--% node.p_get_aspect('String_Literal') | ||
--% node.p_get_aspect('String_Literal', True) | ||
function SLT2 (X : Wide_Wide_String) return T2; | ||
private | ||
type T1 is null record with String_Literal => SLT1; | ||
--% node.p_get_aspect('String_Literal') | ||
--% node.p_get_aspect('String_Literal', True) | ||
function SLT1 (X : Wide_Wide_String) return T1; | ||
|
||
type T2 is null record; | ||
--% node.p_get_aspect('String_Literal') | ||
--% node.p_get_aspect('String_Literal', True) | ||
end P; | ||
|
||
package body P is | ||
GT1 : T1; | ||
GT2 : T2; | ||
|
||
function SLT1 (X : Wide_Wide_String) return T1 is (GT1); | ||
function SLT2 (X : Wide_Wide_String) return T2 is (GT2); | ||
|
||
type T3 is new T2; | ||
--% node.p_get_aspect('String_Literal') | ||
--% node.p_get_aspect('String_Literal', True) | ||
end P; | ||
begin | ||
null; | ||
end Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Working on node <ConcreteTypeDecl ["T1"] test.adb:3:7-3:26> | ||
=========================================================== | ||
|
||
Eval 'node.p_get_aspect('String_Literal')' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:12:35-12:57> value=<Id "SLT1" test.adb:12:53-12:57> inherited=False> | ||
|
||
Eval 'node.p_get_aspect('String_Literal', True)' | ||
Result: <Aspect exists=False node=None value=None inherited=False> | ||
|
||
Working on node <ConcreteTypeDecl ["T2"] test.adb:7:7-7:54> | ||
=========================================================== | ||
|
||
Eval 'node.p_get_aspect('String_Literal')' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:7:31-7:53> value=<Id "SLT2" test.adb:7:49-7:53> inherited=False> | ||
|
||
Eval 'node.p_get_aspect('String_Literal', True)' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:7:31-7:53> value=<Id "SLT2" test.adb:7:49-7:53> inherited=False> | ||
|
||
Working on node <ConcreteTypeDecl ["T1"] test.adb:12:7-12:58> | ||
============================================================= | ||
|
||
Eval 'node.p_get_aspect('String_Literal')' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:12:35-12:57> value=<Id "SLT1" test.adb:12:53-12:57> inherited=False> | ||
|
||
Eval 'node.p_get_aspect('String_Literal', True)' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:12:35-12:57> value=<Id "SLT1" test.adb:12:53-12:57> inherited=False> | ||
|
||
Working on node <ConcreteTypeDecl ["T2"] test.adb:17:7-17:30> | ||
============================================================= | ||
|
||
Eval 'node.p_get_aspect('String_Literal')' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:7:31-7:53> value=<Id "SLT2" test.adb:7:49-7:53> inherited=False> | ||
|
||
Eval 'node.p_get_aspect('String_Literal', True)' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:7:31-7:53> value=<Id "SLT2" test.adb:7:49-7:53> inherited=False> | ||
|
||
Working on node <ConcreteTypeDecl ["T3"] test.adb:29:7-29:25> | ||
============================================================= | ||
|
||
Eval 'node.p_get_aspect('String_Literal')' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:7:31-7:53> value=<Id "SLT2" test.adb:7:49-7:53> inherited=True> | ||
|
||
Eval 'node.p_get_aspect('String_Literal', True)' | ||
Result: <Aspect exists=True node=<AspectAssoc test.adb:7:31-7:53> value=<Id "SLT2" test.adb:7:49-7:53> inherited=True> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
driver: inline-playground | ||
input_sources: [test.adb] |