| 200 | } |
| 201 | |
| 202 | void LookupInContainer(const Value& container, const Value& key, |
| 203 | ExecutionFrameBase& frame, Value& result) { |
| 204 | // Select steps can be applied to either maps or messages |
| 205 | switch (container.kind()) { |
| 206 | case ValueKind::kMap: { |
| 207 | LookupInMap(Cast<MapValue>(container), key, frame, result); |
| 208 | return; |
| 209 | } |
| 210 | case ValueKind::kList: { |
| 211 | LookupInList(Cast<ListValue>(container), key, frame, result); |
| 212 | return; |
| 213 | } |
| 214 | default: |
| 215 | result = cel::ErrorValue(absl::InvalidArgumentError( |
| 216 | absl::StrCat("Invalid container type: '", |
| 217 | ValueKindToString(container->kind()), "'"))); |
| 218 | return; |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | void PerformLookup(ExecutionFrameBase& frame, const Value& container, |
| 223 | const Value& key, const AttributeTrail& container_trail, |
no test coverage detected