Commit 7c8e1979 authored by Paul's avatar Paul
Browse files

Formatting

parent 3cb4edfe
......@@ -190,11 +190,11 @@ auto pop_back_args(Ts&&... xs)
};
}
template<class T>
template <class T>
struct always_f
{
T x;
template<class... Ts>
template <class... Ts>
constexpr T operator()(Ts&&...) const
{
return x;
......
......@@ -261,16 +261,14 @@ struct lazy_or
template <class Op, bool Start, bool Matches>
struct folder
{
template<class... Ms>
template <class... Ms>
static bool fold_match(matcher_context& ctx, instruction_ref ins, Ms... ms)
{
Op op;
auto matched = [&](auto m) { return [&] { return ctx.matched(m, ins); }; };
return
fold([&](auto x, auto y) { return op(always(x), matched(y)); })(Start, ms...);
return fold([&](auto x, auto y) { return op(always(x), matched(y)); })(Start, ms...);
}
template <class... Ts>
auto operator()(Ts... ms) const
{
......
......@@ -156,7 +156,7 @@ TEST_CASE(match_arg8)
auto sum = p.add_instruction(sum_op{}, one, two);
p.add_instruction(pass_op{}, sum);
auto m = match::name("sum")(match::all_of(match::arg(0)(match::name("@literal")),
match::arg(1)(match::name("@literal"))),
match::arg(1)(match::name("@literal"))),
match::standard_shape());
auto r = find_match(p, m);
EXPECT(bool{r.result == sum});
......
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