From 2cdeda47d3315829cf7d5ed46a6f8de187ec9bfb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Nov 2016 08:46:41 +0200 Subject: Change token type 'name' to more general 'word' (testscript) --- build2/test/script/lexer | 2 +- build2/test/script/lexer.cxx | 10 +++++----- build2/test/script/parser.cxx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'build2') diff --git a/build2/test/script/lexer b/build2/test/script/lexer index be65018..5d77ab9 100644 --- a/build2/test/script/lexer +++ b/build2/test/script/lexer @@ -63,7 +63,7 @@ namespace build2 next_line (); virtual token - name (bool) override; + word (bool) override; protected: bool quoted_ = false; diff --git a/build2/test/script/lexer.cxx b/build2/test/script/lexer.cxx index 008223c..f752f39 100644 --- a/build2/test/script/lexer.cxx +++ b/build2/test/script/lexer.cxx @@ -259,25 +259,25 @@ namespace build2 } } - // Otherwise it is a name. + // Otherwise it is a word. // unget (c); - return name (sep); + return word (sep); } token lexer:: - name (bool sep) + word (bool sep) { // Customized implementation that handles special variable names ($*, // $~, $NNN). // if (state_.top ().mode != lexer_mode::variable) - return base_lexer::name (sep); + return base_lexer::word (sep); xchar c (peek ()); if (c != '*' && c != '~' && !digit (c)) - return base_lexer::name (sep); + return base_lexer::word (sep); uint64_t ln (c.line), cn (c.column); string lexeme; diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index 01dd010..8f910c0 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -441,7 +441,7 @@ namespace build2 f = false; } - if (tt == type::name) + if (tt == type::word) { w = move (t.value); f = true; @@ -581,7 +581,7 @@ namespace build2 { // Check if this is the end marker. // - if (tt == type::name && + if (tt == type::word && !t.quoted && t.value == em && peek () == type::newline) -- cgit v1.1