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

Function _Validate_map

src/ast/ast_validations.c:484–506  ·  view source on GitHub ↗

validate the values of a map

Source from the content-addressed store, hash-verified

482
483// validate the values of a map
484static VISITOR_STRATEGY _Validate_map
485(
486 const cypher_astnode_t *n, // ast-node (map)
487 bool start, // first traversal
488 ast_visitor *visitor // visitor
489) {
490 validations_ctx *vctx = AST_Visitor_GetContext(visitor);
491
492 // we enter ONLY when start=true, so no check is needed
493
494 // traverse the entries of the map
495 uint nentries = cypher_ast_map_nentries(n);
496 for (uint i = 0; i < nentries; i++) {
497 const cypher_astnode_t *exp = cypher_ast_map_get_value(n, i);
498 AST_Visitor_visit(exp, visitor);
499 if(ErrorCtx_EncounteredError()) {
500 return VISITOR_BREAK;
501 }
502 }
503
504 // do not traverse children
505 return VISITOR_CONTINUE;
506}
507
508// validate a projection
509static VISITOR_STRATEGY _Validate_projection

Callers

nothing calls this directly

Calls 3

AST_Visitor_GetContextFunction · 0.85
AST_Visitor_visitFunction · 0.85

Tested by

no test coverage detected