| 563 | } |
| 564 | |
| 565 | fn visit_conditionalAnd(&mut self, ctx: &ConditionalAndContext<'_>) -> Self::Return { |
| 566 | let result = match &ctx.e { |
| 567 | None => self.report_error::<ParseError, _>( |
| 568 | ctx.start().deref(), |
| 569 | None, |
| 570 | "No `RelationContextAll`!", |
| 571 | ), |
| 572 | Some(e) => <Self as ParseTreeVisitorCompat>::visit(self, e.as_ref()), |
| 573 | }; |
| 574 | if ctx.ops.is_empty() { |
| 575 | result |
| 576 | } else { |
| 577 | let mut l = self.new_logic_manager(operators::LOGICAL_AND, result); |
| 578 | let rest = &ctx.e1; |
| 579 | if ctx.ops.len() > rest.len() { |
| 580 | // why is >= not ok? |
| 581 | self.report_error::<ParseError, _>( |
| 582 | &ctx.start(), |
| 583 | None, |
| 584 | "unexpected character, wanted '&&'", |
| 585 | ); |
| 586 | return IdedExpr::default(); |
| 587 | } |
| 588 | for (i, op) in ctx.ops.iter().enumerate() { |
| 589 | let next = self.visit(rest[i].deref()); |
| 590 | let op_id = self.helper.next_id(op); |
| 591 | l.add_term(op_id, next) |
| 592 | } |
| 593 | l.expr() |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | fn visit_relation(&mut self, ctx: &RelationContext<'_>) -> Self::Return { |
| 598 | if ctx.op.is_none() { |