From 6b3e75edf034ebcbd048a24c283c7bcf7b1da019 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 25 May 2021 11:19:04 +0200 Subject: 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 --- libbuild2/parser.hxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'libbuild2/parser.hxx') 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 = {}, + 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&); -- cgit v1.1