aboutsummaryrefslogtreecommitdiff
path: root/build2/bin/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-20 13:46:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-03 14:35:45 +0200
commit934f2a9a90c5cad3cdc8a66b50c17827a3ddbcee (patch)
treef35f106e5369e98350327c79080c571195234c0b /build2/bin/rule.cxx
parent280f4a5bf787587227ca193cd59c6bd74091db70 (diff)
Get rid of action rule override semantics
Instead we now have two more or less separate match states for outer and inner parts of an action.
Diffstat (limited to 'build2/bin/rule.cxx')
-rw-r--r--build2/bin/rule.cxx24
1 files changed, 8 insertions, 16 deletions
diff --git a/build2/bin/rule.cxx b/build2/bin/rule.cxx
index bb9036b..79270c3 100644
--- a/build2/bin/rule.cxx
+++ b/build2/bin/rule.cxx
@@ -19,7 +19,7 @@ namespace build2
{
// fail_rule
//
- match_result fail_rule::
+ bool fail_rule::
match (action a, target& t, const string&) const
{
const char* n (t.dynamic_type ().name); // Ignore derived type.
@@ -37,8 +37,8 @@ namespace build2
// The whole logic is pretty much as if we had our two group members as
// our prerequisites.
//
- match_result lib_rule::
- match (action act, target& xt, const string&) const
+ bool lib_rule::
+ match (action, target& xt, const string&) const
{
lib& t (xt.as<lib> ());
@@ -57,35 +57,27 @@ namespace build2
t.a = a ? &search<liba> (t, t.dir, t.out, t.name) : nullptr;
t.s = s ? &search<libs> (t, t.dir, t.out, t.name) : nullptr;
- match_result mr (true);
-
- // If there is an outer operation, indicate that we match
- // unconditionally so that we don't override ourselves.
- //
- if (act.outer_operation () != 0)
- mr.recipe_action = action (act.meta_operation (), act.operation ());
-
- return mr;
+ return true;
}
recipe lib_rule::
- apply (action act, target& xt) const
+ apply (action a, target& xt) const
{
lib& t (xt.as<lib> ());
const target* m[] = {t.a, t.s};
- match_members (act, t, m);
+ match_members (a, t, m);
return &perform;
}
target_state lib_rule::
- perform (action act, const target& xt)
+ perform (action a, const target& xt)
{
const lib& t (xt.as<lib> ());
const target* m[] = {t.a, t.s};
- return execute_members (act, t, m);
+ return execute_members (a, t, m);
}
}
}