Validate graph expression
(
graph_expr: &GraphExpression,
_ctx: &mut ValidationContext,
errors: &mut Vec<ValidationError>,
)
| 2409 | |
| 2410 | /// Validate graph expression |
| 2411 | fn validate_graph_expression( |
| 2412 | graph_expr: &GraphExpression, |
| 2413 | _ctx: &mut ValidationContext, |
| 2414 | errors: &mut Vec<ValidationError>, |
| 2415 | ) { |
| 2416 | match graph_expr { |
| 2417 | GraphExpression::Reference(path) => { |
| 2418 | if path.segments.is_empty() { |
| 2419 | errors.push(ValidationError { |
| 2420 | message: "Graph reference path cannot be empty".to_string(), |
| 2421 | location: Some(path.location.clone()), |
| 2422 | error_type: ValidationErrorType::Semantic, |
| 2423 | }); |
| 2424 | } |
| 2425 | } |
| 2426 | GraphExpression::Union { left, right, .. } => { |
| 2427 | validate_graph_expression(left, _ctx, errors); |
| 2428 | validate_graph_expression(right, _ctx, errors); |
| 2429 | } |
| 2430 | GraphExpression::CurrentGraph => { |
| 2431 | // CurrentGraph is valid - it refers to the session's current graph |
| 2432 | // No validation needed |
| 2433 | } |
| 2434 | } |
| 2435 | } |
| 2436 | |
| 2437 | /// Validate match clause |
| 2438 | fn validate_match_clause( |
no test coverage detected