(expr: &Expression<'_>, offset: u32, spans: &mut Vec<(u32, u32)>)
| 556 | // ─── Expression walker ────────────────────────────────────────────────────── |
| 557 | |
| 558 | fn collect_spans_from_expression(expr: &Expression<'_>, offset: u32, spans: &mut Vec<(u32, u32)>) { |
| 559 | let expr_span = expr.span(); |
| 560 | if !push_if_contains(expr_span, offset, spans) { |
| 561 | return; |
| 562 | } |
| 563 | |
| 564 | match expr { |
| 565 | Expression::Binary(bin) => { |
| 566 | collect_spans_from_expression(bin.lhs, offset, spans); |
| 567 | collect_spans_from_expression(bin.rhs, offset, spans); |
| 568 | } |
| 569 | |
| 570 | Expression::UnaryPrefix(unary) => { |
| 571 | collect_spans_from_expression(unary.operand, offset, spans); |
| 572 | } |
| 573 | |
| 574 | Expression::UnaryPostfix(unary) => { |
| 575 | collect_spans_from_expression(unary.operand, offset, spans); |
| 576 | } |
| 577 | |
| 578 | Expression::Parenthesized(paren) => { |
| 579 | collect_spans_from_expression(paren.expression, offset, spans); |
| 580 | } |
| 581 | |
| 582 | Expression::Assignment(assign) => { |
| 583 | collect_spans_from_expression(assign.lhs, offset, spans); |
| 584 | collect_spans_from_expression(assign.rhs, offset, spans); |
| 585 | } |
| 586 | |
| 587 | Expression::Conditional(cond) => { |
| 588 | collect_spans_from_expression(cond.condition, offset, spans); |
| 589 | if let Some(then_expr) = cond.then { |
| 590 | collect_spans_from_expression(then_expr, offset, spans); |
| 591 | } |
| 592 | collect_spans_from_expression(cond.r#else, offset, spans); |
| 593 | } |
| 594 | |
| 595 | Expression::Call(call) => { |
| 596 | match call { |
| 597 | Call::Function(func_call) => { |
| 598 | collect_spans_from_expression(func_call.function, offset, spans); |
| 599 | collect_spans_from_argument_list(&func_call.argument_list, offset, spans); |
| 600 | } |
| 601 | Call::Method(method_call) => { |
| 602 | collect_spans_from_expression(method_call.object, offset, spans); |
| 603 | // method selector |
| 604 | let sel_span = method_call.method.span(); |
| 605 | let _ = push_if_contains(sel_span, offset, spans); |
| 606 | collect_spans_from_argument_list(&method_call.argument_list, offset, spans); |
| 607 | } |
| 608 | Call::NullSafeMethod(method_call) => { |
| 609 | collect_spans_from_expression(method_call.object, offset, spans); |
| 610 | let sel_span = method_call.method.span(); |
| 611 | let _ = push_if_contains(sel_span, offset, spans); |
| 612 | collect_spans_from_argument_list(&method_call.argument_list, offset, spans); |
| 613 | } |
| 614 | Call::StaticMethod(static_call) => { |
| 615 | collect_spans_from_expression(static_call.class, offset, spans); |
no test coverage detected