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

Method AddLibrary

compiler/compiler_factory.cc:89–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 validator_(std::move(validator)) {}
88
89 absl::Status AddLibrary(CompilerLibrary library) override {
90 if (!library.id.empty()) {
91 auto [it, inserted] = library_ids_.insert(library.id);
92
93 if (!inserted) {
94 return absl::AlreadyExistsError(
95 absl::StrCat("library already exists: ", library.id));
96 }
97 }
98
99 if (library.configure_checker) {
100 CEL_RETURN_IF_ERROR(type_checker_builder_->AddLibrary({
101 .id = library.id,
102 .configure = std::move(library.configure_checker),
103 }));
104 }
105 if (library.configure_parser) {
106 CEL_RETURN_IF_ERROR(parser_builder_->AddLibrary({
107 .id = library.id,
108 .configure = std::move(library.configure_parser),
109 }));
110 }
111 return absl::OkStatus();
112 }
113
114 absl::Status AddLibrarySubset(CompilerLibrarySubset subset) override {
115 if (subset.library_id.empty()) {

Callers 15

TEST_PFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
ConfigureCompilerFunction · 0.45
MakeCelCompilerFunction · 0.45
TEST_PFunction · 0.45
CreateMethod · 0.45
MakeConfiguredCompilerFunction · 0.45
ConfigureCompilerFunction · 0.45

Calls 1

emptyMethod · 0.45

Tested by 8

TEST_PFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TEST_PFunction · 0.36
CreateMethod · 0.36