From 4a9ee48613cf5c59e071400280b62358eb79987e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 2 Mar 2015 09:52:59 +0200 Subject: Indicate whether token is separated from previous one by whitespaces --- build/token | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'build/token') diff --git a/build/token b/build/token index a071987..e6930ff 100644 --- a/build/token +++ b/build/token @@ -31,6 +31,11 @@ namespace build token_type type () const {return t_;} + // Token is whitespace-separated from the previous token. + // + bool + separated () const {return s_;} + std::string const& name () const {assert (t_ == token_type::name); return n_;} @@ -38,14 +43,15 @@ namespace build std::uint64_t column () const {return c_;} public: - token (token_type t, std::uint64_t l, std::uint64_t c) - : t_ (t), l_ (l), c_ (c) {} + token (token_type t, bool s, std::uint64_t l, std::uint64_t c) + : t_ (t), s_ (s), l_ (l), c_ (c) {} - token (std::string n, std::uint64_t l, std::uint64_t c) - : t_ (token_type::name), n_ (std::move (n)), l_ (l), c_ (c) {} + token (std::string n, bool s, std::uint64_t l, std::uint64_t c) + : t_ (token_type::name), s_ (s), n_ (std::move (n)), l_ (l), c_ (c) {} private: token_type t_; + bool s_; std::string n_; std::uint64_t l_; -- cgit v1.1