Class ParameterDeclarations
java.lang.Object
org.ek9lang.compiler.repair.ParameterDeclarations
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->.
-
Method Summary
Modifier and TypeMethodDescription(package private) static TextRule.RewritecommaSeparated(List<String> lines, SyntaxProbe.SyntaxError failure) -> a as Integer, b as String- one parameter per line under a bare->.(package private) static TextRule.RewriteinParentheses(List<String> lines, SyntaxProbe.SyntaxError failure) add(name as String) as pure- the parameters moved under->, the parentheses left empty.
-
Method Details
-
commaSeparated
-> a as Integer, b as String- one parameter per line under a bare->. -
inParentheses
add(name as String) as pure- the parameters moved under->, the parentheses left empty.
-