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

Function CelBlockMacroExpander

conformance/service.cc:113–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113absl::optional<cel::Expr> CelBlockMacroExpander(cel::MacroExprFactory& factory,
114 cel::Expr& target,
115 absl::Span<cel::Expr> args) {
116 if (!IsCelNamespace(target)) {
117 return absl::nullopt;
118 }
119 cel::Expr& bindings_arg = args[0];
120 if (!bindings_arg.has_list_expr()) {
121 return factory.ReportErrorAt(
122 bindings_arg, "cel.block requires the first arg to be a list literal");
123 }
124 return factory.NewCall("cel.@block", args);
125}
126
127absl::optional<cel::Expr> CelIndexMacroExpander(cel::MacroExprFactory& factory,
128 cel::Expr& target,

Callers

nothing calls this directly

Calls 4

IsCelNamespaceFunction · 0.85
has_list_exprMethod · 0.80
ReportErrorAtMethod · 0.45
NewCallMethod · 0.45

Tested by

no test coverage detected