Class SanitizedInExpressionParamOrError
java.lang.Object
org.ek9lang.compiler.phase2.SanitizedInExpressionParamOrError
- All Implemented Interfaces:
BiConsumer<EK9Parser.ExpressionParamContext, ErrorListener.SemanticClassification>
final class SanitizedInExpressionParamOrError
extends Object
implements BiConsumer<EK9Parser.ExpressionParamContext, ErrorListener.SemanticClassification>
Checks for inappropriate use of 'sanitized' in expression parameters.
This checker rejects 'sanitized' in captures and call sites, as the keyword
only belongs on function/method parameter definitions (entry points).
The "Rejection at the Source" philosophy means sanitization is a boundary concern specified at function/method parameter definitions, not at: - Captures (data already in trusted boundary) - Call sites (callee defines sanitization, not caller)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(EK9Parser.ExpressionParamContext ctx, ErrorListener.SemanticClassification errorClassification) Checks if the expressionParam has the SANITIZED keyword and emits the appropriate error.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Constructor Details
-
SanitizedInExpressionParamOrError
SanitizedInExpressionParamOrError(ErrorListener errorListener)
-
-
Method Details
-
accept
public void accept(EK9Parser.ExpressionParamContext ctx, ErrorListener.SemanticClassification errorClassification) Checks if the expressionParam has the SANITIZED keyword and emits the appropriate error.- Specified by:
acceptin interfaceBiConsumer<EK9Parser.ExpressionParamContext, ErrorListener.SemanticClassification>- Parameters:
ctx- The expression parameter context to checkerrorClassification- The specific error to emit (E07941 for captures, E07942 for call sites)
-