From a094b8f43d7401b01e68e3000b3fea5bb058b19b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Aug 2016 16:14:47 +0200 Subject: Don't treat trailing dot as part of variable name So we can write $major.$minor --- build2/lexer.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'build2/lexer.cxx') diff --git a/build2/lexer.cxx b/build2/lexer.cxx index 8124765..a5a4a3a 100644 --- a/build2/lexer.cxx +++ b/build2/lexer.cxx @@ -280,6 +280,17 @@ namespace build2 done = true; break; } + case '.': + { + // Normally '.' is part of the variable (namespace separator) + // unless it is trailing (think $major.$minor). + // + get (); + xchar p (peek ()); + done = eos (p) || !(alnum (p) || p == '_'); + unget (c); + break; + } } if (done) -- cgit v1.1