Class TrailingBracket

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

public final class TrailingBracket extends Object
THE unbalanced trailing bracket - stdout.println(x)], stdout.println("few")} - for every caller: the statements[] pre-pass, the MCP diagnostic repairs and ek9 -ff. Use this; do not re-derive the balance check.

The bracket is dropped only when the line is unbalanced WITH it and balanced WITHOUT it: nothing else can have been meant. Measured: create T2 (2026-09-21) resent stdout.println(findLabel(7))] thirteen times against the named fix; 14 harness events reached edit_file/write_file, which until 2026-10-05 had no route to this repair at all.

  • Method Details

    • without

      public static String without(String entry)
      entry without its unbalanced trailing bracket; null when the entry is balanced or the trailing bracket is not the only thing wrong with its balance.
    • without

      public static String without(String entry, String message)
      As without(String), given the parser's message - only when the parser stopped on that very bracket ("extraneous ']'", "mismatched input '}'").
    • apply

      static TextRule.Rewrite apply(List<String> lines, SyntaxProbe.SyntaxError failure)
      The text rule: the line the parser stopped on, when the parser stopped on its trailing bracket.