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

Function validate_property_access

graphlite/src/ast/validator.rs:1881–1907  ·  view source on GitHub ↗

Validate property access

(
    prop_access: &PropertyAccess,
    ctx: &mut ValidationContext,
    errors: &mut Vec<ValidationError>,
)

Source from the content-addressed store, hash-verified

1879
1880/// Validate property access
1881fn validate_property_access(
1882 prop_access: &PropertyAccess,
1883 ctx: &mut ValidationContext,
1884 errors: &mut Vec<ValidationError>,
1885) {
1886 // Check if the object variable is declared
1887 if !ctx.declared_variables.contains(&prop_access.object) {
1888 // If we have graph context (from session or FROM clause),
1889 // variables will be resolved at runtime with the graph
1890 if !ctx.has_graph_context {
1891 errors.push(ValidationError {
1892 message: format!("Undefined variable '{}'", prop_access.object),
1893 location: None,
1894 error_type: ValidationErrorType::Semantic,
1895 });
1896 }
1897 }
1898
1899 // Validate property name syntax
1900 if prop_access.property.is_empty() {
1901 errors.push(ValidationError {
1902 message: "Property name cannot be empty".to_string(),
1903 location: None,
1904 error_type: ValidationErrorType::Syntax,
1905 });
1906 }
1907}
1908
1909/// Validate variable usage
1910fn validate_variable_usage(

Callers 1

validate_expressionFunction · 0.85

Calls 2

containsMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected