Class ParameterDeclarations

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

final class ParameterDeclarations extends Object
Parameters declared the way other languages declare them, rewritten to EK9's one-per-line form. Two rules:
  • commaSeparated(List, SyntaxProbe.SyntaxError): -> 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.
  • inParentheses(List, SyntaxProbe.SyntaxError): add(name as String) / label(first: String, last: String) - Java's parameter list on a DECLARATION line. EK9's parentheses on a declaration are always empty, so the parser stops on the first parameter expecting ) - which also proves the line is a declaration, not a call (a call with named arguments parses). The parameters move under ->.