-
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.
Implement the
is_limited_type
property.
- Loading branch information
Showing
5 changed files
with
210 additions
and
0 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,52 @@ | ||
procedure Test is | ||
type Non_Limited is range 1 .. 10; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Null_Rec is limited null record; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Array is array (Positive range <>) of Limited_Null_Rec; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Derived_Type is new Limited_Null_Rec; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Tagged_Rec is tagged limited null record; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Derived_Tagged_Type is new Limited_Tagged_Rec with null record; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Component_Type is record | ||
X : Limited_Null_Rec; | ||
end record; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Variant_Type (K : Boolean) is record | ||
case K is | ||
when True => | ||
X : Limited_Null_Rec; | ||
when False => | ||
Y : Integer; | ||
end case; | ||
end record; | ||
--% node.p_is_limited_type | ||
|
||
type Non_Limited_Interface is interface; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Synchronized_Interface is synchronized interface; | ||
--% node.p_is_limited_type | ||
|
||
type Limited_Interface is limited interface; | ||
--% node.p_is_limited_type | ||
|
||
type Non_Limited_Derived_Interface is interface and Limited_Interface; | ||
--% node.p_is_limited_type | ||
|
||
type Non_Limited_From_Limited_Interface is new Limited_Interface | ||
with null record; | ||
--% node.p_is_limited_type | ||
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,77 @@ | ||
Working on node <ConcreteTypeDecl ["Non_Limited"] test.adb:2:4-2:38> | ||
==================================================================== | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: False | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Null_Rec"] test.adb:5:4-5:49> | ||
========================================================================= | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Array"] test.adb:8:4-8:72> | ||
====================================================================== | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Derived_Type"] test.adb:11:4-11:54> | ||
=============================================================================== | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Tagged_Rec"] test.adb:14:4-14:58> | ||
============================================================================= | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Derived_Tagged_Type"] test.adb:17:4-17:80> | ||
====================================================================================== | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Component_Type"] test.adb:20:4-22:15> | ||
================================================================================= | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Variant_Type"] test.adb:25:4-32:15> | ||
=============================================================================== | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Non_Limited_Interface"] test.adb:35:4-35:44> | ||
================================================================================ | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: False | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Synchronized_Interface"] test.adb:38:4-38:66> | ||
========================================================================================= | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Limited_Interface"] test.adb:41:4-41:48> | ||
============================================================================ | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: True | ||
|
||
Working on node <ConcreteTypeDecl ["Non_Limited_Derived_Interface"] test.adb:44:4-44:74> | ||
======================================================================================== | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: False | ||
|
||
Working on node <ConcreteTypeDecl ["Non_Limited_From_Limited_Interface"] test.adb:47:4-48:24> | ||
============================================================================================= | ||
|
||
Eval 'node.p_is_limited_type' | ||
Result: False |
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,7 @@ | ||
type: new-feature | ||
title: Add ``p_is_limited_type`` property | ||
description: | | ||
This new property returns whether the given ``BaseTypeDecl`` node is a | ||
limited type or not, either because it is explicitly marked as such, or | ||
because it inherits from a limited type or has a component of a limited type. | ||
date: 2023-10-13 |