("extra parentheses surrounding aggregate not allowed", Aggr);
return;
+ -- Reject the mixing of named and positional entries in the aggregate
+
+ elsif Present (Expressions (Aggr))
+ and then Present (Component_Associations (Aggr))
+ then
+ Error_Msg_N ("cannot mix positional and named entries in "
+ & "enumeration rep clause", N);
+ return;
+
-- All tests passed, so set rep clause in place
else
Elit := First_Literal (Enumtype);
- -- First the positional entries if any
+ -- Process positional entries
if Present (Expressions (Aggr)) then
Expr := First (Expressions (Aggr));
Next (Expr);
Next (Elit);
end loop;
- end if;
- -- Now process the named entries if present
+ -- Process named entries
- if Present (Component_Associations (Aggr)) then
+ elsif Present (Component_Associations (Aggr)) then
Assoc := First (Component_Associations (Aggr));
while Present (Assoc) loop
Choice := First (Choices (Assoc));