Class SanitizedAtCallSiteOrError

java.lang.Object
org.ek9lang.compiler.phase3.SanitizedAtCallSiteOrError
All Implemented Interfaces:
Consumer<EK9Parser.CallContext>

final class SanitizedAtCallSiteOrError extends Object implements Consumer<EK9Parser.CallContext>
Checks for inappropriate use of 'sanitized' at function/method call sites. The 'sanitized' keyword belongs in the function/method definition (on parameters), not at call sites where arguments are passed.

The "Rejection at the Source" philosophy means: - The function/method author decides sanitization requirements in the definition - The compiler automatically injects sanitization at call sites - Callers don't specify sanitization - it's enforced automatically

Grammar rule being checked:

call
    : identifierReference paramExpression
    | parameterisedType
    | LPAREN parameterisedType RPAREN
    | primaryReference paramExpression
    | dynamicFunctionDeclaration
    | call paramExpression
    ;

expressionParam
    : directive? SANITIZED? (identifier (ASSIGN | ASSIGN2 | COLON))? expression
    ;