diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 08:46:35 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:22 +0200 |
commit | 4b1f902b33d0826ccb2f6d5a1ceb8db7bdd2defe (patch) | |
tree | 9f0fcddb0b6cad34965a7ca330c3cd8b033c195d /build2/token | |
parent | 08aba2ee7cf407c9c25233ebbf43d0310e0f1b5e (diff) |
Change token type 'name' to more general 'word'
Diffstat (limited to 'build2/token')
-rw-r--r-- | build2/token | 14 |
1 files changed, 9 insertions, 5 deletions
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) {} }; |