Class AggregateMemberOrder
java.lang.Object
org.ek9lang.compiler.support.AggregateMemberOrder
- All Implemented Interfaces:
Function<EK9Parser.AggregatePartsContext, Optional<AggregateMemberOrder.OutOfOrder>>
public final class AggregateMemberOrder
extends Object
implements Function<EK9Parser.AggregatePartsContext, Optional<AggregateMemberOrder.OutOfOrder>>
THE order of the members of an aggregate body (E01086, Steve 2026-10-11): properties first, then constructors and
methods, then operators (an explicit
operator, override operator or default operator X,
in any order among themselves), and a bare default operator as the LAST item of all.
The grammar (aggregateParts) accepts the members in any order, so the rule is stated once here and asked
by every door that needs it: phase 1's AggregateMemberOrderOrError (the compile error), SyntaxProbe
(so a text-layer repair such as DefaultOperatorLast still sees the error before a compile) and the
formatter's member reordering (which splices contiguous sections and leaves an out-of-order body alone). Before
2026-10-11 the grammar enforced the order and ErrorListener.syntaxError relabelled ANTLR's recovery messages
as E01086, with 2-3 cascades, and an @Error directive in front of the member defeated it.
Only the FIRST member out of order is reported, once per body: moving it may well settle the rest.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe first member of a body out of order. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe first member ofpartsthat is out of order, or empty when the body is in order (or null).
-
Constructor Details
-
AggregateMemberOrder
public AggregateMemberOrder()
-
-
Method Details
-
apply
The first member ofpartsthat is out of order, or empty when the body is in order (or null).- Specified by:
applyin interfaceFunction<EK9Parser.AggregatePartsContext, Optional<AggregateMemberOrder.OutOfOrder>>
-