Validate variable usage
(
variable: &Variable,
ctx: &mut ValidationContext,
errors: &mut Vec<ValidationError>,
)
| 1908 | |
| 1909 | /// Validate variable usage |
| 1910 | fn 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 |
| 1929 | fn validate_unary_operation( |
no test coverage detected