Class DirectiveAfterDeclaration

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

final class DirectiveAfterDeclaration extends Object implements TextRule
Main() @Test - an annotation written after the declaration it marks, Java-and-Kotlin style. In EK9 a directive (@Test, @Test: group) is a line of its own BEFORE the declaration, at the same indent (directive? methodDeclaration in the grammar), so moving it to the line above is the only reading. A directive followed by anything else (a requirement String, @Test "REQ:x") is left alone.
  • Constructor Details

    • DirectiveAfterDeclaration

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