diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-17 08:16:23 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-17 08:16:23 +0200 |
commit | 724a88eb4c5ebdddb6d334beec53105f679c154a (patch) | |
tree | 6a01b488274a2f9f3ed5c470323b085762822204 | |
parent | 0d8e5265a54d4362c83d292dd90330f81da6836c (diff) |
Add ability to customize in::rule's default symbol and mode
-rw-r--r-- | build2/in/rule.cxx | 4 | ||||
-rw-r--r-- | build2/in/rule.hxx | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/build2/in/rule.cxx b/build2/in/rule.cxx index 5988566..1495c64 100644 --- a/build2/in/rule.cxx +++ b/build2/in/rule.cxx @@ -146,7 +146,7 @@ namespace build2 // Substitution symbol. // - char sym ('$'); + char sym (symbol_); if (const string* s = cast_null<string> (t["in.symbol"])) { if (s->size () == 1) @@ -157,7 +157,7 @@ namespace build2 // Substitution mode. // - bool strict (true); + bool strict (strict_); if (const string* s = cast_null<string> (t["in.substitution"])) { if (*s == "lax") diff --git a/build2/in/rule.hxx b/build2/in/rule.hxx index e588fd9f..a68e80c 100644 --- a/build2/in/rule.hxx +++ b/build2/in/rule.hxx @@ -19,7 +19,8 @@ namespace build2 class rule: public build2::rule { public: - rule () {} + rule (char symbol = '$', bool strict = true) + : symbol_ (symbol), strict_ (strict) {} virtual bool match (action, target&, const string&) const override; @@ -43,6 +44,10 @@ namespace build2 target_state perform_update (action, const target&) const; + + protected: + char symbol_; + bool strict_; }; } } |