(&mut self, ctx: &ExprContext<'_>)
| 493 | } |
| 494 | |
| 495 | fn visit_expr(&mut self, ctx: &ExprContext<'_>) -> Self::Return { |
| 496 | match &ctx.op { |
| 497 | None => match &ctx.e { |
| 498 | None => self.report_error::<ParseError, _>( |
| 499 | ctx.start().deref(), |
| 500 | None, |
| 501 | "No `ConditionalOrContextAll`!", |
| 502 | ), |
| 503 | Some(e) => <Self as ParseTreeVisitorCompat>::visit(self, e.as_ref()), |
| 504 | }, |
| 505 | Some(op) => { |
| 506 | if let (Some(e), Some(e1), Some(e2)) = (&ctx.e, &ctx.e1, &ctx.e2) { |
| 507 | let result = self.visit(e.as_ref()); |
| 508 | let op_id = self.helper.next_id(op); |
| 509 | let if_true = self.visit(e1.as_ref()); |
| 510 | let if_false = self.visit(e2.as_ref()); |
| 511 | self.global_call_or_macro( |
| 512 | op_id, |
| 513 | operators::CONDITIONAL.to_string(), |
| 514 | vec![result, if_true, if_false], |
| 515 | ) |
| 516 | } else { |
| 517 | self.report_error::<ParseError, _>( |
| 518 | ctx.start().deref(), |
| 519 | None, |
| 520 | format!( |
| 521 | "Incomplete `ExprContext` for `{}` expression!", |
| 522 | operators::CONDITIONAL |
| 523 | ), |
| 524 | ) |
| 525 | } |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | fn visit_conditionalOr(&mut self, ctx: &ConditionalOrContext<'_>) -> Self::Return { |
| 531 | let result = match &ctx.e { |
nothing calls this directly
no test coverage detected