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/cli | |
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/cli')
-rw-r--r-- | build2/cli/init.cxx | 10 | ||||
-rw-r--r-- | build2/cli/rule.cxx | 8 | ||||
-rw-r--r-- | build2/cli/rule.hxx | 6 | ||||
-rw-r--r-- | build2/cli/target.cxx | 2 | ||||
-rw-r--r-- | build2/cli/target.hxx | 2 |
5 files changed, 14 insertions, 14 deletions
diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index a4403a9..df123ba 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -23,7 +23,7 @@ namespace build2 { namespace cli { - static const compile compile_; + static const compile_rule compile_rule_; bool config_init (scope& rs, @@ -306,10 +306,10 @@ namespace build2 auto reg = [&r] (meta_operation_id mid, operation_id oid) { - r.insert<cli_cxx> (mid, oid, "cli.compile", compile_); - r.insert<cxx::hxx> (mid, oid, "cli.compile", compile_); - r.insert<cxx::cxx> (mid, oid, "cli.compile", compile_); - r.insert<cxx::ixx> (mid, oid, "cli.compile", compile_); + r.insert<cli_cxx> (mid, oid, "cli.compile", compile_rule_); + r.insert<cxx::hxx> (mid, oid, "cli.compile", compile_rule_); + r.insert<cxx::cxx> (mid, oid, "cli.compile", compile_rule_); + r.insert<cxx::ixx> (mid, oid, "cli.compile", compile_rule_); }; reg (perform_id, update_id); diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index d05b190..42f2176 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -43,10 +43,10 @@ namespace build2 return false; } - match_result compile:: + bool compile_rule:: match (action a, target& xt, const string&) const { - tracer trace ("cli::compile::match"); + tracer trace ("cli::compile_rule::match"); if (cli_cxx* pt = xt.is_a<cli_cxx> ()) { @@ -149,7 +149,7 @@ namespace build2 } } - recipe compile:: + recipe compile_rule:: apply (action a, target& xt) const { if (cli_cxx* pt = xt.is_a<cli_cxx> ()) @@ -208,7 +208,7 @@ namespace build2 } } - target_state compile:: + target_state compile_rule:: perform_update (action a, const target& xt) { const cli_cxx& t (xt.as<cli_cxx> ()); diff --git a/build2/cli/rule.hxx b/build2/cli/rule.hxx index 9af1da4..ba6337a 100644 --- a/build2/cli/rule.hxx +++ b/build2/cli/rule.hxx @@ -16,12 +16,12 @@ namespace build2 { // @@ Redo as two separate rules? // - class compile: public rule + class compile_rule: public rule { public: - compile () {} + compile_rule () {} - virtual match_result + virtual bool match (action, target&, const string&) const override; virtual recipe diff --git a/build2/cli/target.cxx b/build2/cli/target.cxx index c35ee18..be3098c 100644 --- a/build2/cli/target.cxx +++ b/build2/cli/target.cxx @@ -33,7 +33,7 @@ namespace build2 // cli.cxx // group_view cli_cxx:: - group_members (action_type) const + group_members (action) const { static_assert (sizeof (cli_cxx_members) == sizeof (const target*) * 3, "member layout incompatible with array"); diff --git a/build2/cli/target.hxx b/build2/cli/target.hxx index 1247172..d595856 100644 --- a/build2/cli/target.hxx +++ b/build2/cli/target.hxx @@ -41,7 +41,7 @@ namespace build2 using mtime_target::mtime_target; virtual group_view - group_members (action_type) const override; + group_members (action) const override; public: static const target_type static_type; |