aboutsummaryrefslogtreecommitdiff
path: root/build/token
diff options
context:
space:
mode:
Diffstat (limited to 'build/token')
-rw-r--r--build/token14
1 files changed, 10 insertions, 4 deletions
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_;