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

Function validate_variable_usage

graphlite/src/ast/validator.rs:1910–1926  ·  view source on GitHub ↗

Validate variable usage

(
    variable: &Variable,
    ctx: &mut ValidationContext,
    errors: &mut Vec<ValidationError>,
)

Source from the content-addressed store, hash-verified

1908
1909/// Validate variable usage
1910fn validate_variable_usage(
1911 variable: &Variable,
1912 ctx: &mut ValidationContext,
1913 errors: &mut Vec<ValidationError>,
1914) {
1915 if !ctx.declared_variables.contains(&variable.name) {
1916 // If we have graph context (from session or FROM clause),
1917 // variables will be resolved at runtime with the graph
1918 if !ctx.has_graph_context {
1919 errors.push(ValidationError {
1920 message: format!("Undefined variable '{}'", variable.name),
1921 location: None,
1922 error_type: ValidationErrorType::Semantic,
1923 });
1924 }
1925 }
1926}
1927
1928/// Validate unary operations
1929fn validate_unary_operation(

Callers 1

validate_expressionFunction · 0.85

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected