Validate path pattern
(
pattern: &PathPattern,
ctx: &mut ValidationContext,
errors: &mut Vec<ValidationError>,
)
| 2455 | |
| 2456 | /// Validate path pattern |
| 2457 | fn validate_path_pattern( |
| 2458 | pattern: &PathPattern, |
| 2459 | ctx: &mut ValidationContext, |
| 2460 | errors: &mut Vec<ValidationError>, |
| 2461 | ) { |
| 2462 | if pattern.elements.is_empty() { |
| 2463 | errors.push(ValidationError { |
| 2464 | message: "Path pattern must have at least one element".to_string(), |
| 2465 | location: Some(pattern.location.clone()), |
| 2466 | error_type: ValidationErrorType::Structural, |
| 2467 | }); |
| 2468 | } |
| 2469 | |
| 2470 | for element in &pattern.elements { |
| 2471 | match element { |
| 2472 | PatternElement::Node(node) => { |
| 2473 | validate_node(node, ctx, errors); |
| 2474 | } |
| 2475 | PatternElement::Edge(edge) => { |
| 2476 | validate_edge(edge, ctx, errors); |
| 2477 | } |
| 2478 | } |
| 2479 | } |
| 2480 | } |
| 2481 | |
| 2482 | /// Validate node |
| 2483 | fn validate_node(node: &Node, ctx: &mut ValidationContext, errors: &mut Vec<ValidationError>) { |
no test coverage detected