diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-20 13:46:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-03 14:35:45 +0200 |
commit | 934f2a9a90c5cad3cdc8a66b50c17827a3ddbcee (patch) | |
tree | f35f106e5369e98350327c79080c571195234c0b /build2/test/rule.hxx | |
parent | 280f4a5bf787587227ca193cd59c6bd74091db70 (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/test/rule.hxx')
-rw-r--r-- | build2/test/rule.hxx | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/build2/test/rule.hxx b/build2/test/rule.hxx index 819121c..b331263 100644 --- a/build2/test/rule.hxx +++ b/build2/test/rule.hxx @@ -17,34 +17,46 @@ namespace build2 { namespace test { - class rule_common: public build2::rule, protected virtual common + class rule: public build2::rule, protected virtual common { public: - virtual match_result + explicit + rule (common_data&& d): common (move (d)) {} + + virtual bool match (action, target&, const string&) const override; + virtual recipe + apply (action, target&) const override; + + static target_state + perform_update (action, const target&); + + target_state + perform_test (action, const target&, size_t) const; + target_state - perform_script (action, const target&) const; + perform_script (action, const target&, size_t) const; }; - class rule: public rule_common + class default_rule: public rule // For disambiguation in module. { public: - virtual recipe - apply (action, target&) const override; - - static target_state - perform_test (action, const target&); + explicit + default_rule (common_data&& d): common (move (d)), rule (move (d)) {} }; - class alias_rule: public rule_common + // In addition to the above rule's semantics, this rule sees through to + // the group's members. + // + class group_rule: public rule { public: + explicit + group_rule (common_data&& d): common (move (d)), rule (move (d)) {} + virtual recipe apply (action, target&) const override; - - target_state - perform_test (action, const target&) const; }; } } |