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

Function _AST_MapReferencedNode

src/ast/ast_build_reference_map.c:80–95  ·  view source on GitHub ↗

Adds a node to the referenced entities rax, in case it has labels or properties (inline filter).

Source from the content-addressed store, hash-verified

78
79// Adds a node to the referenced entities rax, in case it has labels or properties (inline filter).
80static void _AST_MapReferencedNode(AST *ast, const cypher_astnode_t *node, bool force_mapping) {
81
82 const cypher_astnode_t *properties = cypher_ast_node_pattern_get_properties(node);
83 // Disregard empty property maps.
84 if(properties && cypher_astnode_nchildren(properties) == 0) properties = NULL;
85 // A node with inlined filters is always referenced for the FilterTree.
86 // (In the case of a CREATE path, these are properties being set)
87 if(properties || force_mapping) {
88 const char *alias = AST_ToString(node);
89 _AST_UpdateRefMap(ast, alias);
90
91 // Map any references within the properties map, such as 'b' in:
92 // ({val: ID(b)})
93 if(properties) _AST_MapExpression(ast, properties);
94 }
95}
96
97// Adds an edge to the referenced entities rax if it has multiple types or any properties (inline filter).
98static void _AST_MapReferencedEdge(AST *ast, const cypher_astnode_t *edge, bool force_mapping) {

Callers 1

Calls 3

AST_ToStringFunction · 0.85
_AST_UpdateRefMapFunction · 0.85
_AST_MapExpressionFunction · 0.85

Tested by

no test coverage detected