From 4b1f902b33d0826ccb2f6d5a1ceb8db7bdd2defe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Nov 2016 08:46:35 +0200 Subject: Change token type 'name' to more general 'word' --- build2/token | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'build2/token') diff --git a/build2/token b/build2/token index 18d377d..d172e0d 100644 --- a/build2/token +++ b/build2/token @@ -14,6 +14,10 @@ namespace build2 { // Extendable/inheritable enum-like class. // + // A line consists of a sequence of words separated by separators and + // terminated with the newline. If whitespace is a separator, then it is + // ignored. + // struct token_type { enum @@ -21,8 +25,8 @@ namespace build2 // NOTE: remember to update token_printer()! eos, - name, newline, + word, pair_separator, colon, lcbrace, // { @@ -64,9 +68,9 @@ namespace build2 token_type type; bool separated; // Whitespace-separated from the previous token. - bool quoted; // Name (or some part of it) was quoted. + bool quoted; // Word (or some part of it) was quoted. - string value; // Only valid for name. + string value; // Only valid for word. uint64_t line; uint64_t column; @@ -82,8 +86,8 @@ namespace build2 line (l), column (c), printer (p) {} - token (string n, bool s, bool q, uint64_t l, uint64_t c) - : type (token_type::name), separated (s), quoted (q), value (move (n)), + token (string v, bool s, bool q, uint64_t l, uint64_t c) + : type (token_type::word), separated (s), quoted (q), value (move (v)), line (l), column (c), printer (&token_printer) {} }; -- cgit v1.1