diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-30 16:14:47 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-30 16:14:47 +0200 |
commit | a094b8f43d7401b01e68e3000b3fea5bb058b19b (patch) | |
tree | f9fda0405ff63625e2f6aa7345e5fc1ef59244e6 | |
parent | e879c347f4f05dac5405bcc45ae2d5c9dde5447c (diff) |
Don't treat trailing dot as part of variable name
So we can write $major.$minor
-rw-r--r-- | build2/lexer.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
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) |