| 528 | } |
| 529 | |
| 530 | fn visit_conditionalOr(&mut self, ctx: &ConditionalOrContext<'_>) -> Self::Return { |
| 531 | let result = match &ctx.e { |
| 532 | None => { |
| 533 | self.report_error::<ParseError, _>( |
| 534 | ctx.start().deref(), |
| 535 | None, |
| 536 | "No `ConditionalAndContextAll`!", |
| 537 | ); |
| 538 | IdedExpr::default() |
| 539 | } |
| 540 | Some(e) => <Self as ParseTreeVisitorCompat>::visit(self, e.as_ref()), |
| 541 | }; |
| 542 | if ctx.ops.is_empty() { |
| 543 | result |
| 544 | } else { |
| 545 | let mut l = self.new_logic_manager(operators::LOGICAL_OR, result); |
| 546 | let rest = &ctx.e1; |
| 547 | if ctx.ops.len() > rest.len() { |
| 548 | // why is >= not ok? |
| 549 | self.report_error::<ParseError, _>( |
| 550 | &ctx.start(), |
| 551 | None, |
| 552 | "unexpected character, wanted '||'", |
| 553 | ); |
| 554 | return IdedExpr::default(); |
| 555 | } |
| 556 | for (i, op) in ctx.ops.iter().enumerate() { |
| 557 | let next = self.visit(rest[i].deref()); |
| 558 | let op_id = self.helper.next_id(op); |
| 559 | l.add_term(op_id, next) |
| 560 | } |
| 561 | l.expr() |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | fn visit_conditionalAnd(&mut self, ctx: &ConditionalAndContext<'_>) -> Self::Return { |
| 566 | let result = match &ctx.e { |