Try and work around msvc++ non-macro max resolution quirk
This commit is contained in:
parent
ce48584f7d
commit
389d79b6b4
1 changed files with 3 additions and 3 deletions
|
@ -2541,7 +2541,7 @@ inline std::shared_ptr<Context> Context::builtins() {
|
||||||
}));
|
}));
|
||||||
globals.set("namespace", Value::callable([=](const std::shared_ptr<Context> &, ArgumentsValue & args) {
|
globals.set("namespace", Value::callable([=](const std::shared_ptr<Context> &, ArgumentsValue & args) {
|
||||||
auto ns = Value::object();
|
auto ns = Value::object();
|
||||||
args.expectArgs("namespace", {0, 0}, {0, std::numeric_limits<size_t>::max()});
|
args.expectArgs("namespace", {0, 0}, {0, (std::numeric_limits<size_t>::max)()});
|
||||||
for (auto & [name, value] : args.kwargs) {
|
for (auto & [name, value] : args.kwargs) {
|
||||||
ns.set(name, value);
|
ns.set(name, value);
|
||||||
}
|
}
|
||||||
|
@ -2596,7 +2596,7 @@ inline std::shared_ptr<Context> Context::builtins() {
|
||||||
};
|
};
|
||||||
// https://jinja.palletsprojects.com/en/3.0.x/templates/#jinja-filters.reject
|
// https://jinja.palletsprojects.com/en/3.0.x/templates/#jinja-filters.reject
|
||||||
globals.set("reject", Value::callable([=](const std::shared_ptr<Context> & context, ArgumentsValue & args) {
|
globals.set("reject", Value::callable([=](const std::shared_ptr<Context> & context, ArgumentsValue & args) {
|
||||||
args.expectArgs("reject", {2, std::numeric_limits<size_t>::max()}, {0, 0});
|
args.expectArgs("reject", {2, (std::numeric_limits<size_t>::max)()}, {0, 0});
|
||||||
auto & items = args.args[0];
|
auto & items = args.args[0];
|
||||||
auto filter_fn = context->get(args.args[1]);
|
auto filter_fn = context->get(args.args[1]);
|
||||||
if (filter_fn.is_null()) throw std::runtime_error("Undefined filter: " + args.args[1].dump());
|
if (filter_fn.is_null()) throw std::runtime_error("Undefined filter: " + args.args[1].dump());
|
||||||
|
@ -2667,7 +2667,7 @@ inline std::shared_ptr<Context> Context::builtins() {
|
||||||
return out;
|
return out;
|
||||||
}));
|
}));
|
||||||
globals.set("selectattr", Value::callable([=](const std::shared_ptr<Context> & context, ArgumentsValue & args) {
|
globals.set("selectattr", Value::callable([=](const std::shared_ptr<Context> & context, ArgumentsValue & args) {
|
||||||
args.expectArgs("selectattr", {2, std::numeric_limits<size_t>::max()}, {0, 0});
|
args.expectArgs("selectattr", {2, (std::numeric_limits<size_t>::max)()}, {0, 0});
|
||||||
auto & items = args.args[0];
|
auto & items = args.args[0];
|
||||||
if (items.is_null())
|
if (items.is_null())
|
||||||
return Value::array();
|
return Value::array();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue