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

Function CreateBasicCompiler

testing/testrunner/runner_lib_test.cc:90–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90absl::StatusOr<std::unique_ptr<cel::Compiler>> CreateBasicCompiler() {
91 CEL_ASSIGN_OR_RETURN(
92 std::unique_ptr<cel::CompilerBuilder> builder,
93 cel::NewCompilerBuilder(cel::internal::GetTestingDescriptorPool()));
94 CEL_RETURN_IF_ERROR(builder->AddLibrary(cel::StandardCompilerLibrary()));
95 cel::TypeCheckerBuilder& checker_builder = builder->GetCheckerBuilder();
96 CEL_RETURN_IF_ERROR(
97 checker_builder.AddVariable(cel::MakeVariableDecl("x", cel::IntType())));
98 CEL_RETURN_IF_ERROR(
99 checker_builder.AddVariable(cel::MakeVariableDecl("y", cel::IntType())));
100 return std::move(builder)->Build();
101}
102
103absl::StatusOr<std::unique_ptr<const cel::Runtime>> CreateTestRuntime() {
104 CEL_ASSIGN_OR_RETURN(cel::RuntimeBuilder standard_runtime_builder,

Callers 3

runner_lib_test.ccFile · 0.85
TEST_PFunction · 0.85
TESTFunction · 0.85

Calls 8

StandardCompilerLibraryFunction · 0.85
MakeVariableDeclFunction · 0.85
AddVariableMethod · 0.80
CEL_ASSIGN_OR_RETURNFunction · 0.50
NewCompilerBuilderFunction · 0.50
IntTypeClass · 0.50
AddLibraryMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected