"examples/vscode:/vscode.git/clone" did not exist on "1656115917ea5d65fe1f6a572f313b3afc3e8b6c"
Commit 7c8e1979 authored by Paul's avatar Paul
Browse files

Formatting

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