MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / validate_variable_declarations

Function validate_variable_declarations

graphlite/src/ast/validator.rs:855–896  ·  view source on GitHub ↗

Validate variable declarations and scope

(
    query: &Query,
    ctx: &mut ValidationContext,
    errors: &mut Vec<ValidationError>,
)

Source from the content-addressed store, hash-verified

853
854/// Validate variable declarations and scope
855fn validate_variable_declarations(
856 query: &Query,
857 ctx: &mut ValidationContext,
858 errors: &mut Vec<ValidationError>,
859) {
860 match query {
861 Query::Basic(basic_query) => {
862 validate_basic_query_variables(basic_query, ctx, errors);
863 }
864 Query::SetOperation(set_op) => {
865 // For set operations, validate each query independently
866 let mut left_ctx = ctx.clone();
867 validate_variable_declarations(&set_op.left, &mut left_ctx, errors);
868 let mut right_ctx = ctx.clone();
869 validate_variable_declarations(&set_op.right, &mut right_ctx, errors);
870 }
871 Query::Limited { query, .. } => {
872 validate_variable_declarations(query, ctx, errors);
873 }
874 Query::WithQuery(_) => {
875 // TODO: Implement WithQuery validation
876 }
877 Query::Let(_) => {
878 // TODO: Implement LET validation
879 }
880 Query::For(_) => {
881 // TODO: Implement FOR validation
882 }
883 Query::Filter(_) => {
884 // TODO: Implement FILTER validation
885 }
886 Query::Return(_) => {
887 // TODO: Implement RETURN validation
888 }
889 Query::Unwind(_) => {
890 // TODO: Implement UNWIND variable validation
891 }
892 Query::MutationPipeline(_) => {
893 // TODO: Validate mutation pipeline variables
894 }
895 }
896}
897
898fn validate_basic_query_variables(
899 query: &BasicQuery,

Callers 2

validate_queryFunction · 0.85
validate_subqueryFunction · 0.85

Calls 2

cloneMethod · 0.80

Tested by

no test coverage detected