MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / try_builtin_func

Function try_builtin_func

common/jinja/runtime.cpp:296–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296static value try_builtin_func(context & ctx, const std::string & name, value & input, bool undef_on_missing = false) {
297 JJ_DEBUG("Trying built-in function '%s' for type %s", name.c_str(), input->type().c_str());
298 if (ctx.is_get_stats) {
299 value_t::stats_t::mark_used(input);
300 input->stats.ops.insert(name);
301 }
302 auto builtins = input->get_builtins();
303 auto it = builtins.find(name);
304 if (it != builtins.end()) {
305 JJ_DEBUG("Binding built-in '%s'", name.c_str());
306 return mk_val<value_func>(name, it->second, input);
307 }
308 if (undef_on_missing) {
309 return mk_val<value_undefined>(name);
310 }
311 throw std::runtime_error("Unknown (built-in) filter '" + name + "' for type " + input->type());
312}
313
314value filter_expression::execute_impl(context & ctx) {
315 value input = operand ? operand->execute(ctx) : val;

Callers 1

execute_implMethod · 0.85

Calls 4

findMethod · 0.80
endMethod · 0.80
typeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected