aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/rule.hxx')
-rw-r--r--libbuild2/rule.hxx28
1 files changed, 12 insertions, 16 deletions
diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx
index 4b05379..af89124 100644
--- a/libbuild2/rule.hxx
+++ b/libbuild2/rule.hxx
@@ -24,13 +24,12 @@ namespace build2
//
// Note: match() is only called once but may not be followed by apply().
//
- // The match_extra argument is used to pass additional information that is
- // only needed by some rule implementations. It is also a way for us to
- // later pass more information without breaking source compatibility.
+ // The match_extra argument (the type is defined in target.hxx) is used to
+ // pass additional information that is only needed by some rule
+ // implementations. It is also a way for us to later pass more information
+ // without breaking source compatibility.
//
- struct match_extra
- {
- };
+ struct match_extra;
class LIBBUILD2_SYMEXPORT rule
{
@@ -172,18 +171,15 @@ namespace build2
public:
// Some of the operations come in compensating pairs, such as update and
// clean, install and uninstall. An ad hoc rule implementation may choose
- // to provide a fallback implementation of a compensating operation if it
- // is providing the other half (passed in the fallback argument).
- //
- // The default implementation calls rule::match() if fallback is absent
- // and returns false if fallback is present. So an implementation that
- // doesn't care about this semantics can implement the straight rule
- // interface.
+ // to provide a fallback implementation of a reverse operation if it is
+ // providing the other half.
//
- virtual bool
- match (action, target&, const string&, match_extra&,
- optional<action> fallback) const;
+ virtual optional<action>
+ reverse_fallback (action, const target_type&) const;
+ // The default implementation forwards to the pattern's match() if there
+ // is a pattern and returns true otherwise.
+ //
virtual bool
match (action, target&, const string&, match_extra&) const override;