MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _Validate_apply_operator

Function _Validate_apply_operator

src/ast/ast_validations.c:583–603  ·  view source on GitHub ↗

validate an apply operator

Source from the content-addressed store, hash-verified

581
582// validate an apply operator
583static VISITOR_STRATEGY _Validate_apply_operator
584(
585 const cypher_astnode_t *n, // ast-node
586 bool start, // first traversal
587 ast_visitor *visitor // visitor
588) {
589 validations_ctx *vctx = AST_Visitor_GetContext(visitor);
590 if(!start) {
591 return VISITOR_CONTINUE;
592 }
593
594 // Collect the function name.
595 const cypher_astnode_t *func = cypher_ast_apply_operator_get_func_name(n);
596 const char *func_name = cypher_ast_function_name_get_value(func);
597 if(_ValidateFunctionCall(func_name, (vctx->clause == CYPHER_AST_WITH ||
598 vctx->clause == CYPHER_AST_RETURN)) == AST_INVALID) {
599 return VISITOR_BREAK;
600 }
601
602 return VISITOR_RECURSE;
603}
604
605// validate reduce
606static VISITOR_STRATEGY _Validate_reduce

Callers

nothing calls this directly

Calls 2

AST_Visitor_GetContextFunction · 0.85
_ValidateFunctionCallFunction · 0.85

Tested by

no test coverage detected