From 51666badaa58d1cc70a05b362dbf9fbef64a7296 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Oct 2020 15:16:28 +0200 Subject: Add operation callback for adhoc rule match and apply --- libbuild2/rule.hxx | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'libbuild2/rule.hxx') diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx index ae9c865..fa61bc5 100644 --- a/libbuild2/rule.hxx +++ b/libbuild2/rule.hxx @@ -24,17 +24,17 @@ 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. + // + struct match_extra + { + }; + class LIBBUILD2_SYMEXPORT rule { public: - // 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. - // - struct match_extra - { - }; - virtual bool match (action, target&, const string& hint, match_extra&) const = 0; @@ -144,7 +144,7 @@ namespace build2 // // Note: not exported. // - class adhoc_rule: public simple_rule + class adhoc_rule: public rule { public: location_value loc; // Buildfile location of the recipe. @@ -174,12 +174,11 @@ namespace build2 // interface. // virtual bool - match (action, target&, const string&, optional fallback) const; + match (action, target&, const string&, match_extra&, + optional fallback) const; virtual bool - match (action, target&, const string&) const override; - - using simple_rule::match; // To make Clang happy. + match (action, target&, const string&, match_extra&) const override; // Dump support. // -- cgit v1.1