| 897 | } |
| 898 | |
| 899 | std::any ParserVisitor::visitConditionalOr( |
| 900 | CelParser::ConditionalOrContext* ctx) { |
| 901 | auto result = ExprFromAny(visit(ctx->e)); |
| 902 | if (ctx->ops.empty()) { |
| 903 | return ExprToAny(std::move(result)); |
| 904 | } |
| 905 | ExpressionBalancer b(factory_, CelOperator::LOGICAL_OR, std::move(result)); |
| 906 | for (size_t i = 0; i < ctx->ops.size(); ++i) { |
| 907 | auto op = ctx->ops[i]; |
| 908 | if (i >= ctx->e1.size()) { |
| 909 | return ExprToAny( |
| 910 | factory_.ReportError(SourceRangeFromParserRuleContext(ctx), |
| 911 | "unexpected character, wanted '||'")); |
| 912 | } |
| 913 | auto next = ExprFromAny(visit(ctx->e1[i])); |
| 914 | int64_t op_id = factory_.NextId(SourceRangeFromToken(op)); |
| 915 | b.AddTerm(op_id, std::move(next)); |
| 916 | } |
| 917 | return ExprToAny(b.Balance()); |
| 918 | } |
| 919 | |
| 920 | std::any ParserVisitor::visitConditionalAnd( |
| 921 | CelParser::ConditionalAndContext* ctx) { |
nothing calls this directly
no test coverage detected