Class ForeignBlockColon

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

final class ForeignBlockColon extends Object implements TextRule
A foreign spelling (was ForeignSyntax.trailingColon): a trailing : on a control line (if x:, else:, while x:) - Python's block colon; EK9 blocks are opened by indentation alone. Only on the line the parser stopped on, and never a colon inside a literal or a comment (MaskedLiterals).
  • Constructor Details

    • ForeignBlockColon

      ForeignBlockColon()
  • 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