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

Function OptionalCompilerLibrary

compiler/optional.cc:25–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace cel {
24
25CompilerLibrary OptionalCompilerLibrary(int version) {
26 CompilerLibrary library =
27 CompilerLibrary::FromCheckerLibrary(OptionalCheckerLibrary(version));
28
29 library.configure_parser = [version](ParserBuilder& builder) {
30 builder.GetOptions().enable_optional_syntax = true;
31 absl::Status status;
32 status.Update(builder.AddMacro(OptMapMacro()));
33 if (version == 0) {
34 return status;
35 }
36 status.Update(builder.AddMacro(OptFlatMapMacro()));
37 return status;
38 };
39
40 return library;
41}
42
43} // namespace cel

Callers 8

TEST_PFunction · 0.85
TESTFunction · 0.85
StdLibCompilerFunction · 0.85
CreateProgramFunction · 0.85
NewTestCompilerFunction · 0.85
CreateCompilerFunction · 0.85

Calls 3

OptionalCheckerLibraryFunction · 0.85
GetOptionsMethod · 0.80
AddMacroMethod · 0.80

Tested by 7

TEST_PFunction · 0.68
TESTFunction · 0.68
StdLibCompilerFunction · 0.68
CreateProgramFunction · 0.68
NewTestCompilerFunction · 0.68
CreateCompilerFunction · 0.68