Class OperatorSide

java.lang.Object
org.ek9lang.compiler.repair.OperatorSide

public final class OperatorSide extends Object
THE move of a prefix or suffix operator to its own side of a simple operand - names$ to $names, ?stored to stored? - for every editing tool. Use this; do not re-derive the shape or the rule.

$, $$, #<, #>, #?, #^ and ~ are PREFIX only and ? is SUFFIX only - the compiler's OperatorPositionMap. Written on the other side, the parser stops at it (E01084 / E01085, "place BEFORE / AFTER the expression") and the text has no other form it could be; bound to the operand it touches, as every language binds a unary operator tighter than an infix one, the move has one reading. Only a SIMPLE operand moves - a name, a member chain, a call - and never when another operand follows the operator; (a + b)$ and x $y are left to the caller.

Measured (2026-09-28): 48 refusals across the record, nearly all Qwen3.8 create T4 - rtn: names$$ sent five times in one failed run, against a pre-flight that named the fix each time.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    The rewritten text and one note per rewrite; notes empty means nothing moved.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    True when text has the shape at all - the cheap gate before a probe compile.
    (package private) static String
    movedAt(String line, int column)
    line with the operator that starts at column moved to its side of the simple operand it touches; null when that is not exactly the shape.
    static String
    entry with every such operator moved, ONLY when the entry as sent does not parse and the moved one does - provable, not guessed; null otherwise.
    repair(String text, List<Map<String,Object>> diagnostics)
    Move the operator every E01084 / E01085 diagnostic sits on - the parser's own position for it - when it is exactly the shape.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • mayApply

      public static boolean mayApply(String text)
      True when text has the shape at all - the cheap gate before a probe compile.
    • movedAt

      static String movedAt(String line, int column)
      line with the operator that starts at column moved to its side of the simple operand it touches; null when that is not exactly the shape.
    • movedInEntry

      public static String movedInEntry(String entry)
      entry with every such operator moved, ONLY when the entry as sent does not parse and the moved one does - provable, not guessed; null otherwise. For statements, which the pre-flight parses before anything else sees them.
    • repair

      public static OperatorSide.Result repair(String text, List<Map<String,Object>> diagnostics)
      Move the operator every E01084 / E01085 diagnostic sits on - the parser's own position for it - when it is exactly the shape. Anything less certain is skipped and the caller's refusal stands. Rewrites within one line, so the receipts can follow (SourceRepairs).