Class AggregateMemberOrder
java.lang.Object
org.ek9lang.compiler.support.AggregateMemberOrder
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. -
Method Summary
Modifier and TypeMethodDescriptionThe first member ofpartsthat is out of order, or empty when the body is in order (or null).static booleanTrue when the members ofpartsare in the required order.
-
Method Details
-
firstOutOfOrder
public static Optional<AggregateMemberOrder.OutOfOrder> firstOutOfOrder(EK9Parser.AggregatePartsContext parts) The first member ofpartsthat is out of order, or empty when the body is in order (or null). -
isInOrder
True when the members ofpartsare in the required order.
-