From 77a0988759f295893b0b0e171249661a2059b1e7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Dec 2015 13:20:06 +0200 Subject: Implement support for multiple scope/targets in variable assignment Can now even do this: foo/ file{*-bar} file{baz}: x = y --- build/token | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'build/token') diff --git a/build/token b/build/token index 7eed747..d98b2e1 100644 --- a/build/token +++ b/build/token @@ -37,6 +37,7 @@ namespace build bool separated; // Whitespace-separated from the previous token. bool quoted; // Name (or some part of it) was quoted. + char pair; // Only valid for pair_separator. std::string value; // Only valid for name. std::uint64_t line; @@ -44,7 +45,15 @@ namespace build public: token (token_type t, bool s, std::uint64_t l, std::uint64_t c) - : type (t), separated (s), line (l), column (c) {} + : type (t), separated (s), quoted (false), line (l), column (c) {} + + token (char p, bool s, std::uint64_t l, std::uint64_t c) + : type (token_type::pair_separator), + separated (s), + quoted (false), + pair (p), + line (l), + column (c) {} token (std::string n, bool s, bool q, std::uint64_t l, std::uint64_t c) : type (token_type::name), -- cgit v1.1