function Scope_Depth_Value (Id : E) return U is
begin
+ pragma Assert
+ (Ekind (Id) in
+ Concurrent_Kind | Entry_Kind | Generic_Unit_Kind |
+ E_Package | E_Package_Body | Subprogram_Kind |
+ E_Block | E_Subprogram_Body |
+ E_Private_Type .. E_Limited_Private_Subtype |
+ E_Void | E_Loop | E_Return_Statement);
return Uint22 (Id);
end Scope_Depth_Value;
procedure Set_Scope_Depth_Value (Id : E; V : U) is
begin
- pragma Assert (not Is_Record_Type (Id));
+ pragma Assert
+ (Ekind (Id) in
+ Concurrent_Kind | Entry_Kind | Generic_Unit_Kind |
+ E_Package | E_Package_Body | Subprogram_Kind |
+ E_Block | E_Subprogram_Body |
+ E_Private_Type .. E_Limited_Private_Subtype |
+ E_Void | E_Loop | E_Return_Statement);
Set_Uint22 (Id, V);
end Set_Scope_Depth_Value;
when Formal_Kind =>
Write_Str ("Protected_Formal");
- when E_Block
- | E_Entry
- | E_Entry_Family
- | E_Function
- | E_Generic_Function
- | E_Generic_Package
- | E_Generic_Procedure
- | E_Loop
+ when Concurrent_Kind
+ | Entry_Kind
+ | Generic_Unit_Kind
| E_Package
| E_Package_Body
- | E_Procedure
- | E_Protected_Type
- | E_Return_Statement
+ | Subprogram_Kind
+ | E_Block
| E_Subprogram_Body
- | E_Task_Type
+ | E_Private_Type .. E_Limited_Private_Subtype
+ | E_Void
+ | E_Loop
+ | E_Return_Statement
=>
Write_Str ("Scope_Depth_Value");
-- the Scope will be Standard.
-- Scope_Depth (synthesized)
--- Applies to program units, blocks, concurrent types and entries, and
--- also to record types, i.e. to any entity that can appear on the scope
--- stack. Yields the scope depth value, which for those entities other
--- than records is simply the scope depth value, for record entities, it
--- is the Scope_Depth of the record scope.
+-- Applies to program units, blocks, loops, return statements,
+-- concurrent types, private types and entries, and also to record types,
+-- i.e. to any entity that can appear on the scope stack. Yields the
+-- scope depth value, which for those entities other than records is
+-- simply the scope depth value, for record entities, it is the
+-- Scope_Depth of the record scope.
-- Scope_Depth_Value (Uint22)
--- Defined in program units, blocks, concurrent types, and entries.
+-- Defined in program units, blocks, loops, return statements,
+-- concurrent types, private types and entries.
-- Indicates the number of scopes that statically enclose the declaration
-- of the unit or type. Library units have a depth of zero. Note that
-- record types can act as scopes but do NOT have this field set (see