-
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/1078' into 'master'
Make `BaseSubpSpec`'s `name` property public. Closes #1078 See merge request eng/libadalang/libadalang!1412
- Loading branch information
Showing
5 changed files
with
79 additions
and
1 deletion.
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,30 @@ | ||
procedure Test is | ||
procedure Foo (X : Integer); | ||
--% node.f_subp_spec.p_name | ||
procedure Foo (X : integer) is null; | ||
--% node.f_subp_spec.p_name | ||
|
||
function Bar (X : Integer) return Integer is (X); | ||
--% node.f_subp_spec.p_name | ||
|
||
task T is | ||
entry Baz (X : Integer); | ||
--% node.f_spec.p_name | ||
end T; | ||
|
||
task body T is | ||
begin | ||
accept Baz (X : Integer) do | ||
-- this is not a subprogram specification | ||
null; | ||
end Baz; | ||
end T; | ||
|
||
X : String := Integer'Image (2); | ||
--% node.f_default_expr.p_called_subp_spec.p_name | ||
|
||
Y : String := Integer'(2)'Image; | ||
--% node.f_default_expr.p_called_subp_spec.p_name | ||
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,35 @@ | ||
Working on node <SubpDecl ["Foo"] test.adb:2:4-2:32> | ||
==================================================== | ||
|
||
Eval 'node.f_subp_spec.p_name' | ||
Result: <DefiningName "Foo" test.adb:2:14-2:17> | ||
|
||
Working on node <NullSubpDecl ["Foo"] test.adb:4:4-4:40> | ||
======================================================== | ||
|
||
Eval 'node.f_subp_spec.p_name' | ||
Result: <DefiningName "Foo" test.adb:4:14-4:17> | ||
|
||
Working on node <ExprFunction ["Bar"] test.adb:7:4-7:53> | ||
======================================================== | ||
|
||
Eval 'node.f_subp_spec.p_name' | ||
Result: <DefiningName "Bar" test.adb:7:13-7:16> | ||
|
||
Working on node <EntryDecl ["Baz"] test.adb:11:7-11:31> | ||
======================================================= | ||
|
||
Eval 'node.f_spec.p_name' | ||
Result: <DefiningName "Baz" test.adb:11:13-11:16> | ||
|
||
Working on node <ObjectDecl ["X"] test.adb:23:4-23:36> | ||
====================================================== | ||
|
||
Eval 'node.f_default_expr.p_called_subp_spec.p_name' | ||
Result: <SyntheticDefiningName "image" __standard:4:3-4:54> | ||
|
||
Working on node <ObjectDecl ["Y"] test.adb:26:4-26:36> | ||
====================================================== | ||
|
||
Eval 'node.f_default_expr.p_called_subp_spec.p_name' | ||
Result: <SyntheticDefiningName "image" __standard:4:3-4:54> |
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] |
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,6 @@ | ||
type: new-feature | ||
title: Make ``BaseSubpSpec``'s ``name`` property public | ||
description: | | ||
This allows retrieving the name of the subprogram from its specification | ||
without having to navigate to the subprogram decl itself first. | ||
date: 2023-09-14 |