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

Function RegisterStandardExtensions

env/env_std_extensions.cc:32–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace cel {
31
32void RegisterStandardExtensions(Env& env) {
33 env.RegisterCompilerLibrary("cel.lib.ext.bindings", "bindings", 0, []() {
34 return extensions::BindingsCompilerLibrary();
35 });
36 env.RegisterCompilerLibrary("cel.lib.ext.encoders", "encoders", 0, []() {
37 return extensions::EncodersCompilerLibrary();
38 });
39 for (int version = 0; version <= extensions::kListsExtensionLatestVersion;
40 ++version) {
41 env.RegisterCompilerLibrary(
42 "cel.lib.ext.lists", "lists", version,
43 [version]() { return extensions::ListsCompilerLibrary(version); });
44 }
45 for (int version = 0; version <= extensions::kMathExtensionLatestVersion;
46 ++version) {
47 env.RegisterCompilerLibrary(
48 "cel.lib.ext.math", "math", version,
49 [version]() { return extensions::MathCompilerLibrary(version); });
50 }
51 for (int version = 0; version <= kOptionalExtensionLatestVersion; ++version) {
52 env.RegisterCompilerLibrary("optional", "", version, [version]() {
53 return OptionalCompilerLibrary(version);
54 });
55 }
56 env.RegisterCompilerLibrary("cel.lib.ext.protos", "protos", 0, []() {
57 return extensions::ProtoExtCompilerLibrary();
58 });
59 env.RegisterCompilerLibrary("cel.lib.ext.sets", "sets", 0, []() {
60 return extensions::SetsCompilerLibrary();
61 });
62 for (int version = 0; version <= extensions::kStringsExtensionLatestVersion;
63 ++version) {
64 env.RegisterCompilerLibrary(
65 "cel.lib.ext.strings", "strings", version,
66 [version]() { return extensions::StringsCompilerLibrary(version); });
67 }
68 env.RegisterCompilerLibrary(
69 "cel.lib.ext.comprev2", "two-var-comprehensions", 0,
70 []() { return extensions::ComprehensionsV2CompilerLibrary(); });
71 env.RegisterCompilerLibrary("cel.lib.ext.regex", "regex", 0, []() {
72 return extensions::RegexExtCompilerLibrary();
73 });
74}
75
76} // namespace cel

Callers 4

TEST_PFunction · 0.70
TEST_PFunction · 0.70
TEST_PFunction · 0.70
TESTFunction · 0.70

Calls 11

BindingsCompilerLibraryFunction · 0.85
EncodersCompilerLibraryFunction · 0.85
ListsCompilerLibraryFunction · 0.85
MathCompilerLibraryFunction · 0.85
OptionalCompilerLibraryFunction · 0.85
ProtoExtCompilerLibraryFunction · 0.85
SetsCompilerLibraryFunction · 0.85
StringsCompilerLibraryFunction · 0.85
RegexExtCompilerLibraryFunction · 0.85

Tested by 4

TEST_PFunction · 0.56
TEST_PFunction · 0.56
TEST_PFunction · 0.56
TESTFunction · 0.56