Class CommaSeparatedParameters

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

final class CommaSeparatedParameters extends Object implements TextRule
Parameters declared the way other languages declare them (was ParameterDeclarations.commaSeparated): -> a as Integer, b as String - several parameters on one -> line. EK9 takes one parameter on the arrow line, or a bare -> with one indented line per parameter; a comma there is never valid, and the split is the only reading. ParametersInParentheses is the other such rule.
  • Field Details

    • PARAMETER

      static final Pattern PARAMETER
      One parameter as EK9 declares it: name as Type ....
  • Constructor Details

    • CommaSeparatedParameters

      CommaSeparatedParameters()
  • Method Details

    • apply

      public TextRule.Rewrite apply(List<String> lines, SyntaxProbe.SyntaxError failure)
      -> a as Integer, b as String - one parameter per line under a bare ->.
      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