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

Function AST_GetClause

src/ast/ast.c:280–296  ·  view source on GitHub ↗

retrieve the first instance of the specified clause in the AST segment if any

Source from the content-addressed store, hash-verified

278
279// retrieve the first instance of the specified clause in the AST segment if any
280const cypher_astnode_t *AST_GetClause
281(
282 const AST *ast,
283 cypher_astnode_type_t clause_type,
284 uint *clause_idx
285) {
286 uint clause_count = cypher_ast_query_nclauses(ast->root);
287 for(uint i = 0; i < clause_count; i ++) {
288 const cypher_astnode_t *child = cypher_ast_query_get_clause(ast->root, i);
289 if(cypher_astnode_type(child) == clause_type) {
290 if(clause_idx) *clause_idx = i;
291 return child;
292 }
293 }
294
295 return NULL;
296}
297
298const cypher_astnode_t *AST_GetClauseByIdx
299(

Callers 2

AST_ContainsClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected