-- to one of these types.
procedure Premature_Usage (N : Node_Id);
- -- Diagnose usage of an entity before it is visible.
+ -- Diagnose usage of an entity before it is visible
procedure Use_One_Package (P : Entity_Id; N : Node_Id);
-- Make visible entities declared in package P potentially use-visible
and then Is_Function_Attribute_Name
(Attribute_Name (Original_Node (Nam))))
- -- Weird but legal, equivalent to renaming a function call.
+ -- Weird but legal, equivalent to renaming a function call
or else (Is_Entity_Name (Nam)
and then Ekind (Entity (Nam)) = E_Enumeration_Literal)
Name (N), Old_P);
end if;
- -- Set basic attributes to minimize cascaded errors.
+ -- Set basic attributes to minimize cascaded errors
Set_Ekind (New_P, E_Package);
Set_Etype (New_P, Standard_Void_Type);
begin
if Entity (Sel) = Any_Id then
- -- Selector is undefined on prefix. Error emitted already.
+ -- Selector is undefined on prefix. Error emitted already
Set_Has_Completion (New_S);
return;
if Orig_Subp = Rename_Spec then
- -- Circularity detected.
+ -- Circularity detected
return Orig_Subp;
Error_Msg_N ("use clause not allowed in predefined spec", N);
end if;
- -- Chain clause to list of use clauses in current scope.
+ -- Chain clause to list of use clauses in current scope
if Nkind (Parent (N)) /= N_Compilation_Unit then
Chain_Use_Clause (N);
begin
Set_Hidden_By_Use_Clause (N, No_Elist);
- -- Chain clause to list of use clauses in current scope.
+ -- Chain clause to list of use clauses in current scope
if Nkind (Parent (N)) /= N_Compilation_Unit then
Chain_Use_Clause (N);
then
Par := Nam;
- -- Find root library unit in with_clause.
+ -- Find root library unit in with_clause
while Nkind (Par) = N_Expanded_Name loop
Par := Prefix (Par);
Msg : Boolean;
Inst : Entity_Id := Empty;
- -- Enclosing instance, if any.
+ -- Enclosing instance, if any
Homonyms : Entity_Id;
-- Saves start of homonym chain
-- V2 : Integer := B;
-- end C;
- -- V1 resolves to A.B, but V2 resolves to library unit B.
+ -- V1 resolves to A.B, but V2 resolves to library unit B
elsif Ekind (E2) = E_Function
and then Scope (E2) = Standard_Standard
if In_Instance then
Inst := Current_Scope;
- -- Find current instance.
+ -- Find current instance
while Present (Inst)
and then Inst /= Standard_Standard
then
Collect_Interps (N);
- -- If no homonyms were visible, the entity is unambiguous.
+ -- If no homonyms were visible, the entity is unambiguous
if not Is_Overloaded (N) then
Generate_Reference (E, N);
Set_Referenced (E, R);
end;
- -- Normal case, not a label. Generate reference.
+ -- Normal case, not a label. Generate reference
else
Generate_Reference (E, N);
-- the formals, which is declared in the enclosing wrapper package.
P_Name := Scope (P_Name);
- Id := Current_Entity (Selector);
+ Id := Current_Entity (Selector);
while Present (Id) loop
- exit when Scope (Id) = P_Name;
+ exit when Scope (Id) = P_Name;
Id := Homonym (Id);
end loop;
end if;
- if No (Id) or else Chars (Id) /= Chars (Selector) then
-
+ if No (Id) or else Chars (Id) /= Chars (Selector) then
Set_Etype (N, Any_Type);
-- If we are looking for an entity defined in System, try to
Error_Msg_NE ("& not declared in&", N, Selector);
- -- Check for misspelling of some entity in prefix.
+ -- Check for misspelling of some entity in prefix
Id := First_Entity (P_Name);
Get_Name_String (Chars (Selector));
if Is_Overloaded (P) then
- -- The prefix must resolve to a unique enclosing construct.
+ -- The prefix must resolve to a unique enclosing construct
declare
Found : Boolean := False;
and then not Is_Generic_Type (Typ)
then
Error_Msg_N
- ("prefix of Base attribute must be scalar type", Typ);
+ ("prefix of Base attribute must be scalar type",
+ Prefix (N));
elsif Sloc (Typ) = Standard_Location
and then Base_Type (Typ) = Typ
Next_Entity (Id);
end loop;
- -- Equality: look for any non-limited type. Result is Boolean.
+ -- Equality: look for any non-limited type (result is Boolean)
when Name_Op_Eq | Name_Op_Ne =>
Next_Entity (Id);
end loop;
- -- Comparison operators: scalar type, or array of scalar.
+ -- Comparison operators: scalar type, or array of scalar
when Name_Op_Lt | Name_Op_Le | Name_Op_Gt | Name_Op_Ge =>
-- Start of processing for Present_System_Aux
begin
- -- The child unit may have been loaded and analyzed already.
+ -- The child unit may have been loaded and analyzed already
if Present (System_Aux_Id) then
return True;
SS_Last : constant Int := Scope_Stack.Last;
begin
- -- Restore visibility of previous scope stack, if any.
+ -- Restore visibility of previous scope stack, if any
for J in reverse 0 .. Scope_Stack.Last loop
exit when Scope_Stack.Table (J).Entity = Standard_Standard
Error_Msg_N ("limited withed package cannot appear in use clause", N);
end if;
- -- Find enclosing instance, if any.
+ -- Find enclosing instance, if any
if In_Instance then
Current_Instance := Current_Scope;
Prev := Homonym (Prev);
end loop;
- -- On exit, we know entity is not hidden, unless it is private.
+ -- On exit, we know entity is not hidden, unless it is private
if not Is_Hidden (Id)
and then ((not Is_Child_Unit (Id))