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

Function MakeBindComprehension

extensions/lists_functions.cc:410–417  ·  view source on GitHub ↗

Create an expression equivalent to: cel.bind(varIdent, varExpr, call_expr)

Source from the content-addressed store, hash-verified

408// Create an expression equivalent to:
409// cel.bind(varIdent, varExpr, call_expr)
410absl::optional<Expr> MakeBindComprehension(MacroExprFactory& factory,
411 Expr var_ident, Expr var_expr,
412 Expr call_expr) {
413 auto var_name = var_ident.ident_expr().name();
414 return factory.NewComprehension(
415 "#unused", factory.NewList(), std::move(var_name), std::move(var_expr),
416 factory.NewBoolConst(false), std::move(var_ident), std::move(call_expr));
417}
418
419// This macro transforms an expression like:
420//

Callers 1

ListSortByMacroFunction · 0.85

Calls 4

nameMethod · 0.45
NewComprehensionMethod · 0.45
NewListMethod · 0.45
NewBoolConstMethod · 0.45

Tested by

no test coverage detected