diff options
-rw-r--r-- | build2/lexer | 2 | ||||
-rw-r--r-- | build2/lexer.cxx | 6 | ||||
-rw-r--r-- | build2/parser.cxx | 3 | ||||
-rw-r--r-- | build2/token | 4 | ||||
-rw-r--r-- | build2/utility | 1 |
5 files changed, 8 insertions, 8 deletions
diff --git a/build2/lexer b/build2/lexer index 570b753..c6a6f5b 100644 --- a/build2/lexer +++ b/build2/lexer @@ -114,7 +114,7 @@ namespace build2 token next_quoted (); - token + virtual token name (bool separated); // Return true if we have seen any spaces. Skipped empty lines diff --git a/build2/lexer.cxx b/build2/lexer.cxx index 8f09baf..148b7c2 100644 --- a/build2/lexer.cxx +++ b/build2/lexer.cxx @@ -346,7 +346,7 @@ namespace build2 // else if (m == lexer_mode::variable) { - if (!alnum (c) && c != '_') + if (c != '_' && !(lexeme.empty () ? alpha (c) : alnum (c))) { if (c != '.') done = true; @@ -357,7 +357,7 @@ namespace build2 // get (); xchar p (peek ()); - done = eos (p) || !(alnum (p) || p == '_'); + done = eos (p) || !(alpha (p) || p == '_'); unget (c); } } @@ -444,7 +444,7 @@ namespace build2 if (m == lexer_mode::variable) state_.pop (); - return token (move (lexeme), sep, quoted, ln, cn, token_printer); + return token (move (lexeme), sep, quoted, ln, cn); } diff --git a/build2/parser.cxx b/build2/parser.cxx index 0bca663..30c5ff3 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -2043,8 +2043,7 @@ namespace build2 tt != type::lparen) || peeked ().separated)) { tt = type::name; - t = token ( - move (concat), true, false, t.line, t.column, token_printer); + t = token (move (concat), true, false, t.line, t.column); concat.clear (); } else if (!first) diff --git a/build2/token b/build2/token index 065429c..18d377d 100644 --- a/build2/token +++ b/build2/token @@ -82,10 +82,10 @@ namespace build2 line (l), column (c), printer (p) {} - token (string n, bool s, bool q, uint64_t l, uint64_t c, printer_type* 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)), line (l), column (c), - printer (p) {} + printer (&token_printer) {} }; // Output the token value in a format suitable for diagnostics. diff --git a/build2/utility b/build2/utility index 99e79cc..2625d51 100644 --- a/build2/utility +++ b/build2/utility @@ -45,6 +45,7 @@ namespace build2 using butl::lcase; using butl::alpha; using butl::alnum; + using butl::digit; // Basic string utilities. // |