| 39 | }; |
| 40 | |
| 41 | absl::Status LookupIdent(absl::string_view name, ExecutionFrameBase& frame, |
| 42 | Value& result, AttributeTrail& attribute) { |
| 43 | if (frame.attribute_tracking_enabled()) { |
| 44 | attribute = AttributeTrail(std::string(name)); |
| 45 | if (frame.missing_attribute_errors_enabled() && |
| 46 | frame.attribute_utility().CheckForMissingAttribute(attribute)) { |
| 47 | CEL_ASSIGN_OR_RETURN( |
| 48 | result, frame.attribute_utility().CreateMissingAttributeError( |
| 49 | attribute.attribute())); |
| 50 | return absl::OkStatus(); |
| 51 | } |
| 52 | if (frame.unknown_processing_enabled() && |
| 53 | frame.attribute_utility().CheckForUnknownExact(attribute)) { |
| 54 | result = |
| 55 | frame.attribute_utility().CreateUnknownSet(attribute.attribute()); |
| 56 | return absl::OkStatus(); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | CEL_ASSIGN_OR_RETURN( |
| 61 | auto found, frame.activation().FindVariable(name, frame.descriptor_pool(), |
| 62 | frame.message_factory(), |
| 63 | frame.arena(), &result)); |
| 64 | |
| 65 | if (found) { |
| 66 | return absl::OkStatus(); |
| 67 | } |
| 68 | |
| 69 | result = cel::ErrorValue(CreateError( |
| 70 | absl::StrCat("No value with name \"", name, "\" found in Activation"))); |
| 71 | |
| 72 | return absl::OkStatus(); |
| 73 | } |
| 74 | |
| 75 | absl::Status IdentStep::Evaluate(ExecutionFrame* frame) const { |
| 76 | Value value; |
no test coverage detected