Class DefaultOperatorLast

java.lang.Object
org.ek9lang.compiler.repair.DefaultOperatorLast
All Implemented Interfaces:
TextRule

final class DefaultOperatorLast extends Object implements TextRule
E01086 - a bare default operator with something after it in the body. The rule fixes its place: an aggregate's body is properties, methods, operators, then at most one bare default operator as the LAST item (AggregateMemberOrder, checked in phase 1 and by SyntaxProbe; until 2026-10-11 the grammar itself). Moving the line to the end of its body is therefore the only reading; what the body holds is untouched. Measured: 5 of the 9 Q and A quads that did not parse, and 24 harness events.
  • Constructor Details

    • DefaultOperatorLast

      DefaultOperatorLast()
  • Method Details

    • apply

      public TextRule.Rewrite apply(List<String> lines, SyntaxProbe.SyntaxError failure)
      Description copied from interface: TextRule
      The rewrite of lines answering failure, or null.
      Specified by:
      apply in interface TextRule
      Parameters:
      lines - the source's lines (never modified by a rule - a rewrite carries its own copy)
      failure - the first syntax error, as the parser reported it