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

Function AST_GetClauseIndices

src/ast/ast.c:311–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311uint *AST_GetClauseIndices
312(
313 const AST *ast,
314 cypher_astnode_type_t clause_type
315) {
316 uint *clause_indices = array_new(uint, 1);
317 uint clause_count = cypher_ast_query_nclauses(ast->root);
318 for(uint i = 0; i < clause_count; i ++) {
319 if(cypher_astnode_type(cypher_ast_query_get_clause(ast->root, i)) == clause_type) {
320 array_append(clause_indices, i);
321 }
322 }
323 return clause_indices;
324}
325
326uint AST_GetClauseCount(const AST *ast, cypher_astnode_type_t clause_type) {
327 uint clause_count = cypher_ast_query_nclauses(ast->root);

Callers 6

_rewrite_projectionsFunction · 0.85
_ValidateUnion_ClausesFunction · 0.85
_process_segmentsFunction · 0.85
getASTSegmentIndicesFunction · 0.85

Calls

no outgoing calls

Tested by 1

getASTSegmentIndicesFunction · 0.68