Commit 6d348981 authored by Paul's avatar Paul
Browse files

Improve names

parent cac345d7
...@@ -259,10 +259,10 @@ struct lazy_or ...@@ -259,10 +259,10 @@ struct lazy_or
}; };
template <class Op, bool Start, bool Matches> template <class Op, bool Start, bool Matches>
struct folder struct match_fold_f
{ {
template <class... Ms> template <class... Ms>
static bool fold_match(matcher_context& ctx, instruction_ref ins, Ms... ms) static bool fold_matchers(matcher_context& ctx, instruction_ref ins, Ms... ms)
{ {
Op op; Op op;
auto matched = [&](auto m) { return [&] { return ctx.matched(m, ins); }; }; auto matched = [&](auto m) { return [&] { return ctx.matched(m, ins); }; };
...@@ -273,7 +273,7 @@ struct folder ...@@ -273,7 +273,7 @@ struct folder
auto operator()(Ts... ms) const auto operator()(Ts... ms) const
{ {
return make_bf_matcher([=](matcher_context& ctx, instruction_ref ins) { return make_bf_matcher([=](matcher_context& ctx, instruction_ref ins) {
bool matches = folder::fold_match(ctx, ins, ms...); bool matches = match_fold_f::fold_matchers(ctx, ins, ms...);
if(matches == Matches) if(matches == Matches)
return ins; return ins;
return ctx.not_found(); return ctx.not_found();
...@@ -292,7 +292,7 @@ struct folder ...@@ -292,7 +292,7 @@ struct folder
select(start, [&](auto ins) { select(start, [&](auto ins) {
auto fm = [&] { auto fm = [&] {
return mpack( return mpack(
[&](auto... ms) { return folder::fold_match(ctx, ins, ms...); }); [&](auto... ms) { return match_fold_f::fold_matchers(ctx, ins, ms...); });
}; };
matches = op(always(matches), fm); matches = op(always(matches), fm);
}); });
...@@ -304,9 +304,9 @@ struct folder ...@@ -304,9 +304,9 @@ struct folder
} }
}; };
const constexpr auto all_of = folder<lazy_and, true, true>{}; const constexpr auto all_of = match_fold_f<lazy_and, true, true>{};
const constexpr auto any_of = folder<lazy_or, false, true>{}; const constexpr auto any_of = match_fold_f<lazy_or, false, true>{};
const constexpr auto none_of = folder<lazy_or, false, false>{}; const constexpr auto none_of = match_fold_f<lazy_or, false, false>{};
inline auto inputs() inline auto inputs()
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment