| 176 | } |
| 177 | |
| 178 | std::vector<FunctionRegistry::LazyOverload> |
| 179 | FunctionRegistry::FindLazyOverloadsByArity(absl::string_view name, |
| 180 | bool receiver_style, |
| 181 | size_t arity) const { |
| 182 | std::vector<FunctionRegistry::LazyOverload> matched_funcs; |
| 183 | |
| 184 | auto overloads = functions_.find(name); |
| 185 | if (overloads == functions_.end()) { |
| 186 | return matched_funcs; |
| 187 | } |
| 188 | |
| 189 | for (const auto& entry : overloads->second.lazy_overloads) { |
| 190 | if (entry.descriptor->receiver_style() == receiver_style && |
| 191 | entry.descriptor->types().size() == arity) { |
| 192 | matched_funcs.push_back({*entry.descriptor, *entry.function_provider}); |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | return matched_funcs; |
| 197 | } |
| 198 | |
| 199 | absl::node_hash_map<std::string, std::vector<const cel::FunctionDescriptor*>> |
| 200 | FunctionRegistry::ListFunctions() const { |
no test coverage detected