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

Function InExemptFunction

validator/homogeneous_literal_validator.cc:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace {
32
33bool InExemptFunction(const NavigableAstNode& node,
34 const std::vector<std::string>& exempt_functions) {
35 const NavigableAstNode* parent = node.parent();
36 while (parent != nullptr) {
37 if (parent->node_kind() == NodeKind::kCall) {
38 absl::string_view fn_name = parent->expr()->call_expr().function();
39 for (const auto& exempt : exempt_functions) {
40 if (exempt == fn_name) {
41 return true;
42 }
43 }
44 }
45 parent = parent->parent();
46 }
47 return false;
48}
49
50bool IsOptional(const TypeSpec& t) {
51 return t.has_abstract_type() && t.abstract_type().name() == "optional_type";

Callers 1

Calls 3

parentMethod · 0.80
node_kindMethod · 0.80
exprMethod · 0.45

Tested by

no test coverage detected