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

Function _ValidateScopes

src/ast/ast_validations.c:2017–2038  ·  view source on GitHub ↗

validate a query

Source from the content-addressed store, hash-verified

2015
2016// validate a query
2017static AST_Validation _ValidateScopes
2018(
2019 AST *ast // ast
2020) {
2021 // create a context for the traversal
2022 validations_ctx ctx = {
2023 .union_all = NOT_DEFINED,
2024 .defined_identifiers = raxNew(),
2025 .ignore_identifiers = false
2026 };
2027
2028 // create a visitor
2029 ast_visitor visitor = {&ctx, validations_mapping};
2030
2031 // visit (traverse) the ast
2032 AST_Visitor_visit(ast->root, &visitor);
2033
2034 // cleanup
2035 raxFree(ctx.defined_identifiers);
2036
2037 return !ErrorCtx_EncounteredError() ? AST_VALID : AST_INVALID;
2038}
2039
2040// build the global mapping from ast-node-type to visiting functions
2041bool AST_ValidationsMappingInit(void) {

Callers 1

AST_Validate_QueryFunction · 0.85

Calls 2

AST_Visitor_visitFunction · 0.85

Tested by

no test coverage detected