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

Function CheckForMarkedAttributes

eval/eval/select_step.cc:53–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53absl::optional<Value> CheckForMarkedAttributes(const AttributeTrail& trail,
54 ExecutionFrameBase& frame) {
55 if (frame.unknown_processing_enabled() &&
56 frame.attribute_utility().CheckForUnknownExact(trail)) {
57 return frame.attribute_utility().CreateUnknownSet(trail.attribute());
58 }
59
60 if (frame.missing_attribute_errors_enabled() &&
61 frame.attribute_utility().CheckForMissingAttribute(trail)) {
62 auto result = frame.attribute_utility().CreateMissingAttributeError(
63 trail.attribute());
64
65 if (result.ok()) {
66 return std::move(result).value();
67 }
68 // Invariant broken (an invalid CEL Attribute shouldn't match anything).
69 // Log and return a CelError.
70 ABSL_LOG(ERROR) << "Invalid attribute pattern matched select path: "
71 << result.status().ToString(); // NOLINT: OSS compatibility
72 return cel::ErrorValue(std::move(result).status());
73 }
74
75 return absl::nullopt;
76}
77
78void TestOnlySelect(const StructValue& msg, const std::string& field,
79 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,

Callers 2

EvaluateMethod · 0.70
EvaluateMethod · 0.70

Calls 11

ErrorValueFunction · 0.85
CheckForUnknownExactMethod · 0.80
attributeMethod · 0.80
CreateUnknownSetMethod · 0.45
okMethod · 0.45
valueMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected