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

Method visit_conditionalOr

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

Source from the content-addressed store, hash-verified

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 {

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