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

Function DeclFromProto

common/decl_proto.cc:72–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72absl::StatusOr<absl::variant<VariableDecl, FunctionDecl>> DeclFromProto(
73 const cel::expr::Decl& decl,
74 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
75 google::protobuf::Arena* absl_nonnull arena) {
76 if (decl.has_ident()) {
77 return VariableDeclFromProto(decl.name(), decl.ident(), descriptor_pool,
78 arena);
79 } else if (decl.has_function()) {
80 return FunctionDeclFromProto(decl.name(), decl.function(), descriptor_pool,
81 arena);
82 }
83 return absl::InvalidArgumentError("empty google.api.expr.Decl proto");
84}
85
86} // namespace cel

Callers 2

TEST_PFunction · 0.85
DeclFromV1Alpha1ProtoFunction · 0.85

Calls 4

VariableDeclFromProtoFunction · 0.85
FunctionDeclFromProtoFunction · 0.85
has_functionMethod · 0.80
nameMethod · 0.45

Tested by 1

TEST_PFunction · 0.68