Typ : constant Entity_Id := Etype (N);
New_Loop : Node_Id;
- -- If the prefix is an aggregwte, its unique component is sn
- -- Iterated_Element, and we create a loop out of its itertor.
+ -- If the prefix is an aggregate, its unique component is an
+ -- Iterated_Element, and we create a loop out of its iterator.
begin
if Nkind (Prefix (N)) = N_Aggregate then
declare
Stream : constant Node_Id :=
- First (Component_Associations (Prefix (N)));
+ First (Component_Associations (Prefix (N)));
Id : constant Node_Id := Defining_Identifier (Stream);
Expr : constant Node_Id := Expression (Stream);
Ch : constant Node_Id :=
- First (Discrete_Choices (Stream));
+ First (Discrete_Choices (Stream));
begin
New_Loop := Make_Loop_Statement (Loc,
Iteration_Scheme =>
Relocate_Node (Expr))))));
end;
else
- -- If the prefix is a name we construct an element iterwtor
- -- over it. Its expansion will verify that it is an array
- -- or a container with the proper aspects.
+ -- If the prefix is a name, we construct an element iterator
+ -- over it. Its expansion will verify that it is an array or
+ -- a container with the proper aspects.
declare
Iter : Node_Id;
if Token = Tok_Left_Bracket and then Ada_Version >= Ada_2020 then
Scan;
- -- Special case for null aggregate in Ada2020.
+ -- Special case for null aggregate in Ada 2020
if Token = Tok_Right_Bracket then
Scan; -- past ]
-- If we have a right paren, then that is taken as ending the list
-- i.e. no comma is present.
- -- Ditto for a right bracket in Ada2020.
+ -- Ditto for a right bracket in Ada 2020.
elsif Token = Tok_Right_Paren
or else (Token = Tok_Right_Bracket and then Ada_Version >= Ada_2020)
-- exception-name". This degrades error recovery slightly, and perhaps
-- we could do better, but not worth the effort.
- -- Ada2020 introduces square brackets as delimiters for array and
+ -- Ada 2020 introduces square brackets as delimiters for array and
-- container aggregates.
Tok_Raise, -- RAISE
return;
- -- Right bracket or right brace, treated as right paren
- -- but proper aggregate delimiter in Ada_2020
+ -- Right bracket or right brace, treated as right paren but proper
+ -- aggregate delimiter in Ada 2020.
when ']' | '}' =>
if Ada_Version >= Ada_2020 then
-- Prefix is a name, as for other attributes.
-- If the object is a function we asume that it is not
- -- overloaded. AI12-242 does not suggest an name resulution
- -- rule for that case, but can suppose that the expected
- -- type of the reduction is the expected type of the
- -- component of the prefix.
+ -- overloaded. AI12-242 does not suggest a name resolution
+ -- rule for that case, but we can suppose that the expected
+ -- type of the reduction is the expected type of the component
+ -- of the prefix.
Analyze_And_Resolve (Stream);
Typ := Etype (Stream);
-- the Controlled types. The code below is motivated by containers that
-- are derived from other types with a Reference aspect.
-- Note as well that we need to examine the base type, given that
- -- the container object may be a constrained subtype or itype which
- -- does not have an explicit declaration,
+ -- the container object may be a constrained subtype or itype that
+ -- does not have an explicit declaration.
elsif Is_Derived_Type (C_Type)
and then Etype (First_Formal (Entity (Func_Name))) /= Pref_Typ
-- Test_Case
-- Is_Homogeneous_Aggregate (Flag14)
- -- A flag set on an Ada2020 aggregate that uses square brackets as
+ -- A flag set on an Ada 2020 aggregate that uses square brackets as
-- delimiters, and thus denotes an array or container aggregate, or
-- the prefix of a reduction attribute.