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

Method MakeProgram

codelab/network_functions_test.cc:230–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228 }
229
230 absl::StatusOr<std::unique_ptr<Program>> MakeProgram(absl::string_view expr) {
231 CEL_ASSIGN_OR_RETURN(auto result, compiler_->Compile(expr));
232 if (!result.IsValid()) {
233 return absl::InvalidArgumentError(result.FormatError());
234 }
235 CEL_ASSIGN_OR_RETURN(auto ast, result.ReleaseAst());
236 return runtime_->CreateProgram(std::move(ast));
237 }
238
239 private:
240 BenchmarkState(std::unique_ptr<Compiler> c, std::unique_ptr<const Runtime> r)

Callers 5

BM_ParseAddressFunction · 0.80
BM_ParseAddressVarFunction · 0.80
BM_ParseAddressMatcherFunction · 0.80

Calls 3

IsValidMethod · 0.80
FormatErrorMethod · 0.80
CreateProgramMethod · 0.45

Tested by

no test coverage detected