From b2374e3174e13682fcfa3ffe3fc62f2fd161a7cc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Nov 2015 14:31:40 +0200 Subject: Implement target type/pattern-specific variables For example: cxx{*-options}: dist = true 1. Only single '*' wildcard is supported, matches 0 or more characters. 2. If target type is not specified, it defaults to any target. 3. Appending (+=) is not allowed. 4. The value is expanded immediately in the context of the scope. 5. The more specific pattern (i.e., with the shortest "stem") is preferred. If the stem has the same length, then the last defined (but not redefined) pattern is used. This will probably have to change to become an error. See tests/variable/type-pattern for more examples. --- build/parser | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'build/parser') diff --git a/build/parser b/build/parser index 04066ff..e37e68a 100644 --- a/build/parser +++ b/build/parser @@ -25,6 +25,7 @@ namespace build { public: typedef build::names names_type; + typedef build::variable variable_type; parser (): fail (&path_) {} @@ -77,6 +78,9 @@ namespace build variable_name (names_type&&, const location&); names_type + variable_value (token&, token_type&, const variable_type&); + + names_type eval (token&, token_type&); // If chunk is true, then parse the smallest but complete, name-wise, -- cgit v1.1