MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / visit_conditionalAnd

Method visit_conditionalAnd

cel/src/parser/parser.rs:565–595  ·  view source on GitHub ↗
(&mut self, ctx: &ConditionalAndContext<'_>)

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 8

startMethod · 0.80
new_logic_managerMethod · 0.80
visitMethod · 0.80
next_idMethod · 0.80
add_termMethod · 0.80
derefMethod · 0.45
iterMethod · 0.45
exprMethod · 0.45

Tested by

no test coverage detected