Package org.ek9lang.compiler.phase3
Class ValidNamedArgumentsOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase3.ValidNamedArgumentsOrError
- All Implemented Interfaces:
BiConsumer<EK9Parser.ParamExpressionContext,
List<ISymbol>>
final class ValidNamedArgumentsOrError
extends RuleSupport
implements BiConsumer<EK9Parser.ParamExpressionContext,List<ISymbol>>
If the Ek9 developer has used named parameters, then they must be validated.
There won't even be a symbol match if the wrong number or type of argument have been employed. So that error condition will have been identified in earlier phases.
But if there are arguments and they are named then they must be named correctly and in the right order. EK9 does not support missing arguments (even when named). Nor does it support passing arguments in a different order to declaration.
The main purpose of named arguments, is to support a more obvious and declarative syntax when large numbers of arguments are used.
-
Field Summary
Fields inherited from class org.ek9lang.compiler.common.RuleSupport
errorListener, symbolsAndScopes
-
Constructor Summary
ConstructorsConstructorDescriptionValidNamedArgumentsOrError
(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(EK9Parser.ParamExpressionContext ctx, List<ISymbol> parameters) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiConsumer
andThen
-
Constructor Details
-
ValidNamedArgumentsOrError
ValidNamedArgumentsOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceBiConsumer<EK9Parser.ParamExpressionContext,
List<ISymbol>>
-