-- Deal with others association first. This is a named association
if No (Expr_Node) then
- if No (Assoc_List) then
- Assoc_List := New_List;
- end if;
-
- Append (P_Record_Or_Array_Component_Association, Assoc_List);
+ Append_New (P_Record_Or_Array_Component_Association, Assoc_List);
-- Improper use of WITH
elsif Nkind (Expr_Node) in
N_Iterated_Component_Association | N_Iterated_Element_Association
then
- if No (Assoc_List) then
- Assoc_List := New_List (Expr_Node);
- else
- Append_To (Assoc_List, Expr_Node);
- end if;
+ Append_New (Expr_Node, Assoc_List);
elsif Token = Tok_Comma
or else Token = Tok_Right_Paren
& "named association)");
end if;
- if No (Expr_List) then
- Expr_List := New_List;
- end if;
-
- Append (Expr_Node, Expr_List);
+ Append_New (Expr_Node, Expr_List);
-- Check for aggregate followed by left parent, maybe missing comma
then
T_Comma;
- if No (Expr_List) then
- Expr_List := New_List;
- end if;
-
- Append (Expr_Node, Expr_List);
+ Append_New (Expr_Node, Expr_List);
elsif Token = Tok_Right_Bracket then
- if No (Expr_List) then
- Expr_List := New_List;
- end if;
-
- Append (Expr_Node, Expr_List);
+ Append_New (Expr_Node, Expr_List);
exit;
-- Anything else is assumed to be a named association
else
Restore_Scan_State (Scan_State); -- to start of expression
- if No (Assoc_List) then
- Assoc_List := New_List;
- end if;
-
- Append (P_Record_Or_Array_Component_Association, Assoc_List);
+ Append_New (P_Record_Or_Array_Component_Association, Assoc_List);
end if;
exit when not Comma_Present;