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

Method CompileToProto

common/ast_proto_test.cc:831–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829 }
830
831 absl::StatusOr<CheckedExpr> CompileToProto(absl::string_view expr) {
832 CEL_ASSIGN_OR_RETURN(auto result, compiler_->Compile(expr));
833 if (!result.IsValid()) {
834 return absl::InvalidArgumentError(absl::StrCat(
835 "Compilation failed: '", expr, "': ", result.FormatError()));
836 }
837 CEL_ASSIGN_OR_RETURN(auto ast, result.ReleaseAst());
838 CheckedExpr checked_expr;
839 CEL_RETURN_IF_ERROR(AstToCheckedExpr(*ast, &checked_expr));
840 return checked_expr;
841 }
842
843 protected:
844 std::unique_ptr<Compiler> compiler_;

Callers

nothing calls this directly

Calls 3

AstToCheckedExprFunction · 0.85
IsValidMethod · 0.80
FormatErrorMethod · 0.80

Tested by

no test coverage detected