From 17287b34a8090d381278c02b7bc6676669968099 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Mar 2015 11:43:03 +0200 Subject: Implement new default target logic, canonical directory name (empty value) The logic is as follows: if we have an explicit current directory target, then that's the default target. Otherwise, we take the first target and use it as a prerequisite to create an implicit current directory target, effectively making it the default target via an alias. If there are no targets in this buildfile, then we don't do anything. --- build/parser | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'build/parser') diff --git a/build/parser b/build/parser index 2e399c9..e5aeb60 100644 --- a/build/parser +++ b/build/parser @@ -17,6 +17,7 @@ namespace build { class scope; + class target; class lexer; class parser @@ -61,6 +62,12 @@ namespace build // Utilities. // private: + void + process_default_target (token&); + + // Lexer. + // + private: token_type next (token&, token_type&); @@ -83,6 +90,7 @@ namespace build const std::string* path_; // Path processed by diagnostic_string(). lexer* lexer_; scope* scope_; + target* default_target_; token peek_ {token_type::eos, false, 0, 0}; bool peeked_ {false}; -- cgit v1.1