aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-05-25 11:19:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-05-28 10:10:44 +0200
commit6b3e75edf034ebcbd048a24c283c7bcf7b1da019 (patch)
tree4dff34692fd09c6f201a486c0d92549adc864947 /libbuild2/parser.hxx
parentbb02e152dc036879ab0b2d1d8aa2cb19084b8e16 (diff)
Add support for regex-based target type/pattern specific variables
This is in addition to the already supported path-based target type/pattern specific variables. For example: hxx{*}: x = y # path-based hxx{~/.*/}: x = y # regex-based
Diffstat (limited to 'libbuild2/parser.hxx')
-rw-r--r--libbuild2/parser.hxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/libbuild2/parser.hxx b/libbuild2/parser.hxx
index 889d339..007e508 100644
--- a/libbuild2/parser.hxx
+++ b/libbuild2/parser.hxx
@@ -103,6 +103,7 @@ namespace build2
// Recursive descent parser.
//
protected:
+ using pattern_type = name::pattern_type;
// Pattern expansion mode.
//
@@ -129,8 +130,10 @@ namespace build2
void
parse_variable_block (token&, token_type&,
- const target_type* = nullptr,
- string = string ());
+ optional<pattern_type> = {},
+ const target_type* = nullptr,
+ string = {},
+ const location& = {});
void
parse_recipe (token&, token_type&,
@@ -223,9 +226,10 @@ namespace build2
parse_variable (token&, token_type&, const variable&, token_type);
void
- parse_type_pattern_variable (token&, token_type&,
- const target_type&, string,
- const variable&, token_type, const location&);
+ parse_type_pattern_variable (
+ token&, token_type&,
+ pattern_type, const target_type&, string, const location&,
+ const variable&, token_type, const location&);
const variable&
parse_variable_name (names&&, const location&);