MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / visitExpr

Method visitExpr

parser/parser.cc:883–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883std::any ParserVisitor::visitExpr(CelParser::ExprContext* ctx) {
884 auto result = ExprFromAny(visit(ctx->e));
885 if (!ctx->op) {
886 return ExprToAny(std::move(result));
887 }
888 std::vector<Expr> arguments;
889 arguments.reserve(3);
890 arguments.push_back(std::move(result));
891 int64_t op_id = factory_.NextId(SourceRangeFromToken(ctx->op));
892 arguments.push_back(ExprFromAny(visit(ctx->e1)));
893 arguments.push_back(ExprFromAny(visit(ctx->e2)));
894
895 return ExprToAny(
896 factory_.NewCall(op_id, CelOperator::CONDITIONAL, std::move(arguments)));
897}
898
899std::any ParserVisitor::visitConditionalOr(
900 CelParser::ConditionalOrContext* ctx) {

Callers

nothing calls this directly

Calls 5

ExprFromAnyFunction · 0.85
ExprToAnyFunction · 0.85
SourceRangeFromTokenFunction · 0.85
NextIdMethod · 0.45
NewCallMethod · 0.45

Tested by

no test coverage detected