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

Method visit_expr

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

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

startMethod · 0.80
visitMethod · 0.80
next_idMethod · 0.80
global_call_or_macroMethod · 0.80
derefMethod · 0.45

Tested by

no test coverage detected